From: Rob F. <rob...@us...> - 2002-02-23 22:50:46
|
Update of /cvsroot/gaim/gaim/src/protocols/oscar In directory usw-pr-cvs1:/tmp/cvs-serv13638/protocols/oscar Modified Files: admin.c aim.h info.c oscar.c Log Message: I'll never tell... Index: admin.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/admin.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- admin.c 10 Nov 2001 01:48:17 -0000 1.4 +++ admin.c 23 Feb 2002 22:50:43 -0000 1.5 @@ -173,3 +173,25 @@ return 0; } +faim_export int aim_admin_setnick(aim_session_t *sess, aim_conn_t *conn, const char *newnick) +{ + aim_frame_t *tx; + aim_snacid_t snacid; + aim_tlvlist_t *tl = NULL; + + if (!(tx = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+2+2+strlen(newnick)))) + return -ENOMEM; + + snacid = aim_cachesnac(sess, 0x0007, 0x0004, 0x0000, NULL, 0); + aim_putsnac(&tx->data, 0x0007, 0x0004, 0x0000, snacid); + + aim_addtlvtochain_raw(&tl, 0x0001, strlen(newnick), newnick); + + aim_writetlvchain(&tx->data, &tl); + aim_freetlvchain(&tl); + + aim_tx_enqueue(sess, tx); + + + return 0; +} Index: aim.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/aim.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- aim.h 1 Jan 2002 09:49:04 -0000 1.29 +++ aim.h 23 Feb 2002 22:50:43 -0000 1.30 @@ -841,7 +841,7 @@ #define AIM_CAPS_SENDBUDDYLIST 0x00000100 #define AIM_CAPS_GAMES2 0x00000200 #define AIM_CAPS_ICQ 0x00000400 -#define AIM_CAPS_ABINTERNAL 0x00000800 +#define AIM_CAPS_APINFO 0x00000800 #define AIM_CAPS_ICQRTF 0x00001000 #define AIM_CAPS_EMPTY 0x00002000 #define AIM_CAPS_ICQSERVERRELAY 0x00004000 @@ -938,6 +938,7 @@ faim_export int aim_admin_reqconfirm(aim_session_t *sess, aim_conn_t *conn); faim_export int aim_admin_getinfo(aim_session_t *sess, aim_conn_t *conn, fu16_t info); faim_export int aim_admin_setemail(aim_session_t *sess, aim_conn_t *conn, const char *newemail); +faim_export int aim_admin_setnick(aim_session_t *sess, aim_conn_t *conn, const char *newnick); /* aim_buddylist.c */ faim_export int aim_add_buddy(aim_session_t *, aim_conn_t *, const char *); Index: info.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/info.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- info.c 1 Jan 2002 09:49:04 -0000 1.12 +++ info.c 23 Feb 2002 22:50:43 -0000 1.13 @@ -190,10 +190,6 @@ {0x09, 0x46, 0x13, 0x4b, 0x4c, 0x7f, 0x11, 0xd1, 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, - {AIM_CAPS_ABINTERNAL, - {0x09, 0x46, 0x13, 0x4f, 0x4c, 0x7f, 0x11, 0xd1, - 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, - {AIM_CAPS_ICQRTF, {0x97, 0xb1, 0x27, 0x51, 0x24, 0x3c, 0x43, 0x34, 0xad, 0x22, 0xd6, 0xab, 0xf7, 0x3f, 0x14, 0x92}}, @@ -209,6 +205,13 @@ {AIM_CAPS_TRILLIANCRYPT, {0xf2, 0xe7, 0xc7, 0xf4, 0xfe, 0xad, 0x4d, 0xfb, 0xb2, 0x35, 0x36, 0x79, 0x8b, 0xdf, 0x00, 0x00}}, + + {AIM_CAPS_APINFO, + {0xAA, 0x4A, 0x32, 0xB5, + 0xF8, 0x84, + 0x48, 0xc6, + 0xA3, 0xD7, + 0x8C, 0x50, 0x97, 0x19, 0xFD, 0x5B}}, {AIM_CAPS_LAST} }; Index: oscar.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/oscar.c,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- oscar.c 30 Jan 2002 22:30:15 -0000 1.95 +++ oscar.c 23 Feb 2002 22:50:43 -0000 1.96 @@ -88,6 +88,8 @@ gboolean reqemail; gboolean setemail; char *email; + gboolean setnick; + char *newsn; gboolean chpass; char *oldp; char *newp; @@ -2073,6 +2075,13 @@ od->newp = NULL; od->chpass = FALSE; } + if (od->setnick) { + debug_printf("formatting screenname\n"); + aim_admin_setnick(sess, fr->conn, od->newsn); + g_free(od->newsn); + od->newsn = NULL; + od->setnick = FALSE; + } if (od->conf) { debug_printf("confirming account\n"); aim_admin_reqconfirm(sess, fr->conn); @@ -2986,6 +2995,21 @@ } } +static void oscar_format_screenname(struct gaim_connection *gc, char *nick) { + struct oscar_data *od = gc->proto_data; + if (!strcmp(normalize(nick), gc->username)) { + if (!aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH)) { + od->setnick = TRUE; + od->newsn = g_strdup(nick); + aim_reqservice(od->sess, od->conn, AIM_CONN_TYPE_AUTH); + } else { + aim_admin_setnick(od->sess, aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH), nick); + } + } else { + do_error_dialog("The new formatting is invalid.", "Gaim"); + } +} + static void oscar_do_action(struct gaim_connection *gc, char *act) { struct oscar_data *od = gc->proto_data; @@ -2995,6 +3019,9 @@ show_set_info(gc); } else if (!strcmp(act, "Change Password")) { show_change_passwd(gc); + } else if (!strcmp(act, "Format Screenname")) { + do_prompt_dialog("New screenname formatting:", + gc->displayname, gc, oscar_format_screenname, NULL); } else if (!strcmp(act, "Confirm Account")) { if (!conn) { od->conf = TRUE; @@ -3021,6 +3048,7 @@ m = g_list_append(m, "Set User Info"); m = g_list_append(m, NULL); m = g_list_append(m, "Change Password"); + m = g_list_append(m, "Format Screenname"); m = g_list_append(m, "Confirm Account"); m = g_list_append(m, "Display Current Registered Address"); m = g_list_append(m, "Change Current Registered Address"); |