comparison libpurple/protocols/bonjour/jabber.c @ 19574:917b6f45c458

Prevent duplicate window closed notifications.
author Daniel Atallah <daniel.atallah@gmail.com>
date Sun, 02 Sep 2007 17:55:16 +0000
parents 649ac48fce1d
children 941965d6fd88
comparison
equal deleted inserted replaced
19573:affacee881e8 19574:917b6f45c458
371 371
372 purple_debug_info("bonjour", "Recieved conversation close notification from %s.\n", pb->name); 372 purple_debug_info("bonjour", "Recieved conversation close notification from %s.\n", pb->name);
373 373
374 g_return_if_fail(bb != NULL); 374 g_return_if_fail(bb != NULL);
375 375
376 /* Close the socket, clear the watcher and free memory */
377 bonjour_jabber_close_conversation(bb->conversation);
378 bb->conversation = NULL;
379
380 /* Inform the user that the conversation has been closed */ 376 /* Inform the user that the conversation has been closed */
381 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, pb->name, pb->account); 377 if (bb->conversation != NULL) {
382 if (conv != NULL) { 378 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, pb->name, pb->account);
383 char *tmp = g_strdup_printf(_("%s has closed the conversation."), pb->name); 379 if (conv != NULL) {
384 purple_conversation_write(conv, NULL, tmp, PURPLE_MESSAGE_SYSTEM, time(NULL)); 380 char *tmp = g_strdup_printf(_("%s has closed the conversation."), pb->name);
385 g_free(tmp); 381 purple_conversation_write(conv, NULL, tmp, PURPLE_MESSAGE_SYSTEM, time(NULL));
386 } 382 g_free(tmp);
383 }
384 /* Close the socket, clear the watcher and free memory */
385 bonjour_jabber_close_conversation(bb->conversation);
386 bb->conversation = NULL;
387 }
388
387 } 389 }
388 390
389 void bonjour_jabber_stream_started(PurpleBuddy *pb) { 391 void bonjour_jabber_stream_started(PurpleBuddy *pb) {
390 BonjourBuddy *bb = pb->proto_data; 392 BonjourBuddy *bb = pb->proto_data;
391 BonjourJabberConversation *bconv = bb->conversation; 393 BonjourJabberConversation *bconv = bb->conversation;