pidgin/pidgin

Fix up Bonjour to use purple_connection_error_reason.
cpw.resiak.disconnectreason
2007-09-18, Will Thompson
bc4b48f6fbaa
Parents 786f26a8dc6f
Children 5db94d66f5d7
Fix up Bonjour to use purple_connection_error_reason.
--- a/libpurple/protocols/bonjour/bonjour.c Mon Sep 17 16:54:45 2007 +0000
+++ b/libpurple/protocols/bonjour/bonjour.c Tue Sep 18 16:32:01 2007 +0000
@@ -109,7 +109,8 @@
if (bonjour_jabber_start(bd->jabber_data) == -1) {
/* Send a message about the connection error */
- purple_connection_error(gc, _("Unable to listen for incoming IM connections\n"));
+ purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+ _("Unable to listen for incoming IM connections\n"));
return;
}
@@ -134,7 +135,8 @@
bd->dns_sd_data->account = account;
if (!bonjour_dns_sd_start(bd->dns_sd_data))
{
- purple_connection_error(gc, _("Unable to establish connection with the local mDNS server. Is it running?"));
+ purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+ _("Unable to establish connection with the local mDNS server. Is it running?"));
return;
}
--- a/libpurple/protocols/bonjour/jabber.c Mon Sep 17 16:54:45 2007 +0000
+++ b/libpurple/protocols/bonjour/jabber.c Tue Sep 18 16:32:01 2007 +0000
@@ -580,7 +580,8 @@
if ((data->socket = socket(PF_INET, SOCK_STREAM, 0)) < 0)
{
purple_debug_error("bonjour", "Cannot open socket: %s\n", strerror(errno));
- purple_connection_error(data->account->gc, _("Cannot open socket"));
+ purple_connection_error_reason (data->account->gc,
+ PURPLE_REASON_NETWORK_ERROR, _("Cannot open socket"));
return -1;
}
@@ -588,7 +589,8 @@
if (setsockopt(data->socket, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) != 0)
{
purple_debug_error("bonjour", "Error setting socket options: %s\n", strerror(errno));
- purple_connection_error(data->account->gc, _("Error setting socket options"));
+ purple_connection_error_reason (data->account->gc,
+ PURPLE_REASON_NETWORK_ERROR, _("Error setting socket options"));
return -1;
}
@@ -612,7 +614,8 @@
if (!bind_successful)
{
purple_debug_error("bonjour", "Cannot bind socket: %s\n", strerror(errno));
- purple_connection_error(data->account->gc, _("Could not bind socket to port"));
+ purple_connection_error_reason (data->account->gc,
+ PURPLE_REASON_NETWORK_ERROR, _("Could not bind socket to port"));
return -1;
}
@@ -620,7 +623,8 @@
if (listen(data->socket, 10) != 0)
{
purple_debug_error("bonjour", "Cannot listen on socket: %s\n", strerror(errno));
- purple_connection_error(data->account->gc, _("Could not listen on socket"));
+ purple_connection_error_reason (data->account->gc,
+ PURPLE_REASON_NETWORK_ERROR, _("Could not listen on socket"));
return -1;
}