hoehermann / purple-gowhatsapp

Pidgin/libpurple plug-in for WhatsApp Web.
GNU General Public License v3.0
290 stars 34 forks source link

no sound on message recieved (group only) #151

Closed RustedAperture closed 1 year ago

RustedAperture commented 1 year ago

When receiving a message in a group chat there is no notification sound, however, when receiving a message from an individual person there is.

Perhaps I'm missing something in the settings.

hoehermann commented 1 year ago

Thank you for the message. You are not missing anything. For identifying chats, Purple uses numeric IDs. WhatsApp uses a string (at least historically). It makes chat lookup a bit tedious. Also I did not find out how to use purple_conv_chat_get_nick(chat), yet. Hence I use a non-standard way of writing messages to chats which does not include firing the event which ultimately plays the sound.

Note to self: Organize chats based on numeric IDs and use serv_got_chat_in. Find out how to incorporate purple_conv_chat_get_nick(chat).
Or just manually do a purple_signal_emit(purple_conversations_get_handle(), "received-chat-msg", g->account, who, message, conv, flags);.

EionRobb commented 1 year ago

If it helps, in other prpls I've just done a g_str_hash() (from the GHashTable set of functions) to convert chat names into chat id's. Works pretty well.

hoehermann commented 1 year ago

This should be working now.