changeset 22055:895120b1b926

merge of '6523df90f67ed0428e11d3ebc7bf15777986ebcf' and 'd567c3024540efcf356b0e1201e926ef551c8ec6'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 10 Jan 2008 02:28:42 +0000
parents 658785fe1992 (diff) 2d4c3b775620 (current diff)
children fdebef95b300
files
diffstat 7 files changed, 76 insertions(+), 47 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/account.c	Thu Jan 10 02:27:04 2008 +0000
+++ b/libpurple/account.c	Thu Jan 10 02:28:42 2008 +0000
@@ -1219,7 +1219,11 @@
 	if (ops != NULL && ops->close_account_request != NULL)
 		ops->close_account_request(info->ui_handle);
 
+	/* TODO: This will leak info->user_data, but there is no callback to just clean that up */
+
+	g_free(info->user);
 	g_free(info);
+
 }
 
 void
@@ -1264,9 +1268,14 @@
 request_auth_cb(void *data)
 {
 	PurpleAccountRequestInfo *info = data;
+
+	handles = g_list_remove(handles, info);
+
 	info->auth_cb(info->userdata);
+
 	purple_signal_emit(purple_accounts_get_handle(),
 			"account-authorization-granted", info->account, info->user);
+
 	g_free(info->user);
 	g_free(info);
 }
@@ -1275,9 +1284,14 @@
 request_deny_cb(void *data)
 {
 	PurpleAccountRequestInfo *info = data;
+
+	handles = g_list_remove(handles, info);
+
 	info->deny_cb(info->userdata);
+
 	purple_signal_emit(purple_accounts_get_handle(),
 			"account-authorization-denied", info->account, info->user);
+
 	g_free(info->user);
 	g_free(info);
 }
--- a/libpurple/protocols/bonjour/mdns_avahi.c	Thu Jan 10 02:27:04 2008 +0000
+++ b/libpurple/protocols/bonjour/mdns_avahi.c	Thu Jan 10 02:28:42 2008 +0000
@@ -445,14 +445,14 @@
 				idata->group, AVAHI_IF_UNSPEC,
 				AVAHI_PROTO_INET, 0,
 				purple_account_get_username(data->account),
-				ICHAT_SERVICE, NULL, NULL, data->port_p2pj, lst);
+				LINK_LOCAL_RECORD_NAME, NULL, NULL, data->port_p2pj, lst);
 			break;
 		case PUBLISH_UPDATE:
 			publish_result = avahi_entry_group_update_service_txt_strlst(
 				idata->group, AVAHI_IF_UNSPEC,
 				AVAHI_PROTO_INET, 0,
 				purple_account_get_username(data->account),
-				ICHAT_SERVICE, NULL, lst);
+				LINK_LOCAL_RECORD_NAME, NULL, lst);
 			break;
 	}
 
@@ -461,7 +461,7 @@
 
 	if (publish_result < 0) {
 		purple_debug_error("bonjour",
-			"Failed to add the " ICHAT_SERVICE " service. Error: %s\n",
+			"Failed to add the " LINK_LOCAL_RECORD_NAME " service. Error: %s\n",
 			avahi_strerror(publish_result));
 		return FALSE;
 	}
@@ -469,7 +469,7 @@
 	if (type == PUBLISH_START
 			&& (publish_result = avahi_entry_group_commit(idata->group)) < 0) {
 		purple_debug_error("bonjour",
-			"Failed to commit " ICHAT_SERVICE " service. Error: %s\n",
+			"Failed to commit " LINK_LOCAL_RECORD_NAME " service. Error: %s\n",
 			avahi_strerror(publish_result));
 		return FALSE;
 	}
@@ -482,7 +482,7 @@
 
 	g_return_val_if_fail(idata != NULL, FALSE);
 
