# HG changeset patch # User Mark Doliner # Date 1185692473 0 # Node ID c65c4caa817abfa7b488921e4b10dc9926695df7 # Parent 259f8635eeffa6ac8fa411513a7c0298db916d32 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 259f8635eeff -r c65c4caa817a libpurple/protocols/jabber/presence.c --- a/libpurple/protocols/jabber/presence.c Sun Jul 29 06:10:24 2007 +0000 +++ b/libpurple/protocols/jabber/presence.c Sun Jul 29 07:01:13 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); diff -r 259f8635eeff -r c65c4caa817a libpurple/protocols/oscar/family_chat.c --- a/libpurple/protocols/oscar/family_chat.c Sun Jul 29 06:10:24 2007 +0000 +++ b/libpurple/protocols/oscar/family_chat.c Sun Jul 29 07:01:13 2007 +0000 @@ -140,6 +140,23 @@ return 0; } +/** + * Subtype 0x0001 + */ +static int +error(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs) +{ + guint16 reason; + + reason = byte_stream_get16(bs); + + /* TODO: Reason 0x000e means invalid SNAC format? Busted SNAC payload? */ + + /* TODO: Read in a TLV list. TLV of type 0x0009 is the error code. Error code 0x0033 means "invalid name." */ + + return 0; +} + /* * Subtype 0x0002 - General room information. Lots of stuff. * diff -r 259f8635eeff -r c65c4caa817a libpurple/protocols/qq/qq.c --- a/libpurple/protocols/qq/qq.c Sun Jul 29 06:10:24 2007 +0000 +++ b/libpurple/protocols/qq/qq.c Sun Jul 29 07:01:13 2007 +0000 @@ -747,10 +747,7 @@ { PurpleAccountOption *option; - option = purple_account_option_bool_new(_("Login in TCP"), "use_tcp", FALSE); - prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); - - option = purple_account_option_bool_new(_("Login Hidden"), "hidden", FALSE); + option = purple_account_option_bool_new(_("Connect using TCP"), "use_tcp", FALSE); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); option = purple_account_option_string_new(_("Server"), "server", NULL);