Mercurial > pidgin.yaz
comparison src/protocols/oscar/oscar.c @ 5493:3e8487580024
[gaim-migrate @ 5889]
Everything is now moved to the new gaim_request_input().
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Thu, 22 May 2003 20:50:30 +0000 |
parents | ad445074d239 |
children | 3c7748b24410 |
comparison
equal
deleted
inserted
replaced
5492:a75a952d78db | 5493:3e8487580024 |
---|---|
297 return val+1; | 297 return val+1; |
298 else | 298 else |
299 return val; | 299 return val; |
300 } | 300 } |
301 | 301 |
302 static void gaim_free_name_data(struct name_data *data) { | 302 static void gaim_free_name_data(const char *text, struct name_data *data) { |
303 g_free(data->name); | 303 g_free(data->name); |
304 g_free(data->nick); | 304 g_free(data->nick); |
305 g_free(data); | 305 g_free(data); |
306 } | 306 } |
307 | 307 |
2406 * Authorization Functions | 2406 * Authorization Functions |
2407 * Most of these are callbacks from dialogs. They're used by both | 2407 * Most of these are callbacks from dialogs. They're used by both |
2408 * methods of authorization (SSI and old-school channel 4 ICBM) | 2408 * methods of authorization (SSI and old-school channel 4 ICBM) |
2409 */ | 2409 */ |
2410 /* When you ask other people for authorization */ | 2410 /* When you ask other people for authorization */ |
2411 static void gaim_auth_request(struct name_data *data, char *msg) { | 2411 static void gaim_auth_request(char *msg, struct name_data *data) { |
2412 struct gaim_connection *gc = data->gc; | 2412 struct gaim_connection *gc = data->gc; |
2413 | 2413 |
2414 if (g_slist_find(connections, gc)) { | 2414 if (g_slist_find(connections, gc)) { |
2415 struct oscar_data *od = gc->proto_data; | 2415 struct oscar_data *od = gc->proto_data; |
2416 struct buddy *buddy = gaim_find_buddy(gc->account, data->name); | 2416 struct buddy *buddy = gaim_find_buddy(gc->account, data->name); |
2425 } | 2425 } |
2426 } | 2426 } |
2427 } | 2427 } |
2428 | 2428 |
2429 static void gaim_auth_request_msgprompt(struct name_data *data) { | 2429 static void gaim_auth_request_msgprompt(struct name_data *data) { |
2430 do_prompt_dialog(_("Authorization Request Message:"), _("Please authorize me!"), data, gaim_auth_request, gaim_free_name_data); | 2430 gaim_request_input(data->gc, NULL, _("Authorization Request Message:"), |
2431 NULL, _("Please authorize me!"), TRUE, | |
2432 _("OK"), G_CALLBACK(gaim_auth_request), | |
2433 _("Cancel"), G_CALLBACK(gaim_free_name_data), | |
2434 data); | |
2431 } | 2435 } |
2432 | 2436 |
2433 static void gaim_auth_dontrequest(struct name_data *data) { | 2437 static void gaim_auth_dontrequest(struct name_data *data) { |
2434 struct gaim_connection *gc = data->gc; | 2438 struct gaim_connection *gc = data->gc; |
2435 | 2439 |
2436 if (g_slist_find(connections, gc)) { | 2440 if (g_slist_find(connections, gc)) { |
2437 /* struct oscar_data *od = gc->proto_data; */ | 2441 /* struct oscar_data *od = gc->proto_data; */ |
2438 /* XXX - Take the buddy out of our buddy list */ | 2442 /* XXX - Take the buddy out of our buddy list */ |
2439 } | 2443 } |
2440 | 2444 |
2441 gaim_free_name_data(data); | 2445 gaim_free_name_data(NULL, data); |
2442 } | 2446 } |
2443 | 2447 |
2444 static void gaim_auth_sendrequest(struct gaim_connection *gc, const char *name) { | 2448 static void gaim_auth_sendrequest(struct gaim_connection *gc, const char *name) { |
2445 struct name_data *data = g_new(struct name_data, 1); | 2449 struct name_data *data = g_new(struct name_data, 1); |
2446 struct buddy *buddy; | 2450 struct buddy *buddy; |
2478 #else | 2482 #else |
2479 aim_ssi_sendauthreply(od->sess, data->name, 0x01, NULL); | 2483 aim_ssi_sendauthreply(od->sess, data->name, 0x01, NULL); |
2480 #endif | 2484 #endif |
2481 } | 2485 } |
2482 | 2486 |
2483 gaim_free_name_data(data); | 2487 gaim_free_name_data(NULL, data); |
2484 } | 2488 } |
2485 | 2489 |
2486 /* When other people ask you for authorization */ | 2490 /* When other people ask you for authorization */ |
2487 static void gaim_auth_dontgrant(struct name_data *data, char *msg) { | 2491 static void gaim_auth_dontgrant(char *msg, struct name_data *data) { |
2488 struct gaim_connection *gc = data->gc; | 2492 struct gaim_connection *gc = data->gc; |
2489 | 2493 |
2490 if (g_slist_find(connections, gc)) { | 2494 if (g_slist_find(connections, gc)) { |
2491 struct oscar_data *od = gc->proto_data; | 2495 struct oscar_data *od = gc->proto_data; |
2492 #ifdef NOSSI | 2496 #ifdef NOSSI |
2496 #endif | 2500 #endif |
2497 } | 2501 } |
2498 } | 2502 } |
2499 | 2503 |
2500 static void gaim_auth_dontgrant_msgprompt(struct name_data *data) { | 2504 static void gaim_auth_dontgrant_msgprompt(struct name_data *data) { |
2501 do_prompt_dialog(_("Authorization Denied Message:"), _("No reason given."), data, gaim_auth_dontgrant, gaim_free_name_data); | 2505 gaim_request_input(data->gc, NULL, _("Authorization Denied Message:"), |
2506 NULL, _("No reason given."), TRUE, | |
2507 _("OK"), G_CALLBACK(gaim_auth_dontgrant), | |
2508 _("Cancel"), G_CALLBACK(gaim_free_name_data), | |
2509 data); | |
2502 } | 2510 } |
2503 | 2511 |
2504 /* When someone sends you contacts */ | 2512 /* When someone sends you contacts */ |
2505 static void gaim_icq_contactadd(struct name_data *data) { | 2513 static void gaim_icq_contactadd(struct name_data *data) { |
2506 struct gaim_connection *gc = data->gc; | 2514 struct gaim_connection *gc = data->gc; |
2507 | 2515 |
2508 if (g_slist_find(connections, gc)) { | 2516 if (g_slist_find(connections, gc)) { |
2509 show_add_buddy(gc, data->name, NULL, data->nick); | 2517 show_add_buddy(gc, data->name, NULL, data->nick); |
2510 } | 2518 } |
2511 | 2519 |
2512 gaim_free_name_data(data); | 2520 gaim_free_name_data(NULL, data); |
2513 } | 2521 } |
2514 | 2522 |
2515 static int incomingim_chan4(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch4_args *args, time_t t) { | 2523 static int incomingim_chan4(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch4_args *args, time_t t) { |
2516 struct gaim_connection *gc = sess->aux_data; | 2524 struct gaim_connection *gc = sess->aux_data; |
2517 gchar **msg1, **msg2; | 2525 gchar **msg1, **msg2; |
5733 } | 5741 } |
5734 | 5742 |
5735 return m; | 5743 return m; |
5736 } | 5744 } |
5737 | 5745 |
5738 static void oscar_format_screenname(struct gaim_connection *gc, char *nick) { | 5746 static void oscar_format_screenname(const char *nick, struct gaim_connection *gc) { |
5739 struct oscar_data *od = gc->proto_data; | 5747 struct oscar_data *od = gc->proto_data; |
5740 if (!aim_sncmp(gc->username, nick)) { | 5748 if (!aim_sncmp(gc->username, nick)) { |
5741 if (!aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH)) { | 5749 if (!aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH)) { |
5742 od->setnick = TRUE; | 5750 od->setnick = TRUE; |
5743 od->newsn = g_strdup(nick); | 5751 od->newsn = g_strdup(nick); |
5751 } | 5759 } |
5752 } | 5760 } |
5753 | 5761 |
5754 static void oscar_show_format_screenname(struct gaim_connection *gc) | 5762 static void oscar_show_format_screenname(struct gaim_connection *gc) |
5755 { | 5763 { |
5756 do_prompt_dialog(_("New screenname formatting:"), gc->displayname, gc, oscar_format_screenname, NULL); | 5764 gaim_request_input(gc, NULL, _("New screenname formatting:"), NULL, |
5765 gc->displayname, FALSE, | |
5766 _("OK"), G_CALLBACK(oscar_format_screenname), | |
5767 _("Cancel"), NULL, | |
5768 gc); | |
5757 } | 5769 } |
5758 | 5770 |
5759 static void oscar_confirm_account(struct gaim_connection *gc) | 5771 static void oscar_confirm_account(struct gaim_connection *gc) |
5760 { | 5772 { |
5761 struct oscar_data *od = gc->proto_data; | 5773 struct oscar_data *od = gc->proto_data; |
5780 od->reqemail = TRUE; | 5792 od->reqemail = TRUE; |
5781 aim_reqservice(od->sess, od->conn, AIM_CONN_TYPE_AUTH); | 5793 aim_reqservice(od->sess, od->conn, AIM_CONN_TYPE_AUTH); |
5782 } | 5794 } |
5783 } | 5795 } |
5784 | 5796 |
5785 static void oscar_change_email(struct gaim_connection *gc, char *email) | 5797 static void oscar_change_email(const char *email, struct gaim_connection *gc) |
5786 { | 5798 { |
5787 struct oscar_data *od = gc->proto_data; | 5799 struct oscar_data *od = gc->proto_data; |
5788 aim_conn_t *conn = aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH); | 5800 aim_conn_t *conn = aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH); |
5789 | 5801 |
5790 if (conn) { | 5802 if (conn) { |
5796 } | 5808 } |
5797 } | 5809 } |
5798 | 5810 |
5799 static void oscar_show_change_email(struct gaim_connection *gc) | 5811 static void oscar_show_change_email(struct gaim_connection *gc) |
5800 { | 5812 { |
5801 do_prompt_dialog(_("Change Address To: "), NULL, gc, oscar_change_email, NULL); | 5813 gaim_request_input(gc, NULL, _("Change Address To:"), NULL, NULL, FALSE, |
5814 _("OK"), G_CALLBACK(oscar_change_email), | |
5815 _("Cancel"), NULL, | |
5816 gc); | |
5802 } | 5817 } |
5803 | 5818 |
5804 static void oscar_show_awaitingauth(struct gaim_connection *gc) | 5819 static void oscar_show_awaitingauth(struct gaim_connection *gc) |
5805 { | 5820 { |
5806 struct oscar_data *od = gc->proto_data; | 5821 struct oscar_data *od = gc->proto_data; |