Changeset 673a54c for protocols


Ignore:
Timestamp:
2009-03-12T19:33:28Z (16 years ago)
Author:
Sven Moritz Hallberg <pesco@…>
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.
Message:

pretty blind try at merging in the latest trunk

Location:
protocols
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/conference.c

    r823de9d r673a54c  
    2626static xt_status jabber_chat_join_failed( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
    2727
    28 struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char *nick, char *password )
     28struct groupchat *jabber_chat_join( struct im_connection *ic, const char *room, const char *nick, const char *password )
    2929{
    3030        struct jabber_chat *jc;
     
    3636        node = xt_new_node( "x", NULL, NULL );
    3737        xt_add_attr( node, "xmlns", XMLNS_MUC );
    38         node = jabber_make_packet( "presence", NULL, roomjid, node );
    3938        if( password )
    4039                xt_add_child( node, xt_new_node( "password", password, NULL ) );
     40        node = jabber_make_packet( "presence", NULL, roomjid, node );
    4141        jabber_cache_add( ic, node, jabber_chat_join_failed );
    4242       
  • protocols/jabber/jabber.c

    r823de9d r673a54c  
    425425}
    426426
    427 static struct groupchat *jabber_chat_join_( struct im_connection *ic, char *room, char *nick, char *password )
     427static struct groupchat *jabber_chat_join_( struct im_connection *ic, const char *room, const char *nick, const char *password )
    428428{
    429429        if( strchr( room, '@' ) == NULL )
  • protocols/jabber/jabber.h

    r823de9d r673a54c  
    240240
    241241/* conference.c */
    242 struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char *nick, char *password );
     242struct groupchat *jabber_chat_join( struct im_connection *ic, const char *room, const char *nick, const char *password );
    243243struct groupchat *jabber_chat_by_jid( struct im_connection *ic, const char *name );
    244244void jabber_chat_free( struct groupchat *c );
  • protocols/jabber/presence.c

    r823de9d r673a54c  
    4949                if( !( bud = jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT | GET_BUDDY_CREAT ) ) )
    5050                {
    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                        */
    5354                        return XT_HANDLED;
    5455                }
     
    106107                if( ( bud = jabber_buddy_by_jid( ic, from, 0 ) ) == NULL )
    107108                {
    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                        */
    110112                        return XT_HANDLED;
    111113                }
  • protocols/nogaim.c

    r823de9d r673a54c  
    249249void imcb_connected( struct im_connection *ic )
    250250{
     251        irc_t *irc = ic->irc;
     252        struct chat *c;
    251253        user_t *u;
    252254       
     
    271273           exponential backoff timer. */
    272274        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        }
    273284}
    274285
     
    309320        ic->acc->prpl->logout( ic );
    310321        b_event_remove( ic->inpa );
     322       
     323        g_free( ic->away );
     324        ic->away = NULL;
    311325       
    312326        u = irc->users;
     
    716730}
    717731
    718 struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle )
     732struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle )
    719733{
    720734        struct groupchat *c;
  • protocols/nogaim.h

    r823de9d r673a54c  
    213213         * not implement this. */
    214214        struct groupchat *
    215              (* chat_join)      (struct im_connection *, char *room, char *nick, char *password);
     215             (* chat_join)      (struct im_connection *, const char *room, const char *nick, const char *password);
    216216        /* Change the topic, if supported. Note that BitlBee expects the IM
    217217           server to confirm the topic change with a regular topic change
     
    243243 * the account_t parameter. */
    244244G_MODULE_EXPORT struct im_connection *imcb_new( account_t *acc );
    245 G_MODULE_EXPORT void imcb_free( struct im_connection *ic );
     245G_MODULE_EXPORT void imc_free( struct im_connection *ic );
    246246/* Once you're connected, you should call this function, so that the user will
    247247 * see the success. */
     
    294294 *   the user her/himself. At that point the group chat will be visible to the
    295295 *   user, too. */
    296 G_MODULE_EXPORT struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle );
     296G_MODULE_EXPORT struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle );
    297297G_MODULE_EXPORT void imcb_chat_add_buddy( struct groupchat *b, char *handle );
    298298/* To remove a handle from a group chat. Reason can be NULL. */
  • protocols/oscar/oscar.c

    r823de9d r673a54c  
    9191        GSList *oscar_chats;
    9292
    93         gboolean killme;
     93        gboolean killme, no_reconnect;
    9494        gboolean icq;
    9595        GSList *evilhack;
     
    181181static int gaim_parse_auth_resp  (aim_session_t *, aim_frame_t *, ...);
    182182static int gaim_parse_login      (aim_session_t *, aim_frame_t *, ...);
     183static int gaim_parse_logout     (aim_session_t *, aim_frame_t *, ...);
    183184static int gaim_handle_redirect  (aim_session_t *, aim_frame_t *, ...);
    184185static int gaim_parse_oncoming   (aim_session_t *, aim_frame_t *, ...);
     
    294295                        aim_rxdispatch(odata->sess);
    295296                               if (odata->killme)
    296                                        imc_logout(ic, TRUE);
     297                                       imc_logout(ic, !odata->no_reconnect);
    297298                } else {
    298299                        if ((conn->type == AIM_CONN_TYPE_BOS) ||
     
    520521                case 0x18:
    521522                        /* connecting too frequently */
     523                        od->no_reconnect = TRUE;
    522524                        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."));
    523525                        break;
     
    572574        aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_USERINFO, gaim_parseaiminfo, 0);
    573575        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);
    574577
    575578        ((struct oscar_data *)ic->proto_data)->conn = bosconn;
     
    747750
    748751        aim_send_login(sess, fr->conn, ic->acc->user, ic->acc->pass, &info, key);
     752
     753        return 1;
     754}
     755
     756static 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;
    749776
    750777        return 1;
     
    19391966        aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NORMAL);
    19401967
    1941         if (ic->away)
    1942                 g_free(ic->away);
     1968        g_free(ic->away);
    19431969        ic->away = NULL;
    19441970
     
    19601986static void oscar_set_away_icq(struct im_connection *ic, struct oscar_data *od, const char *state, const char *message)
    19611987{
    1962     const char *msg = NULL;
     1988        const char *msg = NULL;
    19631989        gboolean no_message = FALSE;
    19641990
    19651991        /* 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;
    19701994        od->sess->aim_icq_state = 0;
    19711995
    19721996        /* if no message, then use an empty message */
    1973     if (message) {
    1974         msg = message;
    1975     } else {
    1976         msg = "";
     1997        if (message) {
     1998                msg = message;
     1999        } else {
     2000                msg = "";
    19772001                no_message = TRUE;
    1978     }
     2002        }
    19792003
    19802004        if (!g_strcasecmp(state, "Online")) {
     
    19822006        } else if (!g_strcasecmp(state, "Away")) {
    19832007                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY);
    1984         ic->away = g_strdup(msg);
     2008                ic->away = g_strdup(msg);
    19852009                od->sess->aim_icq_state = AIM_MTYPE_AUTOAWAY;
    19862010        } else if (!g_strcasecmp(state, "Do Not Disturb")) {
    19872011                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY | AIM_ICQ_STATE_DND | AIM_ICQ_STATE_BUSY);
    1988         ic->away = g_strdup(msg);
     2012                ic->away = g_strdup(msg);
    19892013                od->sess->aim_icq_state = AIM_MTYPE_AUTODND;
    19902014        } else if (!g_strcasecmp(state, "Not Available")) {
    19912015                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_OUT | AIM_ICQ_STATE_AWAY);
    1992         ic->away = g_strdup(msg);
     2016                ic->away = g_strdup(msg);
    19932017                od->sess->aim_icq_state = AIM_MTYPE_AUTONA;
    19942018        } else if (!g_strcasecmp(state, "Occupied")) {
    19952019                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY | AIM_ICQ_STATE_BUSY);
    1996         ic->away = g_strdup(msg);
     2020                ic->away = g_strdup(msg);
    19972021                od->sess->aim_icq_state = AIM_MTYPE_AUTOBUSY;
    19982022        } else if (!g_strcasecmp(state, "Free For Chat")) {
    19992023                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_CHAT);
    2000         ic->away = g_strdup(msg);
     2024                ic->away = g_strdup(msg);
    20012025                od->sess->aim_icq_state = AIM_MTYPE_AUTOFFC;
    20022026        } else if (!g_strcasecmp(state, "Invisible")) {
    20032027                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_INVISIBLE);
    2004         ic->away = g_strdup(msg);
     2028                ic->away = g_strdup(msg);
    20052029        } else if (!g_strcasecmp(state, GAIM_AWAY_CUSTOM)) {
    20062030                if (no_message) {
     
    20082032                } else {
    20092033                        aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY);
    2010             ic->away = g_strdup(msg);
     2034                        ic->away = g_strdup(msg);
    20112035                        od->sess->aim_icq_state = AIM_MTYPE_AUTOAWAY;
    20122036                }
     
    20202044        struct oscar_data *od = (struct oscar_data *)ic->proto_data;
    20212045
    2022     oscar_set_away_aim(ic, od, state, message);
     2046        oscar_set_away_aim(ic, od, state, message);
    20232047        if (od->icq)
    20242048                oscar_set_away_icq(ic, od, state, message);
     
    25812605}
    25822606
    2583 struct groupchat *oscar_chat_join(struct im_connection * ic, char * room, char * nick, char * password )
     2607struct groupchat *oscar_chat_join(struct im_connection * ic, const char * room, const char * nick, const char * password )
    25842608{
    25852609        struct oscar_data * od = (struct oscar_data *)ic->proto_data;
  • protocols/yahoo/yahoo.c

    r823de9d r673a54c  
    197197{
    198198        struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data;
    199        
    200         ic->away = NULL;
     199        char *away;
     200       
     201        away = NULL;
    201202       
    202203        if( state && msg && g_strcasecmp( state, msg ) != 0 )
    203204        {
    204205                yd->current_status = YAHOO_STATUS_CUSTOM;
    205                 ic->away = "";
     206                away = "";
    206207        }
    207208        else if( state )
     
    212213                msg = NULL;
    213214               
    214                 ic->away = "";
     215                away = "";
    215216                if( g_strcasecmp( state, "Available" ) == 0 )
    216217                {
    217218                        yd->current_status = YAHOO_STATUS_AVAILABLE;
    218                         ic->away = NULL;
     219                        away = NULL;
    219220                }
    220221                else if( g_strcasecmp( state, "Be Right Back" ) == 0 )
     
    242243                        yd->current_status = YAHOO_STATUS_AVAILABLE;
    243244                       
    244                         ic->away = NULL;
     245                        away = NULL;
    245246                }
    246247        }
     
    248249                yd->current_status = YAHOO_STATUS_AVAILABLE;
    249250       
    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 );
    251252}
    252253
     
    791792{
    792793        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       
    796810        g_free( inv->name );
    797811        g_free( inv );
Note: See TracChangeset for help on using the changeset viewer.