Revision 12db4a9e09675b5127f1f310972303177d1b2ca8

wabz at pidgin.im wabz at pidgin.im
Sat Mar 3 18:13:42 EST 2007


o   -----------------------------------------------------------------
|   Revision: 12db4a9e09675b5127f1f310972303177d1b2ca8
|   Ancestor: 77fb229680f0342a6684d001bebbd722f3f4d194
|   Author: wabz at pidgin.im
|   Date: 2007-03-03T23:12:11
|   Branch: im.pidgin.pidgin
|   
|   Modified files:
|           console/gntaccount.c
|   
|   ChangeLog: 
|   
|   Add request_authorize to gaim-text's account ui ops
|   
|   ============================================================
|   --- console/gntaccount.c	e146c2e936423ce24de8690d512656030f90ec2a
|   +++ console/gntaccount.c	29a28ffb423894e600efd1a183f5d1376556aa28
|   @@ -835,11 +835,98 @@ request_add(GaimAccount *account, const 
|    	g_free(buffer);
|    }
|    
|   -static GaimAccountUiOps ui_ops = 
|   +/* Copied from gtkaccount.c */
|   +typedef struct {
|   +	GaimAccountRequestAuthorizationCb auth_cb;
|   +	GaimAccountRequestAuthorizationCb deny_cb;
|   +	void *data;
|   +	char *username;
|   +	char *alias;
|   +	GaimAccount *account;
|   +} auth_and_add;
|   +
|   +static void
|   +authorize_and_add_cb(auth_and_add *aa)
|    {
|   +	aa->auth_cb(aa->data);
|   +	gaim_blist_request_add_buddy(aa->account, aa->username,
|   +	 	                    NULL, aa->alias);
|   +
|   +	g_free(aa->username);
|   +	g_free(aa->alias);
|   +	g_free(aa);
|   +}
|   +
|   +static void
|   +deny_no_add_cb(auth_and_add *aa)
|   +{
|   +	aa->deny_cb(aa->data);
|   +
|   +	g_free(aa->username);
|   +	g_free(aa->alias);
|   +	g_free(aa);
|   +}
|   +
|   +static void *
|   +gg_request_authorize(GaimAccount *account, const char *remote_user,
|   +					const char *id, const char *alias, const char *message, gboolean on_list,
|   +					GCallback auth_cb, GCallback deny_cb, void *user_data)
|   +{
|   +	char *buffer;
|   +	GaimConnection *gc;
|   +	void *uihandle;
|   +
|   +	gc = gaim_account_get_connection(account);
|   +	if (message != NULL && *message == '\0')
|   +		message = NULL;
|   +
|   +	buffer = g_strdup_printf(_("%s%s%s%s wants to add %s to his or her buddy list%s%s"),
|   +				remote_user,
|   +	 	                (alias != NULL ? " ("  : ""),
|   +		                (alias != NULL ? alias : ""),
|   +		                (alias != NULL ? ")"   : ""),
|   +		                (id != NULL
|   +		                ? id
|   +		                : (gaim_connection_get_display_name(gc) != NULL
|   +		                ? gaim_connection_get_display_name(gc)
|   +		                : gaim_account_get_username(account))),
|   +		                (message != NULL ? ": " : "."),
|   +		                (message != NULL ? message  : ""));
|   +	if (!on_list) {
|   +		auth_and_add *aa = g_new(auth_and_add, 1);
|   +		aa->auth_cb = (GaimAccountRequestAuthorizationCb)auth_cb;
|   +		aa->deny_cb = (GaimAccountRequestAuthorizationCb)deny_cb;
|   +		aa->data = user_data;
|   +		aa->username = g_strdup(remote_user);
|   +		aa->alias = g_strdup(alias);
|   +		aa->account = account;
|   +		uihandle = gaim_request_action(NULL, _("Authorize buddy?"), buffer, NULL,
|   +			GAIM_DEFAULT_ACTION_NONE, aa, 2,
|   +			_("Authorize"), authorize_and_add_cb,
|   +			_("Deny"), deny_no_add_cb);
|   +	} else {
|   +		uihandle = gaim_request_action(NULL, _("Authorize buddy?"), buffer, NULL,
|   +			GAIM_DEFAULT_ACTION_NONE, user_data, 2,
|   +			_("Authorize"), auth_cb,
|   +			_("Deny"), deny_cb);
|   +	}
|   +	g_free(buffer);
|   +	return uihandle;
|   +}
|   +
|   +static void
|   +gg_request_close(void *uihandle)
|   +{
|   +	gaim_request_close(GAIM_REQUEST_ACTION, uihandle);
|   +}
|   +
|   +static GaimAccountUiOps ui_ops =
|   +{
|    	.notify_added = notify_added,
|    	.status_changed = NULL,
|   -	.request_add  = request_add
|   +	.request_add  = request_add,
|   +	.request_authorize = gg_request_authorize,
|   +	.close_account_request = gg_request_close
|    };
|    
|    GaimAccountUiOps *gg_accounts_get_ui_ops()

To get the patch for this revision, please do this:
mtn log --last 1 --diffs --from 12db4a9e09675b5127f1f310972303177d1b2ca8


More information about the Commits mailing list