/pidgin/main: 1f5964260577: Style: fix gg (partially)
Tomasz Wasilczyk
twasilczyk at pidgin.im
Mon Feb 3 14:43:26 EST 2014
Changeset: 1f5964260577c86014ac5abb9cac6e4da6cdcdca
Author: Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date: 2014-02-03 20:43 +0100
Branch: default
URL: https://hg.pidgin.im/pidgin/main/rev/1f5964260577
Description:
Style: fix gg (partially)
diffstat:
libpurple/protocols/gg/account.c | 78 ++++++++++++++++++++--------------------
libpurple/protocols/gg/avatar.c | 28 +++++++-------
libpurple/protocols/gg/avatar.h | 2 +-
libpurple/protocols/gg/blist.c | 2 +-
libpurple/protocols/gg/chat.c | 34 ++++++++--------
5 files changed, 72 insertions(+), 72 deletions(-)
diffs (truncated from 538 to 300 lines):
diff --git a/libpurple/protocols/gg/account.c b/libpurple/protocols/gg/account.c
--- a/libpurple/protocols/gg/account.c
+++ b/libpurple/protocols/gg/account.c
@@ -77,15 +77,15 @@ void ggp_account_token_request(PurpleCon
callback(gc, NULL, user_data);
return;
}
-
+
h = gg_token(TRUE);
-
+
if (!h)
{
callback(gc, NULL, user_data);
return;
}
-
+
reqdata = g_new(ggp_account_token_reqdata, 1);
reqdata->callback = callback;
reqdata->gc = gc;
@@ -100,9 +100,9 @@ static void ggp_account_token_response(s
ggp_account_token_reqdata *reqdata = _reqdata;
struct gg_token *token_info;
ggp_account_token *token = NULL;
-
+
g_assert(!(success && cancelled));
-
+
if (cancelled)
purple_debug_info("gg", "ggp_account_token_handler: "
"cancelled\n");
@@ -128,7 +128,7 @@ static void ggp_account_token_response(s
_("Unable to fetch the token."), NULL,
purple_request_cpar_from_connection(reqdata->gc));
}
-
+
reqdata->callback(reqdata->gc, token, reqdata->user_data);
g_free(reqdata);
}
@@ -149,7 +149,7 @@ typedef struct
{
ggp_account_token *token;
PurpleConnection *gc;
-
+
gchar *email;
gchar *password;
gchar *token_value;
@@ -179,13 +179,13 @@ void ggp_account_register(PurpleAccount
{
PurpleConnection *gc = purple_account_get_connection(account);
ggp_account_register_data *register_data;
-
+
purple_debug_info("gg", "ggp_account_register\n");
-
+
register_data = g_new0(ggp_account_register_data, 1);
register_data->gc = gc;
register_data->password_remember = TRUE;
-
+
ggp_account_token_request(gc, ggp_account_register_dialog,
register_data);
}
@@ -197,7 +197,7 @@ static void ggp_account_register_dialog(
PurpleRequestFieldGroup *main_group, *password_group, *token_group;
PurpleRequestField *field, *field_password;
ggp_account_register_data *register_data = _register_data;
-
+
purple_debug_info("gg", "ggp_account_register_dialog(%p, %p, %p)\n",
gc, token, _register_data);
if (!token)
@@ -205,11 +205,11 @@ static void ggp_account_register_dialog(
ggp_account_register_completed(register_data, FALSE);
return;
}
-
+
fields = purple_request_fields_new();
main_group = purple_request_field_group_new(NULL);
purple_request_fields_add_group(fields, main_group);
-
+
field = purple_request_field_string_new("email", _("Email"),
register_data->email, FALSE);
purple_request_field_set_required(field, TRUE);
@@ -227,7 +227,7 @@ static void ggp_account_register_dialog(
purple_request_field_set_validator(field, ggp_validator_password, NULL);
purple_request_field_group_add_field(password_group, field);
field_password = field;
-
+
field = purple_request_field_string_new("password2",
_("Password (again)"), register_data->password, FALSE);
purple_request_field_set_required(field, TRUE);
@@ -235,14 +235,14 @@ static void ggp_account_register_dialog(
purple_request_field_set_validator(field, ggp_validator_password_equal,
field_password);
purple_request_field_group_add_field(password_group, field);
-
+
field = purple_request_field_bool_new("password_remember",
_("Remember password"), register_data->password_remember);
purple_request_field_group_add_field(password_group, field);
-
+
token_group = purple_request_field_group_new(_("Captcha"));
purple_request_fields_add_group(fields, token_group);
-
+
field = purple_request_field_string_new("token_value",
_("Enter text from image below"), register_data->token_value,
FALSE);
@@ -250,13 +250,13 @@ static void ggp_account_register_dialog(
purple_request_field_set_validator(field, ggp_validator_token, token);
purple_request_field_group_add_field(token_group, field);
purple_debug_info("gg", "token set %p\n", register_data->token);
-
+
field = purple_request_field_image_new("token_image", _("Captcha"),
token->data, token->size);
purple_request_field_group_add_field(token_group, field);
register_data->token = token;
-
+
purple_request_fields(gc,
GGP_ACCOUNT_REGISTER_TITLE,
GGP_ACCOUNT_REGISTER_TITLE,
@@ -286,7 +286,7 @@ static void ggp_account_register_dialog_
g_free(register_data->email);
g_free(register_data->password);
g_free(register_data->token_value);
-
+
register_data->email = g_strdup(
purple_request_fields_get_string(fields, "email"));
register_data->password = g_strdup(
@@ -330,9 +330,9 @@ static void ggp_account_register_respons
struct gg_pubdir *register_result = h->data;
uin_t uin;
gchar *tmp;
-
+
g_assert(!(success && cancelled));
-
+
if (cancelled)
{
purple_debug_info("gg", "ggp_account_register_response: "
@@ -400,7 +400,7 @@ typedef struct
{
ggp_account_token *token;
PurpleConnection *gc;
-
+
gchar *email;
gchar *password_current;
gchar *password_new;
@@ -438,10 +438,10 @@ void ggp_account_chpass(PurpleConnection
ggp_account_chpass_data *chpass_data;
purple_debug_info("gg", "ggp_account_chpass\n");
-
+
chpass_data = g_new0(ggp_account_chpass_data, 1);
chpass_data->gc = gc;
-
+
ggp_account_token_request(gc, ggp_account_chpass_dialog, chpass_data);
}
@@ -454,7 +454,7 @@ static void ggp_account_chpass_dialog(Pu
PurpleRequestFieldGroup *main_group, *password_group, *token_group;
PurpleRequestField *field, *field_password;
gchar *primary;
-
+
purple_debug_info("gg", "ggp_account_chpass_dialog(%p, %p, %p)\n",
gc, token, _chpass_data);
if (!token)
@@ -462,11 +462,11 @@ static void ggp_account_chpass_dialog(Pu
ggp_account_chpass_data_free(chpass_data);
return;
}
-
+
fields = purple_request_fields_new();
main_group = purple_request_field_group_new(NULL);
purple_request_fields_add_group(fields, main_group);
-
+
field = purple_request_field_string_new("email",
_("New email address"), chpass_data->email, FALSE);
purple_request_field_set_required(field, TRUE);
@@ -482,7 +482,7 @@ static void ggp_account_chpass_dialog(Pu
purple_request_field_set_required(field, TRUE);
purple_request_field_string_set_masked(field, TRUE);
purple_request_field_group_add_field(password_group, field);
-
+
field = purple_request_field_string_new("password_new1",
_("Password"), chpass_data->password_new, FALSE);
purple_request_field_set_required(field, TRUE);
@@ -490,7 +490,7 @@ static void ggp_account_chpass_dialog(Pu
purple_request_field_set_validator(field, ggp_validator_password, NULL);
purple_request_field_group_add_field(password_group, field);
field_password = field;
-
+
field = purple_request_field_string_new("password_new2",
_("Password (retype)"), chpass_data->password_new, FALSE);
purple_request_field_set_required(field, TRUE);
@@ -498,23 +498,23 @@ static void ggp_account_chpass_dialog(Pu
purple_request_field_set_validator(field, ggp_validator_password_equal,
field_password);
purple_request_field_group_add_field(password_group, field);
-
+
token_group = purple_request_field_group_new(_("Captcha"));
purple_request_fields_add_group(fields, token_group);
-
+
field = purple_request_field_string_new("token_value",
_("Enter text from image below"), chpass_data->token_value,
FALSE);
purple_request_field_set_required(field, TRUE);
purple_request_field_set_validator(field, ggp_validator_token, token);
purple_request_field_group_add_field(token_group, field);
-
+
field = purple_request_field_image_new("token_image", _("Captcha"),
token->data, token->size);
purple_request_field_group_add_field(token_group, field);
-
+
chpass_data->token = token;
-
+
primary = g_strdup_printf(_("Change password for %s"),
purple_account_get_username(account));
@@ -542,7 +542,7 @@ static void ggp_account_chpass_dialog_ok
g_free(chpass_data->password_current);
g_free(chpass_data->password_new);
g_free(chpass_data->token_value);
-
+
chpass_data->email = g_strdup(
purple_request_fields_get_string(fields, "email"));
chpass_data->password_current = g_strdup(
@@ -615,9 +615,9 @@ static void ggp_account_chpass_response(
PurpleAccount *account =
purple_connection_get_account(chpass_data->gc);
struct gg_pubdir *chpass_result = h->data;
-
+
g_assert(!(success && cancelled));
-
+
if (cancelled)
{
purple_debug_info("gg", "ggp_account_chpass_response: "
@@ -650,7 +650,7 @@ static void ggp_account_chpass_response(
purple_request_cpar_from_connection(chpass_data->gc));
ggp_account_chpass_data_free(chpass_data);
-
+
//TODO: reconnect / check how it is done in original client
purple_account_disconnect(account);
}
diff --git a/libpurple/protocols/gg/avatar.c b/libpurple/protocols/gg/avatar.c
--- a/libpurple/protocols/gg/avatar.c
+++ b/libpurple/protocols/gg/avatar.c
@@ -53,7 +53,7 @@ typedef struct
{
uin_t uin;
time_t timestamp;
-
+
PurpleConnection *gc;
PurpleHttpConnection *request;
} ggp_avatar_buddy_update_req;
@@ -89,7 +89,7 @@ void ggp_avatar_setup(PurpleConnection *
avdata->pending_updates = NULL;
avdata->current_update = NULL;
avdata->own_data = g_new0(ggp_avatar_own_data, 1);
-
+
avdata->timer = purple_timeout_add_seconds(1, ggp_avatar_timer_cb, gc);
}
@@ -108,7 +108,7 @@ void ggp_avatar_cleanup(PurpleConnection
More information about the Commits
mailing list