From: Nathan W. <fac...@us...> - 2003-10-14 16:44:41
|
Update of /cvsroot/gaim/gaim/src/protocols/jabber In directory sc8-pr-cvs1:/tmp/cvs-serv10382/src/protocols/jabber Modified Files: chat.c jutil.c jutil.h Log Message: put normalizing back in the realm of sanity (what was I thinking?) and fix jabber chat case sensitivity (as well as a few other things) Index: chat.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/jabber/chat.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- chat.c 2 Oct 2003 02:54:02 -0000 1.3 +++ chat.c 14 Oct 2003 16:44:35 -0000 1.4 @@ -68,7 +68,7 @@ JabberChat *jabber_chat_find(JabberStrea room_jid = g_strdup_printf("%s@%s", room, server); - chat = g_hash_table_lookup(js->chats, room_jid); + chat = g_hash_table_lookup(js->chats, jabber_normalize(room_jid)); g_free(room_jid); return chat; @@ -160,7 +160,7 @@ void jabber_chat_join(GaimConnection *gc JabberChat *chat; char *room, *server, *handle, *passwd; xmlnode *presence, *x; - char *room_jid, *full_jid; + char *tmp, *room_jid, *full_jid; JabberStream *js = gc->proto_data; room = g_hash_table_lookup(data, "room"); @@ -174,7 +174,9 @@ void jabber_chat_join(GaimConnection *gc if(jabber_chat_find(js, room, server)) return; - room_jid = g_strdup_printf("%s@%s", room, server); + tmp = g_strdup_printf("%s@%s", room, server); + room_jid = g_strdup(jabber_normalize(tmp)); + g_free(tmp); chat = g_new0(JabberChat, 1); chat->js = gc->proto_data; @@ -227,7 +229,7 @@ void jabber_chat_destroy(JabberChat *cha JabberStream *js = chat->js; char *room_jid = g_strdup_printf("%s@%s", chat->room, chat->server); - g_hash_table_remove(js->chats, room_jid); + g_hash_table_remove(js->chats, jabber_normalize(room_jid)); g_free(room_jid); g_free(chat->room); Index: jutil.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/jabber/jutil.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -p -r1.5 -r1.6 --- jutil.c 14 Oct 2003 05:07:38 -0000 1.5 +++ jutil.c 14 Oct 2003 16:44:35 -0000 1.6 @@ -179,12 +179,12 @@ char *jabber_get_bare_jid(const char *ji slash = strrchr(jid, '/'); if(slash) - return g_strndup(jid, slash - jid); + return g_utf8_strdown(jid, slash - jid); else - return g_strdup(jid); + return g_utf8_strdown(jid, -1); } -const char *jabber_normalize(const GaimAccount *account, const char *in) +const char *jabber_normalize(const char *in) { static char buf[2048]; /* maximum legal length of a jabber jid */ char *tmp; Index: jutil.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/jabber/jutil.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- jutil.h 14 Oct 2003 05:07:38 -0000 1.2 +++ jutil.h 14 Oct 2003 16:44:35 -0000 1.3 @@ -40,6 +40,6 @@ char *jabber_get_bare_jid(const char *ji time_t str_to_time(const char *timestamp); const char *jabber_get_state_string(int state); -const char *jabber_normalize(const GaimAccount *account, const char *in); +const char *jabber_normalize(const char *in); #endif /* _GAIM_JABBER_JID_H_ */ |