Skip to content

Group chats do not trigger tray icon blinking in Pidgin #244

@kszwaba

Description

@kszwaba

Description of the problem

When receiving messages in WhatsApp group chats via purple-gowhatsapp, Pidgin does not trigger blinking of the tray icon, although it works correctly for 1:1 conversations (IM windows). This makes notifications for new messages in group chats difficult.

Environment

  • Pidgin 2.14.8 on Linux Mint 21.3 (GTK-based desktop environment with systray support)
  • purple-gowhatsapp version 1.20
  • Pidgin's "Message Notification" plugin is enabled with "URGENT hint" set

Expected behavior
When a new message is received in a WhatsApp group chat, Pidgin should mark it as unseen, triggering the tray icon to blink — similar to how it works for private IM messages.

Actual behavior
No tray blinking is triggered for group messages. This occurs even when the "Message Notification" plugin is correctly configured to notify on chat windows. Tray icon blinking only works for private conversations.

Root cause analysis
Pidgin triggers tray blinking (via purple_blist_node_set_unseen and similar) only when a conversation is marked as unseen.

  • For ConversationIM (1:1), this is set automatically.
  • For ConversationChat (group chats), this is not set automatically unless:
    • Someone mentions your nickname in the message, or
    • The plugin or protocol manually sets the unseen flag.

As a result, unless the plugin explicitly calls:

purple.ConversationSetUnseen(conv, purple.UnseenNew)

...no tray blinking will occur — even if the conversation is created as a ConversationChat.

Suggested fix
In conversations.go, when receiving a group chat message (e.g., from a JID ending with @g.us), explicitly call:

purple.ConversationSetUnseen(conv, purple.UnseenNew)

This will ensure that group messages are marked as unseen and tray blinking will occur, regardless of whether the conversation is of type IM or CHAT.

Bonus suggestion (optional)
It is also worth considering using ConversationChat instead of ConversationIM for group chats to improve UX and compatibility with other plugins (such as better support for chat nicknames, participant lists, etc.).

Example logic:

if strings.HasSuffix(jid, "@g.us") {
    conv = purple.NewConversation(account, purple.ConversationChat, jid)
    purple.ConversationSetUnseen(conv, purple.UnseenNew)
} else {
    conv = purple.NewConversation(account, purple.ConversationIM, jid)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    barrenCannot reproduce

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions