Mercurial > pidgin.yaz
comparison libpurple/protocols/bonjour/jabber.c @ 31018:9c8b28dc6656
The hostname used for a bonjour account should always be the current machine
name. This fixes our behavior so the previous statement is always the case.
Unfortunately, this means that if the hostname was previously not the current
machine name, the bonjour jid ends up looking like "username\40otherhost@hostname".
Fixes #12674
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Mon, 04 Oct 2010 00:48:25 +0000 |
parents | 7c871249318b |
children | 03988b6b41dd |
comparison
equal
deleted
inserted
replaced
31017:014a58e994da | 31018:9c8b28dc6656 |
---|---|
423 purple_debug_warning("bonjour", "receive error: %s\n", err ? err : "(null)"); | 423 purple_debug_warning("bonjour", "receive error: %s\n", err ? err : "(null)"); |
424 | 424 |
425 bonjour_jabber_close_conversation(bconv); | 425 bonjour_jabber_close_conversation(bconv); |
426 if (bconv->pb != NULL) { | 426 if (bconv->pb != NULL) { |
427 BonjourBuddy *bb = purple_buddy_get_protocol_data(bconv->pb); | 427 BonjourBuddy *bb = purple_buddy_get_protocol_data(bconv->pb); |
428 | 428 |
429 if(bb != NULL) | 429 if(bb != NULL) |
430 bb->conversation = NULL; | 430 bb->conversation = NULL; |
431 } | 431 } |
432 | 432 |
433 /* I guess we really don't need to notify the user. | 433 /* I guess we really don't need to notify the user. |
532 /* If we have no idea who "to" is, use an empty string. | 532 /* If we have no idea who "to" is, use an empty string. |
533 * If we don't know now, it is because the other side isn't playing nice, so they can't complain. */ | 533 * If we don't know now, it is because the other side isn't playing nice, so they can't complain. */ |
534 if (bname == NULL) | 534 if (bname == NULL) |
535 bname = ""; | 535 bname = ""; |
536 | 536 |
537 stream_start = g_strdup_printf(DOCTYPE, purple_account_get_username(bconv->account), bname); | 537 stream_start = g_strdup_printf(DOCTYPE, bonjour_get_jid(bconv->account), bname); |
538 len = strlen(stream_start); | 538 len = strlen(stream_start); |
539 | 539 |
540 bconv->sent_stream_start = PARTIALLY_SENT; | 540 bconv->sent_stream_start = PARTIALLY_SENT; |
541 | 541 |
542 /* Start the stream */ | 542 /* Start the stream */ |
1042 | 1042 |
1043 purple_markup_html_to_xhtml(body, &xhtml, &message); | 1043 purple_markup_html_to_xhtml(body, &xhtml, &message); |
1044 | 1044 |
1045 message_node = xmlnode_new("message"); | 1045 message_node = xmlnode_new("message"); |
1046 xmlnode_set_attrib(message_node, "to", bb->name); | 1046 xmlnode_set_attrib(message_node, "to", bb->name); |
1047 xmlnode_set_attrib(message_node, "from", purple_account_get_username(jdata->account)); | 1047 xmlnode_set_attrib(message_node, "from", bonjour_get_jid(jdata->account)); |
1048 xmlnode_set_attrib(message_node, "type", "chat"); | 1048 xmlnode_set_attrib(message_node, "type", "chat"); |
1049 | 1049 |
1050 /* Enclose the message from the UI within a "font" node */ | 1050 /* Enclose the message from the UI within a "font" node */ |
1051 node = xmlnode_new_child(message_node, "body"); | 1051 node = xmlnode_new_child(message_node, "body"); |
1052 xmlnode_insert_data(node, message, strlen(message)); | 1052 xmlnode_insert_data(node, message, strlen(message)); |
1257 | 1257 |
1258 acc = purple_buddy_get_account(pb); | 1258 acc = purple_buddy_get_account(pb); |
1259 | 1259 |
1260 for(l = acc->deny; l != NULL; l = l->next) { | 1260 for(l = acc->deny; l != NULL; l = l->next) { |
1261 const gchar *name = purple_buddy_get_name(pb); | 1261 const gchar *name = purple_buddy_get_name(pb); |
1262 const gchar *username = purple_account_get_username(acc); | 1262 const gchar *username = bonjour_get_jid(acc); |
1263 | 1263 |
1264 if(!purple_utf8_strcasecmp(name, (char *)l->data)) { | 1264 if(!purple_utf8_strcasecmp(name, (char *)l->data)) { |
1265 purple_debug_info("bonjour", "%s has been blocked by %s.\n", name, username); | 1265 purple_debug_info("bonjour", "%s has been blocked by %s.\n", name, username); |
1266 blocked = TRUE; | 1266 blocked = TRUE; |
1267 break; | 1267 break; |