Mercurial > pidgin
diff libpurple/protocols/bonjour/jabber.c @ 25880:be87547aa431
merge of '0bf6462dd433df38943094bbed0393698d91a037'
and '9c4b346f6536ab35c06e2c6cabb905bae60c420d'
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sat, 13 Dec 2008 21:13:04 +0000 |
parents | 9f000fb8664e 65cfc59858cf |
children | 716b14deee97 |
line wrap: on
line diff
--- a/libpurple/protocols/bonjour/jabber.c Fri Dec 12 20:35:18 2008 +0000 +++ b/libpurple/protocols/bonjour/jabber.c Sat Dec 13 21:13:04 2008 +0000 @@ -380,19 +380,27 @@ } static void bonjour_jabber_stream_ended(BonjourJabberConversation *bconv) { - const gchar *name = NULL; + + /* Inform the user that the conversation has been closed */ BonjourBuddy *bb = NULL; + purple_debug_info("bonjour", "Recieved conversation close notification from %s.\n", bconv->pb ? bconv->pb->name : "(unknown)"); + + if(bconv->pb != NULL) + bb = purple_buddy_get_protocol_data(bconv->pb); +#if 0 if(bconv->pb != NULL) { - name = purple_buddy_get_name(bconv->pb); - bb = purple_buddy_get_protocol_data(bconv->pb); + PurpleConversation *conv; + conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, bconv->pb->name, bconv->pb->account); + if (conv != NULL) { + char *tmp = g_strdup_printf(_("%s has closed the conversation."), bconv->pb->name); + purple_conversation_write(conv, NULL, tmp, PURPLE_MESSAGE_SYSTEM, time(NULL)); + g_free(tmp); + } } - - purple_debug_info("bonjour", "Recieved conversation close notification from %s.\n", name ? name : "(unknown)"); - +#endif /* Close the socket, clear the watcher and free memory */ bonjour_jabber_close_conversation(bconv); - if(bb) bb->conversation = NULL; } @@ -1165,10 +1173,10 @@ check_if_blocked(PurpleBuddy *pb) { gboolean blocked = FALSE; - GSList *l; - PurpleAccount *acc; + GSList *l = NULL; + PurpleAccount *acc = purple_buddy_get_account(pb); - if(pb == NULL) + if(acc == NULL) return FALSE; acc = purple_buddy_get_account(pb);