In my continuing quest to make sounds events more usable in Jabber
chats, I've been looking at the "person enters chat" sound event.
The UI contains two functions for adding users to a chat:
gaim_gtkconv_chat_add_user(GaimConversation *conv, const char *user)
gaim_gtkconv_chat_add_users(GaimConversation *conv, GList *users)
Currently it is assumed that a protocol will use chat_add_users to add
the existing users in a room, and then call chat_add_user as additional
people enter. Following this assumption, the "person enters chat" sound
event is only triggered in chat_add_user.
For some protocols it is difficult to add all the initial users at once
with chat_add_users, so they call chat_add_user multiple times. Jabber
is protocol I'm focusing on, but it appears this may also be the case
for others (they never call chat_add_users). This results in the
playing of "person enters chat" sound event for every person already in
The simplest solution here would be to add a boolean flag to
chat_add_user to specify whether the user being added is an existing
user in the room. That way the protocol can provide this info if it has
it, and the UI can choose whether to play the sound event.
Would this be acceptable?
On Sat, 2004-08-07 at 14:08, Nathan Fredrickson wrote:
> The simplest solution here would be to add a boolean flag to
> chat_add_user to specify whether the user being added is an existing
> user in the room. That way the protocol can provide this info if it has
> it, and the UI can choose whether to play the sound event.
Here's a patch. It works, but I'm not particularly happy about it. It
would probably be better to include this in the flags param that
nosnilmot recently added, but it didn't seem to fit well there either.