Mercurial > pidgin
changeset 18737:3f965b7c7ffa
merge of '966f1125e1910ec58ae63a175dc5efe1fd3e10e0'
and 'c2cc31f23a71f23062555721f8101fc9c997bae2'
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 29 Jul 2007 21:12:17 +0000 |
parents | a9142edf5b65 (current diff) c65c4caa817a (diff) |
children | 2cfb6ef9ab73 |
files | |
diffstat | 4 files changed, 48 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c Sun Jul 29 17:39:00 2007 +0000 +++ b/libpurple/protocols/jabber/jabber.c Sun Jul 29 21:12:17 2007 +0000 @@ -1618,6 +1618,10 @@ const char *cmd, char **args, char **error, void *data) { JabberChat *chat = jabber_chat_find_by_conv(conv); + + if (!chat) + return PURPLE_CMD_RET_FAILED; + jabber_chat_request_room_configure(chat); return PURPLE_CMD_RET_OK; } @@ -1626,6 +1630,10 @@ const char *cmd, char **args, char **error, void *data) { JabberChat *chat = jabber_chat_find_by_conv(conv); + + if (!chat) + return PURPLE_CMD_RET_FAILED; + jabber_chat_register(chat); return PURPLE_CMD_RET_OK; } @@ -1634,6 +1642,10 @@ const char *cmd, char **args, char **error, void *data) { JabberChat *chat = jabber_chat_find_by_conv(conv); + + if (!chat) + return PURPLE_CMD_RET_FAILED; + jabber_chat_change_topic(chat, args ? args[0] : NULL); return PURPLE_CMD_RET_OK; } @@ -1643,7 +1655,7 @@ { JabberChat *chat = jabber_chat_find_by_conv(conv); - if(!args || !args[0]) + if(!chat || !args || !args[0]) return PURPLE_CMD_RET_FAILED; jabber_chat_change_nick(chat, args[0]); @@ -1654,6 +1666,10 @@ const char *cmd, char **args, char **error, void *data) { JabberChat *chat = jabber_chat_find_by_conv(conv); + + if (!chat) + return PURPLE_CMD_RET_FAILED; + jabber_chat_part(chat, args ? args[0] : NULL); return PURPLE_CMD_RET_OK; } @@ -1663,7 +1679,7 @@ { JabberChat *chat = jabber_chat_find_by_conv(conv); - if(!args || !args[0]) + if(!chat || !args || !args[0]) return PURPLE_CMD_RET_FAILED; if(!jabber_chat_ban_user(chat, args[0], args[1])) { @@ -1679,7 +1695,7 @@ { JabberChat *chat = jabber_chat_find_by_conv(conv); - if (!args || !args[0] || !args[1]) + if (!chat || !args || !args[0] || !args[1]) return PURPLE_CMD_RET_FAILED; if (strcmp(args[1], "owner") != 0 && @@ -1704,7 +1720,7 @@ { JabberChat *chat; - if (!args || !args[0] || !args[1]) + if (!chat || !args || !args[0] || !args[1]) return PURPLE_CMD_RET_FAILED; if (strcmp(args[1], "moderator") != 0 && @@ -1745,7 +1761,7 @@ JabberChat *chat = jabber_chat_find_by_conv(conv); GHashTable *components; - if(!args || !args[0]) + if(!chat || !args || !args[0]) return PURPLE_CMD_RET_FAILED; components = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); @@ -1767,7 +1783,7 @@ { JabberChat *chat = jabber_chat_find_by_conv(conv); - if(!args || !args[0]) + if(!chat || !args || !args[0]) return PURPLE_CMD_RET_FAILED; if(!jabber_chat_kick_user(chat, args[0], args[1])) { @@ -1784,6 +1800,9 @@ JabberChat *chat = jabber_chat_find_by_conv(conv); char *who; + if (!chat) + return PURPLE_CMD_RET_FAILED; + who = g_strdup_printf("%s@%s/%s", chat->room, chat->server, args[0]); jabber_message_send_im(purple_conversation_get_gc(conv), who, args[1], 0);
--- a/libpurple/protocols/jabber/presence.c Sun Jul 29 17:39:00 2007 +0000 +++ b/libpurple/protocols/jabber/presence.c Sun Jul 29 21:12:17 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);
--- a/libpurple/protocols/oscar/family_chat.c Sun Jul 29 17:39:00 2007 +0000 +++ b/libpurple/protocols/oscar/family_chat.c Sun Jul 29 21:12:17 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. *
--- a/libpurple/protocols/qq/qq.c Sun Jul 29 17:39:00 2007 +0000 +++ b/libpurple/protocols/qq/qq.c Sun Jul 29 21:12:17 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);