Mercurial > pidgin
comparison src/protocols/oscar/oscar.c @ 3912:e73c48cf1645
[gaim-migrate @ 4071]
Little touchups in the "admin" family. Not much has changed, but I
moved some functions around because I'm weird. (This is the stuff in
"protocol actions" for oscar accounts.)
Some of the dialogs should look a little more, I dunno, uniform or
something.
Change password, format screenname, and change current registered screen
name should give you some slightly userfriendly error messages now.
Also "confirm account" will pop up that little message that says you
should be expecting an email... I think that was one of those brain
mistakes, where something was backwards, or something.
Uh, so let me know if you see any problems with any of that.
Why did I work on this instead of ssi? I don't know. This is funner, I
guess. I'll get to ssi eventually...
Meow.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 07 Nov 2002 02:25:12 +0000 |
parents | 43e396e94095 |
children | 07283934dedd |
comparison
equal
deleted
inserted
replaced
3911:816cfd8dae78 | 3912:e73c48cf1645 |
---|---|
3279 va_start(ap, fr); | 3279 va_start(ap, fr); |
3280 status = (fu16_t)va_arg(ap, unsigned int); /* status code of confirmation request */ | 3280 status = (fu16_t)va_arg(ap, unsigned int); /* status code of confirmation request */ |
3281 va_end(ap); | 3281 va_end(ap); |
3282 | 3282 |
3283 debug_printf("account confirmation returned status 0x%04x (%s)\n", status, | 3283 debug_printf("account confirmation returned status 0x%04x (%s)\n", status, |
3284 status ? "email sent" : "unknown"); | 3284 status ? "unknown" : "email sent"); |
3285 if (status) { | 3285 if (!status) { |
3286 g_snprintf(msg, sizeof(msg), "You should receive an email asking to confirm %s.", | 3286 g_snprintf(msg, sizeof(msg), "You should receive an email asking to confirm %s.", |
3287 gc->username); | 3287 gc->username); |
3288 do_error_dialog("Account confirmation requested.", msg, GAIM_INFO); | 3288 do_error_dialog("Account Confirmation Requested", msg, GAIM_INFO); |
3289 } | 3289 } |
3290 | 3290 |
3291 return 1; | 3291 return 1; |
3292 } | 3292 } |
3293 | 3293 |
3294 static int gaim_info_change(aim_session_t *sess, aim_frame_t *fr, ...) { | 3294 static int gaim_info_change(aim_session_t *sess, aim_frame_t *fr, ...) { |
3295 int change, str; | 3295 struct gaim_connection *gc = sess->aux_data; |
3296 fu16_t perms, type, length; | |
3297 char *val; | |
3298 va_list ap; | 3296 va_list ap; |
3299 char buf[BUF_LONG]; | 3297 fu16_t perms, err; |
3300 struct gaim_connection *gc = sess->aux_data; | 3298 char *url, *sn, *email; |
3299 int change; | |
3301 | 3300 |
3302 va_start(ap, fr); | 3301 va_start(ap, fr); |
3303 change = va_arg(ap, int); | 3302 change = va_arg(ap, int); |
3304 perms = (fu16_t)va_arg(ap, unsigned int); | 3303 perms = (fu16_t)va_arg(ap, unsigned int); |
3305 type = (fu16_t)va_arg(ap, unsigned int); | 3304 err = (fu16_t)va_arg(ap, unsigned int); |
3306 length = (fu16_t)va_arg(ap, unsigned int); | 3305 url = va_arg(ap, char *); |
3307 val = va_arg(ap, char *); | 3306 sn = va_arg(ap, char *); |
3308 str = va_arg(ap, int); | 3307 email = va_arg(ap, char *); |
3309 va_end(ap); | 3308 va_end(ap); |
3310 | 3309 |
3311 debug_printf("info%s: perms = %d, type = %x, length = %d, val = %s\n", | 3310 debug_printf("account info: because of %s, perms=0x%04x, err=0x%04x, url=%s, sn=%s, email=%s\n", |
3312 change ? " change" : "", perms, type, length, str ? val : "(not string)"); | 3311 change ? "change" : "request", perms, err, url, sn, email); |
3313 | 3312 |
3314 /* XXX Do something for other types too. */ | 3313 if (err && url) { |
3315 if ((type == 0x0011) && str && length) { | 3314 char *dialog_msg; |
3316 g_snprintf(buf, sizeof(buf), "The email address for %s is %s", gc->username, val); | 3315 char *dialog_top = g_strdup_printf(_("Error Changing Account Info")); |
3317 do_error_dialog(buf, NULL, GAIM_INFO); | 3316 switch (err) { |
3317 case 0x0001: { | |
3318 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to format screen name because the requested screen name differs from the original."), err); | |
3319 } break; | |
3320 case 0x0006: { | |
3321 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to format screen name because the requested screen name ends in a space."), err); | |
3322 } break; | |
3323 case 0x000b: { | |
3324 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to format screen name because the requested screen name is too long."), err); | |
3325 } break; | |
3326 case 0x001d: { | |
3327 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to change email address because there is already a request pending for this screen name."), err); | |
3328 } break; | |
3329 case 0x0021: { | |
3330 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to change email address because the given address has too many screen names associated with it."), err); | |
3331 } break; | |
3332 case 0x0023: { | |
3333 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to change email address because the given address is invalid."), err); | |
3334 } break; | |
3335 default: { | |
3336 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unknown error."), err); | |
3337 } break; | |
3338 } | |
3339 do_error_dialog(dialog_top, dialog_msg, GAIM_ERROR); | |
3340 g_free(dialog_top); | |
3341 g_free(dialog_msg); | |
3342 return 1; | |
3343 } | |
3344 | |
3345 if (sn) { | |
3346 char *dialog_msg = g_strdup_printf(_("Your screen name is currently formated as follows:\n%s"), sn); | |
3347 do_error_dialog("Account Info", dialog_msg, GAIM_INFO); | |
3348 g_free(dialog_msg); | |
3349 } | |
3350 | |
3351 if (email) { | |
3352 char *dialog_msg = g_strdup_printf(_("The email address for %s is %s"), gc->username, email); | |
3353 do_error_dialog("Account Info", dialog_msg, GAIM_INFO); | |
3354 g_free(dialog_msg); | |
3318 } | 3355 } |
3319 | 3356 |
3320 return 1; | 3357 return 1; |
3321 } | 3358 } |
3322 | 3359 |