- 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. - Location:
- protocols
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/conference.c
r823de9d r673a54c 26 26 static xt_status jabber_chat_join_failed( struct im_connection *ic, struct xt_node *node, struct xt_node *orig ); 27 27 28 struct groupchat *jabber_chat_join( struct im_connection *ic, c har *room, char *nick,char *password )28 struct groupchat *jabber_chat_join( struct im_connection *ic, const char *room, const char *nick, const char *password ) 29 29 { 30 30 struct jabber_chat *jc; … … 36 36 node = xt_new_node( "x", NULL, NULL ); 37 37 xt_add_attr( node, "xmlns", XMLNS_MUC ); 38 node = jabber_make_packet( "presence", NULL, roomjid, node );39 38 if( password ) 40 39 xt_add_child( node, xt_new_node( "password", password, NULL ) ); 40 node = jabber_make_packet( "presence", NULL, roomjid, node ); 41 41 jabber_cache_add( ic, node, jabber_chat_join_failed ); 42 42 -
protocols/jabber/jabber.c
r823de9d r673a54c 425 425 } 426 426 427 static struct groupchat *jabber_chat_join_( struct im_connection *ic, c har *room, char *nick,char *password )427 static struct groupchat *jabber_chat_join_( struct im_connection *ic, const char *room, const char *nick, const char *password ) 428 428 { 429 429 if( strchr( room, '@' ) == NULL ) -
protocols/jabber/jabber.h
r823de9d r673a54c 240 240 241 241 /* conference.c */ 242 struct groupchat *jabber_chat_join( struct im_connection *ic, c har *room, char *nick,char *password );242 struct groupchat *jabber_chat_join( struct im_connection *ic, const char *room, const char *nick, const char *password ); 243 243 struct groupchat *jabber_chat_by_jid( struct im_connection *ic, const char *name ); 244 244 void jabber_chat_free( struct groupchat *c ); -
protocols/jabber/presence.c
r823de9d r673a54c 49 49 if( !( bud = jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT | GET_BUDDY_CREAT ) ) ) 50 50 { 51 if( set_getbool( &ic->irc->set, "debug" ) ) 52 imcb_log( ic, "Warning: Could not handle presence information from JID: %s", from ); 51 /* 52 imcb_log( ic, "Warning: Could not handle presence information from JID: %s", from ); 53 */ 53 54 return XT_HANDLED; 54 55 } … … 106 107 if( ( bud = jabber_buddy_by_jid( ic, from, 0 ) ) == NULL ) 107 108 { 108 if( set_getbool( &ic->irc->set, "debug" ) ) 109 imcb_log( ic, "Warning: Received presence information from unknown JID: %s", from ); 109 /* 110 imcb_log( ic, "Warning: Received presence information from unknown JID: %s", from ); 111 */ 110 112 return XT_HANDLED; 111 113 } -
protocols/nogaim.c
r823de9d r673a54c 249 249 void imcb_connected( struct im_connection *ic ) 250 250 { 251 irc_t *irc = ic->irc; 252 struct chat *c; 251 253 user_t *u; 252 254 … … 271 273 exponential backoff timer. */ 272 274 ic->acc->auto_reconnect_delay = 0; 275 276 for( c = irc->chatrooms; c; c = c->next ) 277 { 278 if( c->acc != ic->acc ) 279 continue; 280 281 if( set_getbool( &c->set, "auto_join" ) ) 282 chat_join( irc, c, NULL ); 283 } 273 284 } 274 285 … … 309 320 ic->acc->prpl->logout( ic ); 310 321 b_event_remove( ic->inpa ); 322 323 g_free( ic->away ); 324 ic->away = NULL; 311 325 312 326 u = irc->users; … … 716 730 } 717 731 718 struct groupchat *imcb_chat_new( struct im_connection *ic, c har *handle )732 struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle ) 719 733 { 720 734 struct groupchat *c; -
protocols/nogaim.h
r823de9d r673a54c 213 213 * not implement this. */ 214 214 struct groupchat * 215 (* chat_join) (struct im_connection *, c har *room, char *nick,char *password);215 (* chat_join) (struct im_connection *, const char *room, const char *nick, const char *password); 216 216 /* Change the topic, if supported. Note that BitlBee expects the IM 217 217 server to confirm the topic change with a regular topic change … … 243 243 * the account_t parameter. */ 244 244 G_MODULE_EXPORT struct im_connection *imcb_new( account_t *acc ); 245 G_MODULE_EXPORT void imc b_free( struct im_connection *ic );245 G_MODULE_EXPORT void imc_free( struct im_connection *ic ); 246 246 /* Once you're connected, you should call this function, so that the user will 247 247 * see the success. */ … … 294 294 * the user her/himself. At that point the group chat will be visible to the 295 295 * user, too. */ 296 G_MODULE_EXPORT struct groupchat *imcb_chat_new( struct im_connection *ic, c har *handle );296 G_MODULE_EXPORT struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle ); 297 297 G_MODULE_EXPORT void imcb_chat_add_buddy( struct groupchat *b, char *handle ); 298 298 /* To remove a handle from a group chat. Reason can be NULL. */ -
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; -
protocols/yahoo/yahoo.c
r823de9d r673a54c 197 197 { 198 198 struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data; 199 200 ic->away = NULL; 199 char *away; 200 201 away = NULL; 201 202 202 203 if( state && msg && g_strcasecmp( state, msg ) != 0 ) 203 204 { 204 205 yd->current_status = YAHOO_STATUS_CUSTOM; 205 ic->away = "";206 away = ""; 206 207 } 207 208 else if( state ) … … 212 213 msg = NULL; 213 214 214 ic->away = "";215 away = ""; 215 216 if( g_strcasecmp( state, "Available" ) == 0 ) 216 217 { 217 218 yd->current_status = YAHOO_STATUS_AVAILABLE; 218 ic->away = NULL;219 away = NULL; 219 220 } 220 221 else if( g_strcasecmp( state, "Be Right Back" ) == 0 ) … … 242 243 yd->current_status = YAHOO_STATUS_AVAILABLE; 243 244 244 ic->away = NULL;245 away = NULL; 245 246 } 246 247 } … … 248 249 yd->current_status = YAHOO_STATUS_AVAILABLE; 249 250 250 yahoo_set_away( yd->y2_id, yd->current_status, msg, ic->away != NULL ? 2 : 0 );251 yahoo_set_away( yd->y2_id, yd->current_status, msg, away != NULL ? 2 : 0 ); 251 252 } 252 253 … … 791 792 { 792 793 struct byahoo_conf_invitation *inv = data; 793 794 yahoo_conference_logon( inv->yid, NULL, inv->members, inv->name ); 795 imcb_chat_add_buddy( inv->c, inv->ic->acc->user ); 794 struct groupchat *b; 795 796 for( b = inv->ic->groupchats; b; b = b->next ) 797 if( b == inv->c ) 798 break; 799 800 if( b != NULL ) 801 { 802 yahoo_conference_logon( inv->yid, NULL, inv->members, inv->name ); 803 imcb_chat_add_buddy( inv->c, inv->ic->acc->user ); 804 } 805 else 806 { 807 imcb_log( inv->ic, "Duplicate/corrupted invitation to `%s'.", inv->name ); 808 } 809 796 810 g_free( inv->name ); 797 811 g_free( inv );
Note: See TracChangeset
for help on using the changeset viewer.