# HG changeset patch # User Mark Doliner # Date 1185744756 0 # Node ID f29794be01632f73d76f4f50d81deebe8d7a5cf9 # Parent 2cfb6ef9ab73188b61983aa8130385cc3a0086f3 applied changes from bbcc1925d9e449bb9599d378da2764bf47da2a7a through c2cc31f23a71f23062555721f8101fc9c997bae2 I commited this yesterday, but it includes some other changes that I didn't mean to commit, so I reverted it and now I'm just committing this file. Here's the original commit message: When we get a presence of type="error" from the server that corresponds to a Jabber chat, only destroy/free/close/leave the chat room if the error happened while joining (and we were therefore never in the room). This fixes the following bug: 1. Join a room 2. Try to change your nickname to something that's being used by someone else 3. The server gives you an error message, but you're not actually kicked out of the room 4. Pidgin thinks you've been kicked out and won't let you send messages to the room, etc. diff -r 2cfb6ef9ab73 -r f29794be0163 libpurple/protocols/jabber/presence.c --- a/libpurple/protocols/jabber/presence.c Sun Jul 29 21:29:10 2007 +0000 +++ b/libpurple/protocols/jabber/presence.c Sun Jul 29 21:32:36 2007 +0000 @@ -413,7 +413,8 @@ if(chat->conv) { title = g_strdup_printf(_("Error in chat %s"), from); - serv_got_chat_left(js->gc, chat->id); + if (g_hash_table_size(chat->members) == 0) + serv_got_chat_left(js->gc, chat->id); } else { title = g_strdup_printf(_("Error joining chat %s"), from); } @@ -421,7 +422,9 @@ g_free(title); g_free(msg); - jabber_chat_destroy(chat); + if (g_hash_table_size(chat->members) == 0) + /* Only destroy the chat if the error happened while joining */ + jabber_chat_destroy(chat); jabber_id_free(jid); g_free(status); g_free(room_jid);