changeset 29252:af038fcca10f

*** Plucked rev 0707f870a510922ae86ef379b5f01efa76d01402 (8e1d807c1aadfb510e14f047d2cf00e0c06be465): purple_account_request_authorization() does not require non-NULL auth and deny callbacks, so let's not crash if it is not given them. This should fix Fedora bug https://bugzilla.redhat.com/show_bug.cgi?id=552607 which I'm guessing is caused by a 3rd party prpl
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 07 Jan 2010 23:48:32 +0000
parents 419565a2ed9d
children f75c1323c996
files libpurple/account.c
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/account.c	Thu Jan 07 23:48:06 2010 +0000
+++ b/libpurple/account.c	Thu Jan 07 23:48:32 2010 +0000
@@ -1341,7 +1341,8 @@
 
 	handles = g_list_remove(handles, info);
 
-	info->auth_cb(info->userdata);
+	if (info->auth_cb != NULL)
+		info->auth_cb(info->userdata);
 
 	purple_signal_emit(purple_accounts_get_handle(),
 			"account-authorization-granted", info->account, info->user);
@@ -1356,7 +1357,8 @@
 
 	handles = g_list_remove(handles, info);
 
-	info->deny_cb(info->userdata);
+	if (info->deny_cb != NULL)
+		info->deny_cb(info->userdata);
 
 	purple_signal_emit(purple_accounts_get_handle(),
 			"account-authorization-denied", info->account, info->user);
@@ -1383,10 +1385,12 @@
 				"account-authorization-requested", account, remote_user));
 
 	if (plugin_return > 0) {
-		auth_cb(user_data);
+		if (auth_cb != NULL)
+			auth_cb(user_data);
 		return NULL;
 	} else if (plugin_return < 0) {
-		deny_cb(user_data);
+		if (deny_cb != NULL)
+			deny_cb(user_data);
 		return NULL;
 	}