Improve default fallback reaction formatting

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Closes: https://github.com/damus-io/damus/issues/2420
This commit is contained in:
Daniel D’Aquino
2024-09-04 18:14:41 -07:00
parent abb3283eaa
commit aff6e0f8ba

View File

@ -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()),