diff --git a/perl/string_helpers.pm b/perl/string_helpers.pm index 7f3399d..622f51c 100644 --- a/perl/string_helpers.pm +++ b/perl/string_helpers.pm @@ -50,7 +50,16 @@ sub format_username sub get_mentions_from_content { - my $status = shift; + my ($ssn, $status) = @_; + my $result = ''; + my $acct; # todo - ""; + while ($status->{'content'} =~ + /@(?:)?.*?(?:<\/span>)?/gs) + { + $acct = $2 . '@' . $1; + $result .= '@' . $acct . ' ' if $ssn->{account}->{acct} eq $acct; + } + ($status->{account}->{acct} eq $ssn->{account}->{acct}) + ? $result : '@' . $status->{account}->{acct} . ' ' . $result; } diff --git a/src/reply.c b/src/reply.c index 7203cde..2e9dc0b 100644 --- a/src/reply.c +++ b/src/reply.c @@ -75,7 +75,7 @@ char* construct_post_box(struct mstdnt_status* reply_status, * so we just grep for regex href * - Misskey/Mastodon adds an @ symbol in the href param, while pleroma adds /users and honk adds /u */ -#define REGEX_REPLY "@(?:)?.*?(?:<\\/span>)?" +#define REGEX_REPLY "" char* reply_status(struct session* ssn, char* id, struct mstdnt_status* status) { diff --git a/templates/postbox.tt b/templates/postbox.tt index 83f274e..46b4c06 100644 --- a/templates/postbox.tt +++ b/templates/postbox.tt @@ -3,11 +3,7 @@ [% END %]
- +