comparison finch/gntconv.c @ 21207:a59f65876d45

propagate from branch 'im.pidgin.pidgin' (head abd68a0284028e1f6620c0f7ef517a13458d49d1) to branch 'next.minor' (head 57a14e044355de6354ee22a32331f970598c6b02)
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 19 Sep 2007 11:00:49 +0000
parents b7460582a135
children bed3c9affda6
comparison
equal deleted inserted replaced
20180:034a03ae657b 21207:a59f65876d45
324 /* We just signed on. Let's see if there's any chat that we have open, 324 /* We just signed on. Let's see if there's any chat that we have open,
325 * and hadn't left before the disconnect. */ 325 * and hadn't left before the disconnect. */
326 list = purple_get_chats(); 326 list = purple_get_chats();
327 while (list) { 327 while (list) {
328 PurpleConversation *conv = list->data; 328 PurpleConversation *conv = list->data;
329 gboolean del = FALSE;
330 PurpleChat *chat; 329 PurpleChat *chat;
330 GHashTable *comps = NULL;
331 331
332 list = list->next; 332 list = list->next;
333 if (conv->account != gc->account || 333 if (conv->account != gc->account ||
334 !purple_conversation_get_data(conv, "want-to-rejoin")) 334 !purple_conversation_get_data(conv, "want-to-rejoin"))
335 continue; 335 continue;
336 336
337 chat = purple_blist_find_chat(conv->account, conv->name); 337 chat = purple_blist_find_chat(conv->account, conv->name);
338 if (chat == NULL) { 338 if (chat == NULL) {
339 GHashTable *hash = NULL;
340 if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults != NULL) 339 if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults != NULL)
341 hash = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults(gc, conv->name); 340 comps = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults(gc, conv->name);
342 chat = purple_chat_new(gc->account, conv->name, hash); 341 } else {
343 del = TRUE; 342 comps = chat->components;
344 } 343 }
345 serv_join_chat(gc, chat->components); 344 serv_join_chat(gc, comps);
346 if (del) 345 if (chat == NULL && comps != NULL)
347 purple_blist_remove_chat(chat); 346 g_hash_table_destroy(comps);
348 } 347 }
349 } 348 }
350 } 349 }
351 350
352 static gpointer 351 static gpointer