Mercurial > pidgin
comparison libgaim/protocols/oscar/oscar.c @ 15053:06b0b50d3617
[gaim-migrate @ 17837]
Get rid of a silly prompt and skip straight to asking the Gaim user to
enter a message to use when requesting authorization when adding an
ICQ user to your buddylist
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Tue, 28 Nov 2006 08:44:12 +0000 |
parents | 4b7065af8549 |
children | f227feab8c78 |
comparison
equal
deleted
inserted
replaced
15052:51f3c0df6ab4 | 15053:06b0b50d3617 |
---|---|
2145 aim_ssi_addbuddy(od, buddy->name, group->name, gaim_buddy_get_alias_only(buddy), NULL, NULL, 1); | 2145 aim_ssi_addbuddy(od, buddy->name, group->name, gaim_buddy_get_alias_only(buddy), NULL, NULL, 1); |
2146 } | 2146 } |
2147 } | 2147 } |
2148 | 2148 |
2149 static void | 2149 static void |
2150 gaim_auth_request_msgprompt(struct name_data *data) | 2150 gaim_auth_dontrequest(struct name_data *data) |
2151 { | 2151 { |
2152 GaimConnection *gc = data->gc; | |
2153 GaimBuddy *b = gaim_find_buddy(gaim_connection_get_account(gc), data->name); | |
2154 | |
2155 /* Remove from local list */ | |
2156 gaim_blist_remove_buddy(b); | |
2157 | |
2158 oscar_free_name_data(data); | |
2159 } | |
2160 | |
2161 | |
2162 static void | |
2163 gaim_auth_sendrequest(GaimConnection *gc, const char *name) | |
2164 { | |
2165 struct name_data *data; | |
2166 | |
2167 data = g_new0(struct name_data, 1); | |
2168 data->gc = gc; | |
2169 data->name = g_strdup(name); | |
2170 | |
2152 gaim_request_input(data->gc, NULL, _("Authorization Request Message:"), | 2171 gaim_request_input(data->gc, NULL, _("Authorization Request Message:"), |
2153 NULL, _("Please authorize me!"), TRUE, FALSE, NULL, | 2172 NULL, _("Please authorize me!"), TRUE, FALSE, NULL, |
2154 _("OK"), G_CALLBACK(gaim_auth_request), | 2173 _("OK"), G_CALLBACK(gaim_auth_request), |
2155 _("Cancel"), G_CALLBACK(oscar_free_name_data), | 2174 _("Cancel"), G_CALLBACK(gaim_auth_dontrequest), |
2156 data); | 2175 data); |
2157 } | |
2158 | |
2159 static void | |
2160 gaim_auth_dontrequest(struct name_data *data) | |
2161 { | |
2162 GaimConnection *gc = data->gc; | |
2163 GaimBuddy *b = gaim_find_buddy(gaim_connection_get_account(gc), data->name); | |
2164 | |
2165 /* Remove from local list */ | |
2166 gaim_blist_remove_buddy(b); | |
2167 | |
2168 oscar_free_name_data(data); | |
2169 } | |
2170 | |
2171 | |
2172 static void | |
2173 gaim_auth_sendrequest(GaimConnection *gc, char *name) | |
2174 { | |
2175 struct name_data *data = g_new0(struct name_data, 1); | |
2176 GaimBuddy *buddy; | |
2177 gchar *dialog_msg, *nombre; | |
2178 | |
2179 buddy = gaim_find_buddy(gc->account, name); | |
2180 if (buddy && (gaim_buddy_get_alias_only(buddy))) | |
2181 nombre = g_strdup_printf("%s (%s)", name, gaim_buddy_get_alias_only(buddy)); | |
2182 else | |
2183 nombre = NULL; | |
2184 | |
2185 dialog_msg = g_strdup_printf(_("The user %s requires authorization before being added to a buddy list. Do you want to send an authorization request?"), (nombre ? nombre : name)); | |
2186 data->gc = gc; | |
2187 data->name = g_strdup(name); | |
2188 data->nick = NULL; | |
2189 | |
2190 gaim_request_action(gc, NULL, _("Request Authorization"), dialog_msg, | |
2191 0, data, 2, | |
2192 _("_Request Authorization"), | |
2193 G_CALLBACK(gaim_auth_request_msgprompt), | |
2194 _("Cancel"), G_CALLBACK(gaim_auth_dontrequest)); | |
2195 | |
2196 g_free(dialog_msg); | |
2197 g_free(nombre); | |
2198 } | 2176 } |
2199 | 2177 |
2200 | 2178 |
2201 static void | 2179 static void |
2202 gaim_auth_sendrequest_menu(GaimBlistNode *node, gpointer ignored) | 2180 gaim_auth_sendrequest_menu(GaimBlistNode *node, gpointer ignored) |
5819 gc = gaim_account_get_connection(buddy->account); | 5797 gc = gaim_account_get_connection(buddy->account); |
5820 | 5798 |
5821 aim_locate_getinfoshort(gc->proto_data, gaim_buddy_get_name(buddy), 0x00000003); | 5799 aim_locate_getinfoshort(gc->proto_data, gaim_buddy_get_name(buddy), 0x00000003); |
5822 } | 5800 } |
5823 | 5801 |
5824 GList *oscar_buddy_menu(GaimBuddy *buddy) { | 5802 static GList * |
5803 oscar_buddy_menu(GaimBuddy *buddy) { | |
5825 | 5804 |
5826 GaimConnection *gc; | 5805 GaimConnection *gc; |
5827 OscarData *od; | 5806 OscarData *od; |
5828 GList *menu; | 5807 GList *menu; |
5829 GaimMenuAction *act; | 5808 GaimMenuAction *act; |