comparison src/protocols/jabber/presence.c @ 8182:3e1762ad0f98

[gaim-migrate @ 8901] This plugs a tiny memory leak, and I think it will fix marv's ISP-suckage auto-join bug. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Thu, 29 Jan 2004 04:47:01 +0000
parents e283be34aadf
children 3a229ad2fab0
comparison
equal deleted inserted replaced
8181:0609485e5bb5 8182:3e1762ad0f98
297 g_free(buf); 297 g_free(buf);
298 298
299 jabber_chat_destroy(chat); 299 jabber_chat_destroy(chat);
300 jabber_id_free(jid); 300 jabber_id_free(jid);
301 g_free(status); 301 g_free(status);
302 g_free(room_jid);
302 return; 303 return;
303 } 304 }
304 305
305
306 if(!chat->conv) {
307 chat->id = i++;
308 chat->muc = muc;
309 chat->conv = serv_got_joined_chat(js->gc, chat->id, room_jid);
310 gaim_conv_chat_set_nick(GAIM_CONV_CHAT(chat->conv), jid->resource);
311 }
312 306
313 if(type && !strcmp(type, "unavailable")) { 307 if(type && !strcmp(type, "unavailable")) {
314 gboolean nick_change = FALSE; 308 gboolean nick_change = FALSE;
309
310 /* If we haven't joined the chat yet, we don't care that someone left */
311 if(!chat->conv) {
312 jabber_id_free(jid);
313 g_free(status);
314 g_free(room_jid);
315 return;
316 }
315 317
316 jabber_buddy_remove_resource(jb, jid->resource); 318 jabber_buddy_remove_resource(jb, jid->resource);
317 if(chat->muc) { 319 if(chat->muc) {
318 xmlnode *x; 320 xmlnode *x;
319 for(x = xmlnode_get_child(packet, "x"); x; x = xmlnode_get_next_twin(x)) { 321 for(x = xmlnode_get_child(packet, "x"); x; x = xmlnode_get_next_twin(x)) {
343 gaim_conv_chat_remove_user(GAIM_CONV_CHAT(chat->conv), jid->resource, 345 gaim_conv_chat_remove_user(GAIM_CONV_CHAT(chat->conv), jid->resource,
344 status); 346 status);
345 } 347 }
346 } 348 }
347 } else { 349 } else {
350 if(!chat->conv) {
351 chat->id = i++;
352 chat->muc = muc;
353 chat->conv = serv_got_joined_chat(js->gc, chat->id, room_jid);
354 gaim_conv_chat_set_nick(GAIM_CONV_CHAT(chat->conv), jid->resource);
355 }
356
348 jabber_buddy_track_resource(jb, jid->resource, priority, state, 357 jabber_buddy_track_resource(jb, jid->resource, priority, state,
349 status); 358 status);
350 359
351 if(!jabber_chat_find_buddy(chat->conv, jid->resource)) 360 if(!jabber_chat_find_buddy(chat->conv, jid->resource))
352 gaim_conv_chat_add_user(GAIM_CONV_CHAT(chat->conv), jid->resource, 361 gaim_conv_chat_add_user(GAIM_CONV_CHAT(chat->conv), jid->resource,