Mercurial > pidgin.yaz
comparison src/protocols/oscar/oscar.c @ 2703:441b84ab7f4e
[gaim-migrate @ 2716]
it's not what you think
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sat, 10 Nov 2001 01:48:17 +0000 |
parents | e80f4b4f840f |
children | fee85ed7fc3f |
comparison
equal
deleted
inserted
replaced
2702:94b4271b9567 | 2703:441b84ab7f4e |
---|---|
689 if (bosconn->fd < 0) { | 689 if (bosconn->fd < 0) { |
690 hide_login_progress(gc, _("Could Not Connect")); | 690 hide_login_progress(gc, _("Could Not Connect")); |
691 od->killme = TRUE; | 691 od->killme = TRUE; |
692 return 0; | 692 return 0; |
693 } | 693 } |
694 aim_auth_sendcookie(sess, bosconn, cookie); | 694 aim_sendcookie(sess, bosconn, cookie); |
695 gaim_input_remove(gc->inpa); | 695 gaim_input_remove(gc->inpa); |
696 return 1; | 696 return 1; |
697 } | 697 } |
698 | 698 |
699 struct pieceofcrap { | 699 struct pieceofcrap { |
1026 aim_conn_kill(sess, &tstconn); | 1026 aim_conn_kill(sess, &tstconn); |
1027 debug_printf("unable to reconnect with authorizer\n"); | 1027 debug_printf("unable to reconnect with authorizer\n"); |
1028 g_free(host); | 1028 g_free(host); |
1029 return 1; | 1029 return 1; |
1030 } | 1030 } |
1031 aim_auth_sendcookie(sess, tstconn, cookie); | 1031 aim_sendcookie(sess, tstconn, cookie); |
1032 break; | 1032 break; |
1033 case 0xd: /* ChatNav */ | 1033 case 0xd: /* ChatNav */ |
1034 tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHATNAV, NULL); | 1034 tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHATNAV, NULL); |
1035 if (tstconn == NULL) { | 1035 if (tstconn == NULL) { |
1036 debug_printf("unable to connect to chatnav server\n"); | 1036 debug_printf("unable to connect to chatnav server\n"); |
1045 aim_conn_kill(sess, &tstconn); | 1045 aim_conn_kill(sess, &tstconn); |
1046 debug_printf("unable to connect to chatnav server\n"); | 1046 debug_printf("unable to connect to chatnav server\n"); |
1047 g_free(host); | 1047 g_free(host); |
1048 return 1; | 1048 return 1; |
1049 } | 1049 } |
1050 aim_auth_sendcookie(sess, tstconn, cookie); | 1050 aim_sendcookie(sess, tstconn, cookie); |
1051 break; | 1051 break; |
1052 case 0xe: /* Chat */ | 1052 case 0xe: /* Chat */ |
1053 { | 1053 { |
1054 char *roomname; | 1054 char *roomname; |
1055 fu16_t exchange; | 1055 fu16_t exchange; |
1084 g_free(ccon->show); | 1084 g_free(ccon->show); |
1085 g_free(ccon->name); | 1085 g_free(ccon->name); |
1086 g_free(ccon); | 1086 g_free(ccon); |
1087 return 1; | 1087 return 1; |
1088 } | 1088 } |
1089 aim_auth_sendcookie(sess, tstconn, cookie); | 1089 aim_sendcookie(sess, tstconn, cookie); |
1090 debug_printf("Connected to chat room %s exchange %d\n", roomname, exchange); | 1090 debug_printf("Connected to chat room %s exchange %d\n", roomname, exchange); |
1091 } | 1091 } |
1092 break; | 1092 break; |
1093 default: /* huh? */ | 1093 default: /* huh? */ |
1094 debug_printf("got redirect for unknown service 0x%04x\n", serviceid); | 1094 debug_printf("got redirect for unknown service 0x%04x\n", serviceid); |
1901 } | 1901 } |
1902 | 1902 |
1903 static int conninitdone_bos(aim_session_t *sess, aim_frame_t *fr, ...) { | 1903 static int conninitdone_bos(aim_session_t *sess, aim_frame_t *fr, ...) { |
1904 struct gaim_connection *gc = sess->aux_data; | 1904 struct gaim_connection *gc = sess->aux_data; |
1905 | 1905 |
1906 aim_bos_reqpersonalinfo(sess, fr->conn); | 1906 aim_reqpersonalinfo(sess, fr->conn); |
1907 aim_bos_reqlocaterights(sess, fr->conn); | 1907 aim_bos_reqlocaterights(sess, fr->conn); |
1908 aim_bos_setprofile(sess, fr->conn, gc->user->user_info, NULL, gaim_caps); | 1908 aim_bos_setprofile(sess, fr->conn, gc->user->user_info, NULL, gaim_caps); |
1909 aim_bos_reqbuddyrights(sess, fr->conn); | 1909 aim_bos_reqbuddyrights(sess, fr->conn); |
1910 | 1910 |
1911 account_online(gc); | 1911 account_online(gc); |
1933 aim_clientready(sess, fr->conn); | 1933 aim_clientready(sess, fr->conn); |
1934 debug_printf("connected to admin\n"); | 1934 debug_printf("connected to admin\n"); |
1935 | 1935 |
1936 if (od->chpass) { | 1936 if (od->chpass) { |
1937 debug_printf("changing password\n"); | 1937 debug_printf("changing password\n"); |
1938 aim_auth_changepasswd(sess, fr->conn, od->newp, od->oldp); | 1938 aim_admin_changepasswd(sess, fr->conn, od->newp, od->oldp); |
1939 g_free(od->oldp); | 1939 g_free(od->oldp); |
1940 g_free(od->newp); | 1940 g_free(od->newp); |
1941 od->chpass = FALSE; | 1941 od->chpass = FALSE; |
1942 } | 1942 } |
1943 if (od->conf) { | 1943 if (od->conf) { |
1944 debug_printf("confirming account\n"); | 1944 debug_printf("confirming account\n"); |
1945 aim_auth_reqconfirm(sess, fr->conn); | 1945 aim_admin_reqconfirm(sess, fr->conn); |
1946 od->conf = FALSE; | 1946 od->conf = FALSE; |
1947 } | 1947 } |
1948 if (od->reqemail) { | 1948 if (od->reqemail) { |
1949 debug_printf("requesting email\n"); | 1949 debug_printf("requesting email\n"); |
1950 aim_auth_getinfo(sess, fr->conn, 0x0011); | 1950 aim_admin_getinfo(sess, fr->conn, 0x0011); |
1951 od->reqemail = FALSE; | 1951 od->reqemail = FALSE; |
1952 } | 1952 } |
1953 | 1953 |
1954 return 1; | 1954 return 1; |
1955 } | 1955 } |
2005 | 2005 |
2006 debug_printf("BOS rights: Max permit = %d / Max deny = %d\n", maxpermits, maxdenies); | 2006 debug_printf("BOS rights: Max permit = %d / Max deny = %d\n", maxpermits, maxdenies); |
2007 | 2007 |
2008 aim_clientready(sess, fr->conn); | 2008 aim_clientready(sess, fr->conn); |
2009 | 2009 |
2010 aim_bos_reqservice(sess, fr->conn, AIM_CONN_TYPE_CHATNAV); | 2010 aim_reqservice(sess, fr->conn, AIM_CONN_TYPE_CHATNAV); |
2011 | 2011 |
2012 return 1; | 2012 return 1; |
2013 } | 2013 } |
2014 | 2014 |
2015 static int gaim_parse_searchreply(aim_session_t *sess, aim_frame_t *fr, ...) { | 2015 static int gaim_parse_searchreply(aim_session_t *sess, aim_frame_t *fr, ...) { |
2228 | 2228 |
2229 if (gc->away) | 2229 if (gc->away) |
2230 gc->away = NULL; | 2230 gc->away = NULL; |
2231 | 2231 |
2232 if (!strcmp(state, "Online")) | 2232 if (!strcmp(state, "Online")) |
2233 aim_icq_setstatus(od->sess, od->conn, AIM_ICQ_STATE_ONLINE); | 2233 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_ONLINE); |
2234 else if (!strcmp(state, "Away")) { | 2234 else if (!strcmp(state, "Away")) { |
2235 aim_icq_setstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY); | 2235 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY); |
2236 gc->away = ""; | 2236 gc->away = ""; |
2237 } else if (!strcmp(state, "Do Not Disturb")) { | 2237 } else if (!strcmp(state, "Do Not Disturb")) { |
2238 aim_icq_setstatus(od->sess, od->conn, AIM_ICQ_STATE_DND); | 2238 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_DND); |
2239 gc->away = ""; | 2239 gc->away = ""; |
2240 } else if (!strcmp(state, "Not Available")) { | 2240 } else if (!strcmp(state, "Not Available")) { |
2241 aim_icq_setstatus(od->sess, od->conn, AIM_ICQ_STATE_NA); | 2241 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NA); |
2242 gc->away = ""; | 2242 gc->away = ""; |
2243 } else if (!strcmp(state, "Occupied")) { | 2243 } else if (!strcmp(state, "Occupied")) { |
2244 aim_icq_setstatus(od->sess, od->conn, AIM_ICQ_STATE_OCCUPIED); | 2244 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_OCCUPIED); |
2245 gc->away = ""; | 2245 gc->away = ""; |
2246 } else if (!strcmp(state, "Free For Chat")) { | 2246 } else if (!strcmp(state, "Free For Chat")) { |
2247 aim_icq_setstatus(od->sess, od->conn, AIM_ICQ_STATE_CHAT); | 2247 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_CHAT); |
2248 gc->away = ""; | 2248 gc->away = ""; |
2249 } else if (!strcmp(state, "Invisible")) { | 2249 } else if (!strcmp(state, "Invisible")) { |
2250 aim_icq_setstatus(od->sess, od->conn, AIM_ICQ_STATE_INVISIBLE); | 2250 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_INVISIBLE); |
2251 gc->away = ""; | 2251 gc->away = ""; |
2252 } else if (!strcmp(state, GAIM_AWAY_CUSTOM)) { | 2252 } else if (!strcmp(state, GAIM_AWAY_CUSTOM)) { |
2253 if (message) { | 2253 if (message) { |
2254 aim_icq_setstatus(od->sess, od->conn, AIM_ICQ_STATE_NA); | 2254 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NA); |
2255 gc->away = ""; | 2255 gc->away = ""; |
2256 } else { | 2256 } else { |
2257 aim_icq_setstatus(od->sess, od->conn, AIM_ICQ_STATE_ONLINE); | 2257 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_ONLINE); |
2258 } | 2258 } |
2259 } | 2259 } |
2260 } | 2260 } |
2261 | 2261 |
2262 static void oscar_warn(struct gaim_connection *g, char *name, int anon) { | 2262 static void oscar_warn(struct gaim_connection *g, char *name, int anon) { |
2333 } else { | 2333 } else { |
2334 /* this gets tricky */ | 2334 /* this gets tricky */ |
2335 debug_printf("chatnav does not exist, opening chatnav\n"); | 2335 debug_printf("chatnav does not exist, opening chatnav\n"); |
2336 odata->create_exchange = *exchange; | 2336 odata->create_exchange = *exchange; |
2337 odata->create_name = g_strdup(name); | 2337 odata->create_name = g_strdup(name); |
2338 aim_bos_reqservice(odata->sess, odata->conn, AIM_CONN_TYPE_CHATNAV); | 2338 aim_reqservice(odata->sess, odata->conn, AIM_CONN_TYPE_CHATNAV); |
2339 } | 2339 } |
2340 } | 2340 } |
2341 | 2341 |
2342 static void oscar_chat_invite(struct gaim_connection *g, int id, char *message, char *name) { | 2342 static void oscar_chat_invite(struct gaim_connection *g, int id, char *message, char *name) { |
2343 struct oscar_data *odata = (struct oscar_data *)g->proto_data; | 2343 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
2732 } else if (!strcmp(act, "Change Password")) { | 2732 } else if (!strcmp(act, "Change Password")) { |
2733 show_change_passwd(gc); | 2733 show_change_passwd(gc); |
2734 } else if (!strcmp(act, "Confirm Account")) { | 2734 } else if (!strcmp(act, "Confirm Account")) { |
2735 if (!conn) { | 2735 if (!conn) { |
2736 od->conf = TRUE; | 2736 od->conf = TRUE; |
2737 aim_bos_reqservice(od->sess, od->conn, AIM_CONN_TYPE_AUTH); | 2737 aim_reqservice(od->sess, od->conn, AIM_CONN_TYPE_AUTH); |
2738 } else | 2738 } else |
2739 aim_auth_reqconfirm(od->sess, conn); | 2739 aim_admin_reqconfirm(od->sess, conn); |
2740 } else if (!strcmp(act, "Change Email")) { | 2740 } else if (!strcmp(act, "Change Email")) { |
2741 } else if (!strcmp(act, "Display Current Registered Address")) { | 2741 } else if (!strcmp(act, "Display Current Registered Address")) { |
2742 if (!conn) { | 2742 if (!conn) { |
2743 od->reqemail = TRUE; | 2743 od->reqemail = TRUE; |
2744 aim_bos_reqservice(od->sess, od->conn, AIM_CONN_TYPE_AUTH); | 2744 aim_reqservice(od->sess, od->conn, AIM_CONN_TYPE_AUTH); |
2745 } else | 2745 } else |
2746 aim_auth_getinfo(od->sess, conn, 0x11); | 2746 aim_admin_getinfo(od->sess, conn, 0x11); |
2747 } else if (!strcmp(act, "Search for Buddy by Email")) { | 2747 } else if (!strcmp(act, "Search for Buddy by Email")) { |
2748 show_find_email(gc); | 2748 show_find_email(gc); |
2749 } | 2749 } |
2750 } | 2750 } |
2751 | 2751 |
2772 struct oscar_data *od = gc->proto_data; | 2772 struct oscar_data *od = gc->proto_data; |
2773 if (!aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH)) { | 2773 if (!aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH)) { |
2774 od->chpass = TRUE; | 2774 od->chpass = TRUE; |
2775 od->oldp = g_strdup(old); | 2775 od->oldp = g_strdup(old); |
2776 od->newp = g_strdup(new); | 2776 od->newp = g_strdup(new); |
2777 aim_bos_reqservice(od->sess, od->conn, AIM_CONN_TYPE_AUTH); | 2777 aim_reqservice(od->sess, od->conn, AIM_CONN_TYPE_AUTH); |
2778 } else { | 2778 } else { |
2779 aim_auth_changepasswd(od->sess, aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH), | 2779 aim_admin_changepasswd(od->sess, aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH), |
2780 new, old); | 2780 new, old); |
2781 } | 2781 } |
2782 } | 2782 } |
2783 | 2783 |
2784 static void oscar_convo_closed(struct gaim_connection *gc, char *who) | 2784 static void oscar_convo_closed(struct gaim_connection *gc, char *who) |