Fix reblog fake notification

FossilOrigin-Name: 01cffdb17769dbb6b711e8a3ff7d239b824714e7ba47e5563671b52bcf7401c4
This commit is contained in:
nekobit 2022-08-17 04:49:44 +00:00
parent 93ba8c2737
commit a2848c5df2
2 changed files with 8 additions and 10 deletions

View file

@ -46,17 +46,15 @@ sub generate_status
# Functions
action_to_string => sub {
return unless $notif;
return lang('NOTIF_LIKED') if $notif->{type} eq 'favourite';
return lang('NOTIF_LIKED') if $notif && $notif->{type} eq 'favourite';
return lang('NOTIF_REPEATED') if $boost_acct || $notif->{type} eq 'reblog';
return lang('NOTIF_REACTED_WITH') .' '. $notif->{emoji} if $boost_acct || $notif->{type} eq 'emoji reaction';
return lang('NOTIF_REACTED_WITH') .' '. $notif->{emoji} if $notif->{type} eq 'emoji reaction';
},
action_to_icon => sub {
return unless $notif;
return get_icon('like') if $notif->{type} eq 'favourite';
return get_icon('like') if $notif && $notif->{type} eq 'favourite';
return get_icon('repeat') if $boost_acct || $notif->{type} eq 'reblog';
return $notif->{emoji} if $notif->{type} eq 'emoji reaction';
return $notif->{emoji} if $notif && $notif->{type} eq 'emoji reaction';
},
icon => \&get_icon,

View file

@ -13,10 +13,10 @@
<span class="notification-text-group-with-icon">
<span class="username">[% format_username(boost || notif.account) %]</span>
<span class="action">
[% action_to_string(); %]
[% action_to_string() %]
</span>
</span>
[% action_to_icon(); %]
[% action_to_icon() %]
</div>
</div>
[% END %]
@ -35,10 +35,10 @@
[% IF interacted_with && compact %]
<span class="action">
[% action_to_string(); %]
[% action_to_string() %]
</span>
<span class="action-icon">
[% action_to_icon(); %]
[% action_to_icon() %]
</span>
[% END %]