libpurple/protocols/bonjour/jabber.c

branch
next.minor
changeset 25150
b0e1b122d83a
parent 25141
c5e17306668f
parent 25119
d78a152554c4
child 25870
ccb76c75d39f
equal deleted inserted replaced
25149:c93933e47474 25150:b0e1b122d83a
378 else 378 else
379 purple_debug_warning("bonjour", "Unknown packet: %s\n", packet->name ? packet->name : "(null)"); 379 purple_debug_warning("bonjour", "Unknown packet: %s\n", packet->name ? packet->name : "(null)");
380 } 380 }
381 381
382 static void bonjour_jabber_stream_ended(BonjourJabberConversation *bconv) { 382 static void bonjour_jabber_stream_ended(BonjourJabberConversation *bconv) {
383 const gchar *name = NULL; 383
384 /* Inform the user that the conversation has been closed */
384 BonjourBuddy *bb = NULL; 385 BonjourBuddy *bb = NULL;
385 386
387 purple_debug_info("bonjour", "Recieved conversation close notification from %s.\n", bconv->pb ? bconv->pb->name : "(unknown)");
388
389 if(bconv->pb != NULL)
390 bb = purple_buddy_get_protocol_data(bconv->pb);
391 #if 0
386 if(bconv->pb != NULL) { 392 if(bconv->pb != NULL) {
387 name = purple_buddy_get_name(bconv->pb); 393 PurpleConversation *conv;
388 bb = purple_buddy_get_protocol_data(bconv->pb); 394 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, bconv->pb->name, bconv->pb->account);
389 } 395 if (conv != NULL) {
390 396 char *tmp = g_strdup_printf(_("%s has closed the conversation."), bconv->pb->name);
391 purple_debug_info("bonjour", "Recieved conversation close notification from %s.\n", name ? name : "(unknown)"); 397 purple_conversation_write(conv, NULL, tmp, PURPLE_MESSAGE_SYSTEM, time(NULL));
392 398 g_free(tmp);
399 }
400 }
401 #endif
393 /* Close the socket, clear the watcher and free memory */ 402 /* Close the socket, clear the watcher and free memory */
394 bonjour_jabber_close_conversation(bconv); 403 bonjour_jabber_close_conversation(bconv);
395
396 if(bb) 404 if(bb)
397 bb->conversation = NULL; 405 bb->conversation = NULL;
398 } 406 }
399 407
400 static void 408 static void
1163 1171
1164 static gboolean 1172 static gboolean
1165 check_if_blocked(PurpleBuddy *pb) 1173 check_if_blocked(PurpleBuddy *pb)
1166 { 1174 {
1167 gboolean blocked = FALSE; 1175 gboolean blocked = FALSE;
1168 GSList *l; 1176 GSList *l = NULL;
1169 PurpleAccount *acc; 1177 PurpleAccount *acc = purple_buddy_get_account(pb);
1170 1178
1171 if(pb == NULL) 1179 if(acc == NULL)
1172 return FALSE; 1180 return FALSE;
1173 1181
1174 acc = purple_buddy_get_account(pb); 1182 acc = purple_buddy_get_account(pb);
1175 1183
1176 for(l = acc->deny; l != NULL; l = l->next) { 1184 for(l = acc->deny; l != NULL; l = l->next) {

mercurial