comparison libpurple/protocols/bonjour/jabber.c @ 23018:ef0bcbe33689

applied changes from 3d595739f53a259d5dae408a05f64d2836f02ac9 through 05cdb341d2bf5165ab95cc42e52750624f0a7ad9
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 19 Jun 2008 02:56:37 +0000
parents 1c87e81c44fa
children a9db0aec7e59
comparison
equal deleted inserted replaced
23017:adbcf5b84438 23018:ef0bcbe33689
383 const char *err = g_strerror(errno); 383 const char *err = g_strerror(errno);
384 384
385 purple_debug_warning("bonjour", "receive error: %s\n", err ? err : "(null)"); 385 purple_debug_warning("bonjour", "receive error: %s\n", err ? err : "(null)");
386 386
387 bonjour_jabber_close_conversation(bconv); 387 bonjour_jabber_close_conversation(bconv);
388 if (bconv->pb != NULL) { 388 if (bconv->pb != NULL && bconv->pb->proto_data != NULL) {
389 BonjourBuddy *bb = bconv->pb->proto_data; 389 BonjourBuddy *bb = bconv->pb->proto_data;
390 bb->conversation = NULL; 390 bb->conversation = NULL;
391 } 391 }
392 392
393 /* I guess we really don't need to notify the user. 393 /* I guess we really don't need to notify the user.
955 PurpleBuddy *pb; 955 PurpleBuddy *pb;
956 BonjourBuddy *bb; 956 BonjourBuddy *bb;
957 int ret; 957 int ret;
958 958
959 pb = _find_or_start_conversation(jdata, to); 959 pb = _find_or_start_conversation(jdata, to);
960 if (pb == NULL) { 960 if (pb == NULL || pb->proto_data == NULL) {
961 purple_debug_info("bonjour", "Can't send a message to an offline buddy (%s).\n", to); 961 purple_debug_info("bonjour", "Can't send a message to an offline buddy (%s).\n", to);
962 /* You can not send a message to an offline buddy */ 962 /* You can not send a message to an offline buddy */
963 return -10000; 963 return -10000;
964 } 964 }
965 965
1101 GSList *buddies, *l; 1101 GSList *buddies, *l;
1102 1102
1103 buddies = purple_find_buddies(jdata->account, NULL); 1103 buddies = purple_find_buddies(jdata->account, NULL);
1104 for (l = buddies; l; l = l->next) { 1104 for (l = buddies; l; l = l->next) {
1105 BonjourBuddy *bb = ((PurpleBuddy*) l->data)->proto_data; 1105 BonjourBuddy *bb = ((PurpleBuddy*) l->data)->proto_data;
1106 bonjour_jabber_close_conversation(bb->conversation); 1106 if (bb != NULL) {
1107 bb->conversation = NULL; 1107 bonjour_jabber_close_conversation(bb->conversation);
1108 bb->conversation = NULL;
1109 }
1108 } 1110 }
1109 1111
1110 g_slist_free(buddies); 1112 g_slist_free(buddies);
1111 } 1113 }
1112 1114