From a2848c5df2b73400fd4d009c7aa4489c286d1bcf Mon Sep 17 00:00:00 2001 From: nekobit Date: Wed, 17 Aug 2022 04:49:44 +0000 Subject: [PATCH] Fix reblog fake notification FossilOrigin-Name: 01cffdb17769dbb6b711e8a3ff7d239b824714e7ba47e5563671b52bcf7401c4 --- perl/status.pm | 10 ++++------ templates/status.tt | 8 ++++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/perl/status.pm b/perl/status.pm index 091b4ab..48d65c1 100644 --- a/perl/status.pm +++ b/perl/status.pm @@ -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, diff --git a/templates/status.tt b/templates/status.tt index 0f0b723..05958f5 100644 --- a/templates/status.tt +++ b/templates/status.tt @@ -13,10 +13,10 @@ [% format_username(boost || notif.account) %] - [% action_to_string(); %] + [% action_to_string() %] - [% action_to_icon(); %] + [% action_to_icon() %] [% END %] @@ -35,10 +35,10 @@ [% IF interacted_with && compact %] - [% action_to_string(); %] + [% action_to_string() %] - [% action_to_icon(); %] + [% action_to_icon() %] [% END %]