-	idata->sb = avahi_service_browser_new(idata->client, AVAHI_IF_UNSPEC, AVAHI_PROTO_INET, ICHAT_SERVICE, NULL, 0, _browser_callback, data->account);
+	idata->sb = avahi_service_browser_new(idata->client, AVAHI_IF_UNSPEC, AVAHI_PROTO_INET, LINK_LOCAL_RECORD_NAME, NULL, 0, _browser_callback, data->account);
 	if (!idata->sb) {
 
 		purple_debug_error("bonjour",
@@ -524,7 +524,7 @@
 			return FALSE;
 		}
 
-		svc_name = g_strdup_printf("%s." ICHAT_SERVICE "local",
+		svc_name = g_strdup_printf("%s." LINK_LOCAL_RECORD_NAME "local",
 				purple_account_get_username(data->account));
 
 		ret = avahi_entry_group_add_record(idata->buddy_icon_group, AVAHI_IF_UNSPEC,
@@ -615,7 +615,7 @@
 
 	purple_debug_info("bonjour", "Retrieving buddy icon for '%s'.\n", buddy->name);
 
-	name = g_strdup_printf("%s." ICHAT_SERVICE "local", buddy->name);
+	name = g_strdup_printf("%s." LINK_LOCAL_RECORD_NAME "local", buddy->name);
 	idata->buddy_icon_rec_browser = avahi_record_browser_new(session_idata->client, AVAHI_IF_UNSPEC,
 		AVAHI_PROTO_INET, name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_NULL, 0,
 		_buddy_icon_record_cb, buddy);
--- a/libpurple/protocols/bonjour/mdns_types.h	Thu Jan 10 02:27:04 2008 +0000
+++ b/libpurple/protocols/bonjour/mdns_types.h	Thu Jan 10 02:28:42 2008 +0000
@@ -20,7 +20,7 @@
 #include <glib.h>
 #include "account.h"
 
-#define ICHAT_SERVICE "_presence._tcp."
+#define LINK_LOCAL_RECORD_NAME "_presence._tcp."
 
 /**
  * Data to be used by the dns-sd connection.
--- a/libpurple/protocols/bonjour/mdns_win32.c	Thu Jan 10 02:27:04 2008 +0000
+++ b/libpurple/protocols/bonjour/mdns_win32.c	Thu Jan 10 02:28:42 2008 +0000
@@ -476,7 +476,7 @@
 		switch (type) {
 			case PUBLISH_START:
 				purple_debug_info("bonjour", "Registering presence on port %d\n", data->port_p2pj);
-				errorCode = DNSServiceRegister(&presence_sr, 0, 0, purple_account_get_username(data->account), ICHAT_SERVICE,
+				errorCode = DNSServiceRegister(&presence_sr, 0, 0, purple_account_get_username(data->account), LINK_LOCAL_RECORD_NAME,
 					NULL, NULL, htons(data->port_p2pj), TXTRecordGetLength(&dns_data), TXTRecordGetBytesPtr(&dns_data),
 					_mdns_service_register_callback, NULL);
 				break;
@@ -515,7 +515,7 @@
 
 	g_return_val_if_fail(idata != NULL, FALSE);
 
-	errorCode = DNSServiceBrowse(&browser_sr, 0, 0, ICHAT_SERVICE, NULL,
+	errorCode = DNSServiceBrowse(&browser_sr, 0, 0, LINK_LOCAL_RECORD_NAME, NULL,
 		_mdns_service_browse_callback, data->account);
 	if (errorCode == kDNSServiceErr_NoError) {
 		idata->browser_query = g_new(DnsSDServiceRefHandlerData, 1);
@@ -622,7 +622,7 @@
 		idata->null_query = NULL;
 	}
 
-	if (DNSServiceConstructFullName(svc_name, buddy->name, ICHAT_SERVICE, "local") != 0)
+	if (DNSServiceConstructFullName(svc_name, buddy->name, LINK_LOCAL_RECORD_NAME, "local") != 0)
 		purple_debug_error("bonjour", "Unable to construct full name to retrieve buddy icon for %s.\n", buddy->name);
 	else {
 		DNSServiceRef null_query_sr;
--- a/libpurple/protocols/yahoo/yahoo.c	Thu Jan 10 02:27:04 2008 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Thu Jan 10 02:28:42 2008 +0000
@@ -970,13 +970,19 @@
 yahoo_buddy_add_authorize_cb(gpointer data) {
 	struct yahoo_add_request *add_req = data;
 
-	struct yahoo_packet *pkt;
-	struct yahoo_data *yd = add_req->gc->proto_data;
-
-	pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH_REQ_15, YAHOO_STATUS_AVAILABLE, 0);
-	yahoo_packet_hash(pkt, "ssiii", 1, add_req->id, 5, add_req->who, 241, add_req->protocol,
-	                  13, 1, 334, 0);
-	yahoo_packet_send_and_free(pkt, yd);
+	if (PURPLE_CONNECTION_IS_VALID(add_req->gc)) {
+		struct yahoo_packet *pkt;
+		struct yahoo_data *yd = add_req->gc->proto_data;
+
+		pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH_REQ_15, YAHOO_STATUS_AVAILABLE, 0);
+		yahoo_packet_hash(pkt, "ssiii",
+						  1, add_req->id,
+						  5, add_req->who,
+						  241, add_req->protocol,
+						  13, 1,
+						  334, 0);
+		yahoo_packet_send_and_free(pkt, yd);
+	}
 
 	g_free(add_req->id);
 	g_free(add_req->who);
@@ -985,28 +991,31 @@
 
 static void
 yahoo_buddy_add_deny_cb(struct yahoo_add_request *add_req, const char *msg) {
-	struct yahoo_packet *pkt;
-	char *encoded_msg = NULL;
-	struct yahoo_data *yd = add_req->gc->proto_data;
-	PurpleAccount *account = purple_connection_get_account(add_req->gc);
-
-	if (msg && *msg)
-		encoded_msg = yahoo_string_encode(add_req->gc, msg, NULL);
-
-	pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH_REQ_15,
-			YAHOO_STATUS_AVAILABLE, 0);
-
-	yahoo_packet_hash(pkt, "ssiiis",
-			1, purple_normalize(account, purple_account_get_username(account)),
-			5, add_req->who,
-			13, 2,
-			334, 0,
-			97, 1,
-			14, encoded_msg ? encoded_msg : "");
-
-	yahoo_packet_send_and_free(pkt, yd);
-
-	g_free(encoded_msg);
+
+	if (PURPLE_CONNECTION_IS_VALID(add_req->gc)) {
+		struct yahoo_data *yd = add_req->gc->proto_data;
+		struct yahoo_packet *pkt;
+		char *encoded_msg = NULL;
+		PurpleAccount *account = purple_connection_get_account(add_req->gc);
+
+		if (msg && *msg)
+			encoded_msg = yahoo_string_encode(add_req->gc, msg, NULL);
+
+		pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH_REQ_15,
+				YAHOO_STATUS_AVAILABLE, 0);
+
+		yahoo_packet_hash(pkt, "ssiiis",
+				1, purple_normalize(account, purple_account_get_username(account)),
+				5, add_req->who,
+				13, 2,
+				334, 0,
+				97, 1,
+				14, encoded_msg ? encoded_msg : "");
+
+		yahoo_packet_send_and_free(pkt, yd);
+
+		g_free(encoded_msg);
+	}
 
 	g_free(add_req->id);
 	g_free(add_req->who);
--- a/pidgin/gtkaccount.c	Thu Jan 10 02:27:04 2008 +0000
+++ b/pidgin/gtkaccount.c	Thu Jan 10 02:28:42 2008 +0000
@@ -241,7 +241,7 @@
 
 	gtk_widget_grab_focus(dialog->protocol_menu);
 
-	if (!dialog->prpl_info || !dialog->prpl_info->register_user || 
+	if (!dialog->prpl_info || !dialog->prpl_info->register_user ||
 	    g_object_get_data(G_OBJECT(item), "fake")) {
 		gtk_widget_hide(dialog->register_button);
 	} else {
@@ -2478,6 +2478,7 @@
 						  _("Authorize"), authorize_and_add_cb,
 						  _("Deny"), deny_no_add_cb,
 						  NULL);
+		g_object_set_data(G_OBJECT(alert), "auth_and_add", aa);
 	} else {
 		alert = pidgin_make_mini_dialog(gc, PIDGIN_STOCK_DIALOG_QUESTION,
 						  _("Authorize buddy?"), buffer, user_data,
@@ -2489,13 +2490,20 @@
 
 	g_free(buffer);
 
-	return NULL;
+	return alert;
 }
 
 static void
 pidgin_accounts_request_close(void *ui_handle)
 {
-
+	/* This is super ugly, but without API changes, this is how it works */
+	struct auth_and_add *aa = g_object_get_data(G_OBJECT(ui_handle), "auth_and_add");
+	if (aa != NULL) {
+		g_free(aa->username);
+		g_free(aa->alias);
+		g_free(aa);
+	}
+	gtk_widget_destroy(GTK_WIDGET(ui_handle));
 }
 
 static PurpleAccountUiOps ui_ops =
--- a/pidgin/win32/nsis/pidgin-installer.nsi	Thu Jan 10 02:27:04 2008 +0000
+++ b/pidgin/win32/nsis/pidgin-installer.nsi	Thu Jan 10 02:28:42 2008 +0000
@@ -700,7 +700,6 @@
     Delete "$INSTDIR\ca-certs\GTE_CyberTrust_Global_Root.pem"
     Delete "$INSTDIR\ca-certs\Microsoft_Secure_Server_Authority.pem"
     Delete "$INSTDIR\ca-certs\StartCom_Free_SSL_CA.pem"
-    Delete "$INSTDIR\ca-certs\Verisign_Class3_Extended_Validation_CA.pem"
     Delete "$INSTDIR\ca-certs\Verisign_Class3_Primary_CA.pem"
     Delete "$INSTDIR\ca-certs\Verisign_RSA_Secure_Server_CA.pem"
     RMDir "$INSTDIR\ca-certs"
@@ -1168,7 +1167,6 @@
     MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(PIDGIN_IS_RUNNING) /SD IDCANCEL IDRETRY retry_runcheck
     Abort
 
-  done:
   Pop $R1
   Pop $R0
 FunctionEnd
@@ -1264,7 +1262,7 @@
 
   ClearErrors
   ${GetOptions} "$R0" "/DS=" $R1
-  IfErrors +7
+  IfErrors +8
   SectionGetFlags ${SecDesktopShortcut} $R2
   StrCmp "1" $R1 0 +2
   IntOp $R2 $R2 | ${SF_SELECTED}
@@ -1275,7 +1273,7 @@
 
   ClearErrors
   ${GetOptions} "$R0" "/SMS=" $R1
-  IfErrors +7
+  IfErrors +8
   SectionGetFlags ${SecStartMenuShortcut} $R2
   StrCmp "1" $R1 0 +2
   IntOp $R2 $R2 | ${SF_SELECTED}