# HG changeset patch # User Daniel Atallah # Date 1188755716 0 # Node ID 917b6f45c458415005ac620fba80aab6eae9597b # Parent affacee881e82f79eb37903047cd4b1a2f5213b3 Prevent duplicate window closed notifications. diff -r affacee881e8 -r 917b6f45c458 libpurple/protocols/bonjour/jabber.c --- a/libpurple/protocols/bonjour/jabber.c Sun Sep 02 17:54:44 2007 +0000 +++ b/libpurple/protocols/bonjour/jabber.c Sun Sep 02 17:55:16 2007 +0000 @@ -373,17 +373,19 @@ g_return_if_fail(bb != NULL); - /* Close the socket, clear the watcher and free memory */ - bonjour_jabber_close_conversation(bb->conversation); - bb->conversation = NULL; + /* Inform the user that the conversation has been closed */ + if (bb->conversation != NULL) { + conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, pb->name, pb->account); + if (conv != NULL) { + char *tmp = g_strdup_printf(_("%s has closed the conversation."), pb->name); + purple_conversation_write(conv, NULL, tmp, PURPLE_MESSAGE_SYSTEM, time(NULL)); + g_free(tmp); + } + /* Close the socket, clear the watcher and free memory */ + bonjour_jabber_close_conversation(bb->conversation); + bb->conversation = NULL; + } - /* Inform the user that the conversation has been closed */ - conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, pb->name, pb->account); - if (conv != NULL) { - char *tmp = g_strdup_printf(_("%s has closed the conversation."), pb->name); - purple_conversation_write(conv, NULL, tmp, PURPLE_MESSAGE_SYSTEM, time(NULL)); - g_free(tmp); - } } void bonjour_jabber_stream_started(PurpleBuddy *pb) {