From aff6e0f8ba2ec6aa88bc4e35b268e57ce25c7696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20D=E2=80=99Aquino?= Date: Wed, 4 Sep 2024 18:14:41 -0700 Subject: [PATCH] Improve default fallback reaction formatting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel D’Aquino Closes: https://github.com/damus-io/damus/issues/2420 --- src/notification_manager/notification_manager.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/notification_manager/notification_manager.rs b/src/notification_manager/notification_manager.rs index ab3d01b..b42b806 100644 --- a/src/notification_manager/notification_manager.rs +++ b/src/notification_manager/notification_manager.rs @@ -397,7 +397,16 @@ impl NotificationManager { nostr_sdk::Kind::TextNote => ("New activity".to_string(), event.content.clone()), nostr_sdk::Kind::EncryptedDirectMessage => ("New direct message".to_string(), "Contents are encrypted".to_string()), nostr_sdk::Kind::Repost => ("Someone reposted".to_string(), event.content.clone()), - nostr_sdk::Kind::Reaction => ("New reaction".to_string(), event.content.clone()), + nostr_sdk::Kind::Reaction => { + let content_text = event.content.clone(); + let formatted_text = match content_text.as_str() { + "" => "❤️", + "+" => "❤️", + "-" => "👎", + _ => content_text.as_str(), + }; + ("New reaction".to_string(), formatted_text.to_string()) + }, nostr_sdk::Kind::ZapPrivateMessage => ("New zap private message".to_string(), "Contents are encrypted".to_string()), nostr_sdk::Kind::ZapReceipt => ("Someone zapped you".to_string(), "".to_string()), _ => ("New activity".to_string(), "".to_string()),