comparison src/protocols/oscar/oscar.c @ 2979:8e924e4aa256

[gaim-migrate @ 2992] I'll never tell... committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Sat, 23 Feb 2002 22:50:44 +0000
parents 6226ccbdff2b
children aebf1d505e1f
comparison
equal deleted inserted replaced
2978:1c7d627df5d5 2979:8e924e4aa256
86 86
87 gboolean conf; 87 gboolean conf;
88 gboolean reqemail; 88 gboolean reqemail;
89 gboolean setemail; 89 gboolean setemail;
90 char *email; 90 char *email;
91 gboolean setnick;
92 char *newsn;
91 gboolean chpass; 93 gboolean chpass;
92 char *oldp; 94 char *oldp;
93 char *newp; 95 char *newp;
94 96
95 GSList *oscar_chats; 97 GSList *oscar_chats;
2071 od->oldp = NULL; 2073 od->oldp = NULL;
2072 g_free(od->newp); 2074 g_free(od->newp);
2073 od->newp = NULL; 2075 od->newp = NULL;
2074 od->chpass = FALSE; 2076 od->chpass = FALSE;
2075 } 2077 }
2078 if (od->setnick) {
2079 debug_printf("formatting screenname\n");
2080 aim_admin_setnick(sess, fr->conn, od->newsn);
2081 g_free(od->newsn);
2082 od->newsn = NULL;
2083 od->setnick = FALSE;
2084 }
2076 if (od->conf) { 2085 if (od->conf) {
2077 debug_printf("confirming account\n"); 2086 debug_printf("confirming account\n");
2078 aim_admin_reqconfirm(sess, fr->conn); 2087 aim_admin_reqconfirm(sess, fr->conn);
2079 od->conf = FALSE; 2088 od->conf = FALSE;
2080 } 2089 }
2984 od->email = g_strdup(email); 2993 od->email = g_strdup(email);
2985 aim_reqservice(od->sess, od->conn, AIM_CONN_TYPE_AUTH); 2994 aim_reqservice(od->sess, od->conn, AIM_CONN_TYPE_AUTH);
2986 } 2995 }
2987 } 2996 }
2988 2997
2998 static void oscar_format_screenname(struct gaim_connection *gc, char *nick) {
2999 struct oscar_data *od = gc->proto_data;
3000 if (!strcmp(normalize(nick), gc->username)) {
3001 if (!aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH)) {
3002 od->setnick = TRUE;
3003 od->newsn = g_strdup(nick);
3004 aim_reqservice(od->sess, od->conn, AIM_CONN_TYPE_AUTH);
3005 } else {
3006 aim_admin_setnick(od->sess, aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH), nick);
3007 }
3008 } else {
3009 do_error_dialog("The new formatting is invalid.", "Gaim");
3010 }
3011 }
3012
2989 static void oscar_do_action(struct gaim_connection *gc, char *act) 3013 static void oscar_do_action(struct gaim_connection *gc, char *act)
2990 { 3014 {
2991 struct oscar_data *od = gc->proto_data; 3015 struct oscar_data *od = gc->proto_data;
2992 aim_conn_t *conn = aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH); 3016 aim_conn_t *conn = aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH);
2993 3017
2994 if (!strcmp(act, "Set User Info")) { 3018 if (!strcmp(act, "Set User Info")) {
2995 show_set_info(gc); 3019 show_set_info(gc);
2996 } else if (!strcmp(act, "Change Password")) { 3020 } else if (!strcmp(act, "Change Password")) {
2997 show_change_passwd(gc); 3021 show_change_passwd(gc);
3022 } else if (!strcmp(act, "Format Screenname")) {
3023 do_prompt_dialog("New screenname formatting:",
3024 gc->displayname, gc, oscar_format_screenname, NULL);
2998 } else if (!strcmp(act, "Confirm Account")) { 3025 } else if (!strcmp(act, "Confirm Account")) {
2999 if (!conn) { 3026 if (!conn) {
3000 od->conf = TRUE; 3027 od->conf = TRUE;
3001 aim_reqservice(od->sess, od->conn, AIM_CONN_TYPE_AUTH); 3028 aim_reqservice(od->sess, od->conn, AIM_CONN_TYPE_AUTH);
3002 } else 3029 } else
3019 GList *m = NULL; 3046 GList *m = NULL;
3020 3047
3021 m = g_list_append(m, "Set User Info"); 3048 m = g_list_append(m, "Set User Info");
3022 m = g_list_append(m, NULL); 3049 m = g_list_append(m, NULL);
3023 m = g_list_append(m, "Change Password"); 3050 m = g_list_append(m, "Change Password");
3051 m = g_list_append(m, "Format Screenname");
3024 m = g_list_append(m, "Confirm Account"); 3052 m = g_list_append(m, "Confirm Account");
3025 m = g_list_append(m, "Display Current Registered Address"); 3053 m = g_list_append(m, "Display Current Registered Address");
3026 m = g_list_append(m, "Change Current Registered Address"); 3054 m = g_list_append(m, "Change Current Registered Address");
3027 m = g_list_append(m, NULL); 3055 m = g_list_append(m, NULL);
3028 m = g_list_append(m, "Search for Buddy by Email"); 3056 m = g_list_append(m, "Search for Buddy by Email");