Changeset 673a54c for protocols/oscar
- Timestamp:
- 2009-03-12T19:33:28Z (16 years ago)
- Branches:
- master
- Children:
- fc34fb5
- Parents:
- 823de9d (diff), 9e768da (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/oscar/oscar.c
r823de9d r673a54c 91 91 GSList *oscar_chats; 92 92 93 gboolean killme ;93 gboolean killme, no_reconnect; 94 94 gboolean icq; 95 95 GSList *evilhack; … … 181 181 static int gaim_parse_auth_resp (aim_session_t *, aim_frame_t *, ...); 182 182 static int gaim_parse_login (aim_session_t *, aim_frame_t *, ...); 183 static int gaim_parse_logout (aim_session_t *, aim_frame_t *, ...); 183 184 static int gaim_handle_redirect (aim_session_t *, aim_frame_t *, ...); 184 185 static int gaim_parse_oncoming (aim_session_t *, aim_frame_t *, ...); … … 294 295 aim_rxdispatch(odata->sess); 295 296 if (odata->killme) 296 imc_logout(ic, TRUE);297 imc_logout(ic, !odata->no_reconnect); 297 298 } else { 298 299 if ((conn->type == AIM_CONN_TYPE_BOS) || … … 520 521 case 0x18: 521 522 /* connecting too frequently */ 523 od->no_reconnect = TRUE; 522 524 imcb_error(ic, _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer.")); 523 525 break; … … 572 574 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_USERINFO, gaim_parseaiminfo, 0); 573 575 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_MTN, gaim_parsemtn, 0); 576 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNERR, gaim_parse_logout, 0); 574 577 575 578 ((struct oscar_data *)ic->proto_data)->conn = bosconn; … … 747 750 748 751 aim_send_login(sess, fr->conn, ic->acc->user, ic->acc->pass, &info, key); 752 753 return 1; 754 } 755 756 static int gaim_parse_logout(aim_session_t *sess, aim_frame_t *fr, ...) { 757 struct im_connection *ic = sess->aux_data; 758 struct oscar_data *odata = ic->proto_data; 759 int code; 760 va_list ap; 761 762 va_start(ap, fr); 763 code = va_arg(ap, int); 764 va_end(ap); 765 766 imcb_error( ic, "Connection aborted by server: %s", code == 1 ? 767 "someone else logged in with your account" : 768 "unknown reason" ); 769 770 /* Tell BitlBee to disable auto_reconnect if code == 1, since that 771 means a concurrent login somewhere else. */ 772 odata->no_reconnect = code == 1; 773 774 /* DO NOT log out here! Just tell the callback to do it. */ 775 odata->killme = TRUE; 749 776 750 777 return 1; … … 1939 1966 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NORMAL); 1940 1967 1941 if (ic->away) 1942 g_free(ic->away); 1968 g_free(ic->away); 1943 1969 ic->away = NULL; 1944 1970 … … 1960 1986 static void oscar_set_away_icq(struct im_connection *ic, struct oscar_data *od, const char *state, const char *message) 1961 1987 { 1962 1988 const char *msg = NULL; 1963 1989 gboolean no_message = FALSE; 1964 1990 1965 1991 /* clean old states */ 1966 if (ic->away) { 1967 g_free(ic->away); 1968 ic->away = NULL; 1969 } 1992 g_free(ic->away); 1993 ic->away = NULL; 1970 1994 od->sess->aim_icq_state = 0; 1971 1995 1972 1996 /* if no message, then use an empty message */ 1973 1974 1975 1976 1997 if (message) { 1998 msg = message; 1999 } else { 2000 msg = ""; 1977 2001 no_message = TRUE; 1978 2002 } 1979 2003 1980 2004 if (!g_strcasecmp(state, "Online")) { … … 1982 2006 } else if (!g_strcasecmp(state, "Away")) { 1983 2007 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY); 1984 2008 ic->away = g_strdup(msg); 1985 2009 od->sess->aim_icq_state = AIM_MTYPE_AUTOAWAY; 1986 2010 } else if (!g_strcasecmp(state, "Do Not Disturb")) { 1987 2011 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY | AIM_ICQ_STATE_DND | AIM_ICQ_STATE_BUSY); 1988 2012 ic->away = g_strdup(msg); 1989 2013 od->sess->aim_icq_state = AIM_MTYPE_AUTODND; 1990 2014 } else if (!g_strcasecmp(state, "Not Available")) { 1991 2015 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_OUT | AIM_ICQ_STATE_AWAY); 1992 2016 ic->away = g_strdup(msg); 1993 2017 od->sess->aim_icq_state = AIM_MTYPE_AUTONA; 1994 2018 } else if (!g_strcasecmp(state, "Occupied")) { 1995 2019 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY | AIM_ICQ_STATE_BUSY); 1996 2020 ic->away = g_strdup(msg); 1997 2021 od->sess->aim_icq_state = AIM_MTYPE_AUTOBUSY; 1998 2022 } else if (!g_strcasecmp(state, "Free For Chat")) { 1999 2023 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_CHAT); 2000 2024 ic->away = g_strdup(msg); 2001 2025 od->sess->aim_icq_state = AIM_MTYPE_AUTOFFC; 2002 2026 } else if (!g_strcasecmp(state, "Invisible")) { 2003 2027 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_INVISIBLE); 2004 2028 ic->away = g_strdup(msg); 2005 2029 } else if (!g_strcasecmp(state, GAIM_AWAY_CUSTOM)) { 2006 2030 if (no_message) { … … 2008 2032 } else { 2009 2033 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY); 2010 2034 ic->away = g_strdup(msg); 2011 2035 od->sess->aim_icq_state = AIM_MTYPE_AUTOAWAY; 2012 2036 } … … 2020 2044 struct oscar_data *od = (struct oscar_data *)ic->proto_data; 2021 2045 2022 2046 oscar_set_away_aim(ic, od, state, message); 2023 2047 if (od->icq) 2024 2048 oscar_set_away_icq(ic, od, state, message); … … 2581 2605 } 2582 2606 2583 struct groupchat *oscar_chat_join(struct im_connection * ic, c har * room, char * nick,char * password )2607 struct groupchat *oscar_chat_join(struct im_connection * ic, const char * room, const char * nick, const char * password ) 2584 2608 { 2585 2609 struct oscar_data * od = (struct oscar_data *)ic->proto_data;
Note: See TracChangeset
for help on using the changeset viewer.