···159159 }
160160161161 let title = match notification.row.kind.as_str() {
162162- "reply" => "New reply",
163163- _ => "New mention",
162162+ "reply" => String::from("New reply"),
163163+ _ => match notification.row.mention_role_name.as_deref() {
164164+ Some(role) => format!("Mentioned via @{role}"),
165165+ None => String::from("New mention"),
166166+ },
164167 };
165168 let payload = PushPayload {
166166- title: String::from(title),
169169+ title,
167170 body: redact_spoilers(¬ification.message.text, ¬ification.message.facets),
168171 tag: notification.row.message_uri.clone(),
169172 data: PushData {
+4
src/models/notifications.rs
···2121 pub indexed_at: String,
2222 #[sea_orm(column_type = "Text", nullable)]
2323 pub seen_at: Option<String>,
2424+ /// Display name of the role whose mention triggered this notification, if it
2525+ /// was a role mention rather than a direct mention. Captured at index time.
2626+ #[sea_orm(column_type = "Text", nullable)]
2727+ pub mention_role_name: Option<String>,
2428}
25292630impl ActiveModelBehavior for ActiveModel {}