Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(notifications): use correct name for dm name (#875)

teoc609df5e5bb3
diff --git a/rust/cloud-storage/notification_service/src/notification/send/push/generate.rs b/rust/cloud-storage/notification_service/src/notification/send/push/generate.rs
index 0b5951b1ec..790737d22e 100644
--- a/rust/cloud-storage/notification_service/src/notification/send/push/generate.rs
+++ b/rust/cloud-storage/notification_service/src/notification/send/push/generate.rs
@@ -210,7 +210,7 @@ impl BuildNotification for ChannelMessageSendMetadata {
alert: Some(sns_client::Alert::Dictionary(sns_client::AlertDictionary {
title: Some(match self.common.channel_type {
model_notifications::ChannelType::DirectMessage => {
- self.common.channel_name.to_string()
+ self.sender.email_part().local_part().to_string()
}
_ => format!(
"{} <{}>",
@@ -234,14 +234,20 @@ impl BuildNotification for ChannelMentionMetadata {
&self,
ctx: Self::Ctx<'_>,
) -> Result<APNSPushNotification<()>, NotificationErr> {
+ let title = match self.common.channel_type {
+ model_notifications::ChannelType::DirectMessage => {
+ format!("{} mentioned you", ctx.email_part().local_part())
+ }
+ _ => format!(
+ "{} mentioned you in #{}",
+ ctx.email_part().local_part(),
+ &self.common.channel_name
+ ),
+ };
Ok(APNSPushNotification {
aps: Aps {
alert: Some(sns_client::Alert::Dictionary(sns_client::AlertDictionary {
- title: Some(format!(
- "{} mentioned you in #{}",
- ctx.email_part().as_ref(),
- &self.common.channel_name
- )),
+ title: Some(title),
body: Some(T::format_xml_text(ParsedXmlText::parse(&self.message_content)?).0),
..Default::default()
})),