Mercurial > pidgin
comparison src/protocols/jabber/chat.c @ 7262:85fcaff1505d
[gaim-migrate @ 7839]
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)
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Tue, 14 Oct 2003 16:44:36 +0000 |
parents | bf630f7dfdcd |
children | 89e211509d02 |
comparison
equal
deleted
inserted
replaced
7261:1930e3d00ecd | 7262:85fcaff1505d |
---|---|
66 JabberChat *chat; | 66 JabberChat *chat; |
67 char *room_jid; | 67 char *room_jid; |
68 | 68 |
69 room_jid = g_strdup_printf("%s@%s", room, server); | 69 room_jid = g_strdup_printf("%s@%s", room, server); |
70 | 70 |
71 chat = g_hash_table_lookup(js->chats, room_jid); | 71 chat = g_hash_table_lookup(js->chats, jabber_normalize(room_jid)); |
72 g_free(room_jid); | 72 g_free(room_jid); |
73 | 73 |
74 return chat; | 74 return chat; |
75 } | 75 } |
76 | 76 |
158 void jabber_chat_join(GaimConnection *gc, GHashTable *data) | 158 void jabber_chat_join(GaimConnection *gc, GHashTable *data) |
159 { | 159 { |
160 JabberChat *chat; | 160 JabberChat *chat; |
161 char *room, *server, *handle, *passwd; | 161 char *room, *server, *handle, *passwd; |
162 xmlnode *presence, *x; | 162 xmlnode *presence, *x; |
163 char *room_jid, *full_jid; | 163 char *tmp, *room_jid, *full_jid; |
164 JabberStream *js = gc->proto_data; | 164 JabberStream *js = gc->proto_data; |
165 | 165 |
166 room = g_hash_table_lookup(data, "room"); | 166 room = g_hash_table_lookup(data, "room"); |
167 server = g_hash_table_lookup(data, "server"); | 167 server = g_hash_table_lookup(data, "server"); |
168 handle = g_hash_table_lookup(data, "handle"); | 168 handle = g_hash_table_lookup(data, "handle"); |
172 return; | 172 return; |
173 | 173 |
174 if(jabber_chat_find(js, room, server)) | 174 if(jabber_chat_find(js, room, server)) |
175 return; | 175 return; |
176 | 176 |
177 room_jid = g_strdup_printf("%s@%s", room, server); | 177 tmp = g_strdup_printf("%s@%s", room, server); |
178 room_jid = g_strdup(jabber_normalize(tmp)); | |
179 g_free(tmp); | |
178 | 180 |
179 chat = g_new0(JabberChat, 1); | 181 chat = g_new0(JabberChat, 1); |
180 chat->js = gc->proto_data; | 182 chat->js = gc->proto_data; |
181 | 183 |
182 chat->room = g_strdup(room); | 184 chat->room = g_strdup(room); |
225 void jabber_chat_destroy(JabberChat *chat) | 227 void jabber_chat_destroy(JabberChat *chat) |
226 { | 228 { |
227 JabberStream *js = chat->js; | 229 JabberStream *js = chat->js; |
228 char *room_jid = g_strdup_printf("%s@%s", chat->room, chat->server); | 230 char *room_jid = g_strdup_printf("%s@%s", chat->room, chat->server); |
229 | 231 |
230 g_hash_table_remove(js->chats, room_jid); | 232 g_hash_table_remove(js->chats, jabber_normalize(room_jid)); |
231 g_free(room_jid); | 233 g_free(room_jid); |
232 | 234 |
233 g_free(chat->room); | 235 g_free(chat->room); |
234 g_free(chat->server); | 236 g_free(chat->server); |
235 g_free(chat->nick); | 237 g_free(chat->nick); |