Skip to content

A tiny friend in your Mac's notch and on your iPhone that keeps an eye on your AI coding agents: Claude Code, Codex, Cursor, Gemini CLI, Antigravity and more. Approve from the notch or your Lock Screen.

fix(windows): WhatsApp Status updates and channels no longer show as chats (#901)

afpruivoa7fe6ce318d6
diff --git a/windows/src-tauri/src/whatsapp/model.rs b/windows/src-tauri/src/whatsapp/model.rs
index 19921676..1c570d43 100644
--- a/windows/src-tauri/src/whatsapp/model.rs
+++ b/windows/src-tauri/src/whatsapp/model.rs
@@ -95,6 +95,12 @@ pub fn is_group(jid: &str) -> bool {
jid.ends_with("@g.us")
}
+/// Status updates (status@broadcast), broadcast lists and channels (…@newsletter) come in as
+/// messages too, but they are not conversations: a contact's Status would become a chat named after them.
+pub fn is_conversation(jid: &str) -> bool {
+ !jid.ends_with("@broadcast") && !jid.ends_with("@newsletter")
+}
+
fn user_part(jid: &str) -> &str {
let user = jid.split('@').next().unwrap_or(jid);
user.split(':').next().unwrap_or(user)
@@ -179,7 +185,7 @@ impl Inbox {
return Outcome::Duplicate;
}
let chat = normalized(&message.chat);
- if filters.ignored.contains(&chat) {
+ if !is_conversation(&chat) || filters.ignored.contains(&chat) {
return Outcome::Ignored;
}
self.seen.insert(message.id.clone());
@@ -432,6 +438,19 @@ mod tests {
m
}
+ #[test]
+ fn status_updates_and_channels_are_not_conversations() {
+ let mut inbox = Inbox::default();
+ let f = Filters::default();
+ let mut status = Message::new("1", "status@broadcast", "[email protected]", "https://vm.tiktok.com/x", 0);
+ status.sender_name = "David".into();
+ assert_eq!(inbox.add(status, &f, None, false), Outcome::Ignored);
+ assert_eq!(inbox.add(msg("2", "120363000000000001@newsletter", 0), &f, None, false), Outcome::Ignored);
+ assert!(inbox.conversations.is_empty());
+ assert_eq!(inbox.total_unread(), 0);
+ assert!(is_conversation("[email protected]") && is_conversation("[email protected]") && is_conversation("251556368777322@lid"));
+ }
+
#[test]
fn one_conversation_per_chat() {
let mut inbox = Inbox::default();