Changeset c2fb3809 for protocols


Ignore:
Timestamp:
2007-04-15T22:39:35Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
84b045d
Parents:
cd4723c
Message:

Cleaned up struct im_connection. No more username/password stuff since
it's in acc too. wants_to_die is now an argument to imc_logout().

Location:
protocols
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/io.c

    rcd4723c rc2fb3809  
    118118               
    119119                imc_error( ic, "Short write() to server" );
    120                 imc_logout( ic );
     120                imc_logout( ic, TRUE );
    121121                return FALSE;
    122122        }
     
    161161                {
    162162                        imc_error( ic, "XML stream error" );
    163                         imc_logout( ic );
     163                        imc_logout( ic, TRUE );
    164164                        return FALSE;
    165165                }
     
    205205                                                imc_error( ic, "TLS is turned on for this "
    206206                                                          "account, but is not supported by this server" );
    207                                                 imc_logout( ic );
     207                                                imc_logout( ic, FALSE );
    208208                                                return FALSE;
    209209                                        }
     
    217217                        {
    218218                                imc_error( ic, "XML stream error" );
    219                                 imc_logout( ic );
     219                                imc_logout( ic, TRUE );
    220220                                return FALSE;
    221221                        }
     
    228228               
    229229                imc_error( ic, "Error while reading from server" );
    230                 imc_logout( ic );
     230                imc_logout( ic, TRUE );
    231231                return FALSE;
    232232        }
     
    243243        {
    244244                imc_error( ic, "Could not connect to server" );
    245                 imc_logout( ic );
     245                imc_logout( ic, TRUE );
    246246                return FALSE;
    247247        }
     
    264264               
    265265                imc_error( ic, "Could not connect to server" );
    266                 imc_logout( ic );
     266                imc_logout( ic, TRUE );
    267267                return FALSE;
    268268        }
     
    275275static xt_status jabber_end_of_stream( struct xt_node *node, gpointer data )
    276276{
    277         imc_logout( data );
     277        imc_logout( data, TRUE );
    278278        return XT_ABORT;
    279279}
     
    298298                {
    299299                        imc_error( ic, "Server requires TLS connections, but TLS is turned off for this account" );
    300                         imc_logout( ic );
     300                        imc_logout( ic, FALSE );
    301301                       
    302302                        return XT_ABORT;
     
    328328                {
    329329                        imc_error( ic, "TLS is turned on for this account, but is not supported by this server" );
    330                         imc_logout( ic );
     330                        imc_logout( ic, FALSE );
    331331                       
    332332                        return XT_ABORT;
     
    429429        struct xt_node *c;
    430430        char *s, *type = NULL, *text = NULL;
     431        int allow_reconnect = TRUE;
    431432       
    432433        for( c = node->children; c; c = c->next )
     
    453454        {
    454455                imc_error( ic, "Unknown stream error reported by server" );
    455                 imc_logout( ic );
     456                imc_logout( ic, allow_reconnect );
    456457                return XT_ABORT;
    457458        }
     
    463464        {
    464465                imc_error( ic, "Account and resource used from a different location" );
    465                 ic->wants_to_die = TRUE;
     466                allow_reconnect = FALSE;
    466467        }
    467468        else
     
    470471        }
    471472       
    472         imc_logout( ic );
     473        imc_logout( ic, allow_reconnect );
    473474       
    474475        return XT_ABORT;
  • protocols/jabber/iq.c

    rcd4723c rc2fb3809  
    4040        {
    4141                imc_error( ic, "Received IQ packet without type." );
    42                 imc_logout( ic );
     42                imc_logout( ic, TRUE );
    4343                return XT_ABORT;
    4444        }
     
    220220        {
    221221                imc_log( ic, "WARNING: Received incomplete IQ packet while authenticating" );
    222                 imc_logout( ic );
     222                imc_logout( ic, FALSE );
    223223                return XT_HANDLED;
    224224        }
     
    259259               
    260260                imc_error( ic, "Can't find suitable authentication method" );
    261                 imc_logout( ic );
     261                imc_logout( ic, FALSE );
    262262                return XT_ABORT;
    263263        }
     
    278278        {
    279279                imc_log( ic, "WARNING: Received incomplete IQ packet while authenticating" );
    280                 imc_logout( ic );
     280                imc_logout( ic, FALSE );
    281281                return XT_HANDLED;
    282282        }
     
    285285        {
    286286                imc_error( ic, "Authentication failure" );
    287                 imc_logout( ic );
     287                imc_logout( ic, FALSE );
    288288                return XT_ABORT;
    289289        }
  • protocols/jabber/jabber.c

    rcd4723c rc2fb3809  
    7373        {
    7474                imc_error( ic, "Incomplete account name (format it like <username@jabberserver.name>)" );
    75                 imc_logout( ic );
     75                imc_logout( ic, FALSE );
    7676                return;
    7777        }
     
    166166                imc_log( ic, "Incorrect port number, must be in the %d-%d range",
    167167                               JABBER_PORT_MIN, JABBER_PORT_MAX );
    168                 imc_logout( ic );
     168                imc_logout( ic, FALSE );
    169169                return;
    170170        }
     
    187187        {
    188188                imc_error( ic, "Could not connect to server" );
    189                 imc_logout( ic );
     189                imc_logout( ic, TRUE );
    190190        }
    191191}
  • protocols/jabber/sasl.c

    rcd4723c rc2fb3809  
    4545        if( !s || strcmp( s, XMLNS_SASL ) != 0 )
    4646        {
    47                 imc_logout( ic );
     47                imc_log( ic, "Stream error while authenticating" );
     48                imc_logout( ic, FALSE );
    4849                return XT_ABORT;
    4950        }
     
    6364        {
    6465                imc_error( ic, "No known SASL authentication schemes supported" );
    65                 imc_logout( ic );
     66                imc_logout( ic, FALSE );
    6667                return XT_ABORT;
    6768        }
     
    280281error:
    281282        imc_error( ic, "Incorrect SASL challenge received" );
    282         imc_logout( ic );
     283        imc_logout( ic, FALSE );
    283284
    284285silent_error:
     
    303304        if( !s || strcmp( s, XMLNS_SASL ) != 0 )
    304305        {
    305                 imc_logout( ic );
     306                imc_log( ic, "Stream error while authenticating" );
     307                imc_logout( ic, FALSE );
    306308                return XT_ABORT;
    307309        }
     
    315317        {
    316318                imc_error( ic, "Authentication failure" );
    317                 imc_logout( ic );
     319                imc_logout( ic, FALSE );
    318320                return XT_ABORT;
    319321        }
  • protocols/msn/msn.c

    rcd4723c rc2fb3809  
    4848        {
    4949                imc_error( ic, "Invalid account name" );
    50                 imc_logout( ic );
     50                imc_logout( ic, FALSE );
    5151                return;
    5252        }
     
    5858        {
    5959                imc_error( ic, "Could not connect to server" );
    60                 imc_logout( ic );
     60                imc_logout( ic, TRUE );
    6161                return;
    6262        }
     
    379379        fn = msn_http_encode( value );
    380380       
    381         g_snprintf( buf, sizeof( buf ), "REA %d %s %s\r\n", ++md->trId, ic->username, fn );
     381        g_snprintf( buf, sizeof( buf ), "REA %d %s %s\r\n", ++md->trId, ic->acc->user, fn );
    382382        msn_write( ic, buf, strlen( buf ) );
    383383        g_free( fn );
  • protocols/msn/msn_util.c

    rcd4723c rc2fb3809  
    3737        {
    3838                imc_error( ic, "Short write() to main server" );
    39                 imc_logout( ic );
     39                imc_logout( ic, TRUE );
    4040                return( 0 );
    4141        }
  • protocols/msn/ns.c

    rcd4723c rc2fb3809  
    4848        {
    4949                imc_error( ic, "Could not connect to server" );
    50                 imc_logout( ic );
     50                imc_logout( ic, TRUE );
    5151                return FALSE;
    5252        }
     
    9090        {
    9191                imc_error( ic, "Error while reading from server" );
    92                 imc_logout( ic );
     92                imc_logout( ic, TRUE );
    9393               
    9494                return FALSE;
     
    115115                {
    116116                        imc_error( ic, "Unsupported protocol" );
    117                         imc_logout( ic );
     117                        imc_logout( ic, FALSE );
    118118                        return( 0 );
    119119                }
    120120               
    121121                g_snprintf( buf, sizeof( buf ), "CVR %d 0x0409 mac 10.2.0 ppc macmsgs 3.5.1 macmsgs %s\r\n",
    122                                                 ++md->trId, ic->username );
     122                                                ++md->trId, ic->acc->user );
    123123                return( msn_write( ic, buf, strlen( buf ) ) );
    124124        }
     
    126126        {
    127127                /* We don't give a damn about the information we just received */
    128                 g_snprintf( buf, sizeof( buf ), "USR %d TWN I %s\r\n", ++md->trId, ic->username );
     128                g_snprintf( buf, sizeof( buf ), "USR %d TWN I %s\r\n", ++md->trId, ic->acc->user );
    129129                return( msn_write( ic, buf, strlen( buf ) ) );
    130130        }
     
    144144                        {
    145145                                imc_error( ic, "Syntax error" );
    146                                 imc_logout( ic );
     146                                imc_logout( ic, TRUE );
    147147                                return( 0 );
    148148                        }
     
    163163                        {
    164164                                imc_error( ic, "Syntax error" );
    165                                 imc_logout( ic );
     165                                imc_logout( ic, TRUE );
    166166                                return( 0 );
    167167                        }
     
    173173                        {
    174174                                imc_error( ic, "Unknown authentication method for switchboard" );
    175                                 imc_logout( ic );
     175                                imc_logout( ic, TRUE );
    176176                                return( 0 );
    177177                        }
     
    205205                {
    206206                        imc_error( ic, "Syntax error" );
    207                         imc_logout( ic );
     207                        imc_logout( ic, TRUE );
    208208                        return( 0 );
    209209                }
     
    214214                {
    215215                        /* Time for some Passport black magic... */
    216                         if( !passport_get_id( msn_auth_got_passport_id, ic, ic->username, ic->password, cmd[4] ) )
     216                        if( !passport_get_id( msn_auth_got_passport_id, ic, ic->acc->user, ic->acc->pass, cmd[4] ) )
    217217                        {
    218218                                imc_error( ic, "Error while contacting Passport server" );
    219                                 imc_logout( ic );
     219                                imc_logout( ic, TRUE );
    220220                                return( 0 );
    221221                        }
     
    244244                {
    245245                        imc_error( ic, "Unknown authentication type" );
    246                         imc_logout( ic );
     246                        imc_logout( ic, FALSE );
    247247                        return( 0 );
    248248                }
     
    253253                {
    254254                        imc_error( ic, "Syntax error" );
    255                         imc_logout( ic );
     255                        imc_logout( ic, TRUE );
    256256                        return( 0 );
    257257                }
     
    262262                {
    263263                        imc_error( ic, "Syntax error" );
    264                         imc_logout( ic );
     264                        imc_logout( ic, TRUE );
    265265                        return( 0 );
    266266                }
     
    293293                {
    294294                        imc_error( ic, "Syntax error" );
    295                         imc_logout( ic );
     295                        imc_logout( ic, TRUE );
    296296                        return( 0 );
    297297                }
     
    345345                {
    346346                        imc_error( ic, "Syntax error" );
    347                         imc_logout( ic );
     347                        imc_logout( ic, TRUE );
    348348                        return( 0 );
    349349                }
     
    364364                {
    365365                        imc_error( ic, "Syntax error" );
    366                         imc_logout( ic );
     366                        imc_logout( ic, TRUE );
    367367                        return( 0 );
    368368                }
     
    386386                {
    387387                        imc_error( ic, "Syntax error" );
    388                         imc_logout( ic );
     388                        imc_logout( ic, TRUE );
    389389                        return( 0 );
    390390                }
     
    414414                {
    415415                        imc_error( ic, "Syntax error" );
    416                         imc_logout( ic );
     416                        imc_logout( ic, TRUE );
    417417                        return( 0 );
    418418                }
     
    439439                {
    440440                        imc_error( ic, "Syntax error" );
    441                         imc_logout( ic );
     441                        imc_logout( ic, TRUE );
    442442                        return( 0 );
    443443                }
     
    449449                {
    450450                        imc_error( ic, "Syntax error" );
    451                         imc_logout( ic );
     451                        imc_logout( ic, TRUE );
    452452                        return( 0 );
    453453                }
     
    459459                {
    460460                        imc_error( ic, "Unknown authentication method for switchboard" );
    461                         imc_logout( ic );
     461                        imc_logout( ic, TRUE );
    462462                        return( 0 );
    463463                }
     
    479479                        {
    480480                                imc_error( ic, "Syntax error" );
    481                                 imc_logout( ic );
     481                                imc_logout( ic, TRUE );
    482482                                return( 0 );
    483483                        }
     
    497497        else if( strcmp( cmd[0], "OUT" ) == 0 )
    498498        {
     499                int allow_reconnect = TRUE;
     500               
    499501                if( cmd[1] && strcmp( cmd[1], "OTH" ) == 0 )
    500502                {
    501503                        imc_error( ic, "Someone else logged in with your account" );
    502                         ic->wants_to_die = 1;
     504                        allow_reconnect = FALSE;
    503505                }
    504506                else if( cmd[1] && strcmp( cmd[1], "SSD" ) == 0 )
     
    511513                }
    512514               
    513                 imc_logout( ic );
     515                imc_logout( ic, allow_reconnect );
    514516                return( 0 );
    515517        }
     
    519521                {
    520522                        imc_error( ic, "Syntax error" );
    521                         imc_logout( ic );
    522                         return( 0 );
    523                 }
    524                
    525                 if( g_strcasecmp( cmd[3], ic->username ) == 0 )
     523                        imc_logout( ic, TRUE );
     524                        return( 0 );
     525                }
     526               
     527                if( g_strcasecmp( cmd[3], ic->acc->user ) == 0 )
    526528                {
    527529                        set_t *s;
     
    553555                {
    554556                        imc_error( ic, "Syntax error" );
    555                         imc_logout( ic );
     557                        imc_logout( ic, TRUE );
    556558                        return( 0 );
    557559                }
     
    566568                if( err->flags & STATUS_FATAL )
    567569                {
    568                         imc_logout( ic );
     570                        imc_logout( ic, TRUE );
    569571                        return( 0 );
    570572                }
     
    673675                imc_error( ic, "Error during Passport authentication (%s)",
    674676                               rep->error_string ? rep->error_string : "Unknown error" );
    675                 imc_logout( ic );
     677                imc_logout( ic, TRUE );
    676678        }
    677679        else
  • protocols/msn/sb.c

    rcd4723c rc2fb3809  
    142142                else
    143143                {
    144                         i = strlen( MSN_TYPING_HEADERS ) + strlen( sb->ic->username );
     144                        i = strlen( MSN_TYPING_HEADERS ) + strlen( sb->ic->acc->user );
    145145                        buf = g_new0( char, i );
    146                         i = g_snprintf( buf, i, MSN_TYPING_HEADERS, sb->ic->username );
     146                        i = g_snprintf( buf, i, MSN_TYPING_HEADERS, sb->ic->acc->user );
    147147                }
    148148               
     
    188188        /* Populate the channel. */
    189189        if( sb->who ) add_chat_buddy( sb->chat, sb->who );
    190         add_chat_buddy( sb->chat, ic->username );
     190        add_chat_buddy( sb->chat, ic->acc->user );
    191191       
    192192        /* And make sure the switchboard doesn't look like a regular chat anymore. */
     
    280280       
    281281        if( sb->session == MSN_SB_NEW )
    282                 g_snprintf( buf, sizeof( buf ), "USR %d %s %s\r\n", ++sb->trId, ic->username, sb->key );
     282                g_snprintf( buf, sizeof( buf ), "USR %d %s %s\r\n", ++sb->trId, ic->acc->user, sb->key );
    283283        else
    284                 g_snprintf( buf, sizeof( buf ), "ANS %d %s %s %d\r\n", ++sb->trId, ic->username, sb->key, sb->session );
     284                g_snprintf( buf, sizeof( buf ), "ANS %d %s %s %d\r\n", ++sb->trId, ic->acc->user, sb->key, sb->session );
    285285       
    286286        if( msn_sb_write( sb, buf, strlen( buf ) ) )
     
    322322        {
    323323                imc_error( ic, "Received an XFR from a switchboard server, unable to comply! This is likely to be a bug, please report it!" );
    324                 imc_logout( ic );
     324                imc_logout( ic, TRUE );
    325325                return( 0 );
    326326        }
     
    384384                        if( num == tot )
    385385                        {
    386                                 add_chat_buddy( sb->chat, ic->username );
     386                                add_chat_buddy( sb->chat, ic->acc->user );
    387387                        }
    388388                }
     
    537537                else if( err->flags & STATUS_FATAL )
    538538                {
    539                         imc_logout( ic );
     539                        imc_logout( ic, TRUE );
    540540                        return 0;
    541541                }
  • protocols/nogaim.c

    rcd4723c rc2fb3809  
    151151        ic = g_new0( struct im_connection, 1 );
    152152       
    153         /* Maybe we should get rid of this memory waste later. ;-) */
    154         g_snprintf( ic->username, sizeof( ic->username ), "%s", acc->user );
    155         g_snprintf( ic->password, sizeof( ic->password ), "%s", acc->pass );
    156        
    157153        ic->irc = acc->irc;
    158154        ic->acc = acc;
     
    201197        /* If we found one, include the screenname in the message. */
    202198        if( a )
    203                 irc_usermsg( ic->irc, "%s(%s) - %s", ic->acc->prpl->name, ic->username, text );
     199                irc_usermsg( ic->irc, "%s(%s) - %s", ic->acc->prpl->name, ic->acc->user, text );
    204200        else
    205201                irc_usermsg( ic->irc, "%s - %s", ic->acc->prpl->name, text );
     
    291287}
    292288
    293 void imc_logout( struct im_connection *ic )
     289void imc_logout( struct im_connection *ic, int allow_reconnect )
    294290{
    295291        irc_t *irc = ic->irc;
     
    333329                /* Uhm... This is very sick. */
    334330        }
    335         else if( !ic->wants_to_die && set_getbool( &irc->set, "auto_reconnect" ) &&
     331        else if( allow_reconnect && set_getbool( &irc->set, "auto_reconnect" ) &&
    336332                 set_getbool( &a->set, "auto_reconnect" ) )
    337333        {
     
    436432       
    437433        return( b );
    438 }
    439 
    440 void signoff_blocked( struct im_connection *ic )
    441 {
    442         return; /* Make all blocked users look invisible (TODO?) */
    443434}
    444435
     
    730721       
    731722        /* Gaim sends own messages through this too. IRC doesn't want this, so kill them */
    732         if( g_strcasecmp( who, ic->username ) == 0 )
     723        if( g_strcasecmp( who, ic->acc->user ) == 0 )
    733724                return;
    734725       
     
    781772       
    782773        /* It might be yourself! */
    783         if( b->ic->acc->prpl->handle_cmp( handle, b->ic->username ) == 0 )
     774        if( b->ic->acc->prpl->handle_cmp( handle, b->ic->acc->user ) == 0 )
    784775        {
    785776                u = user_find( b->ic->irc, b->ic->irc->nick );
     
    815806       
    816807        /* It might be yourself! */
    817         if( g_strcasecmp( handle, b->ic->username ) == 0 )
     808        if( g_strcasecmp( handle, b->ic->acc->user ) == 0 )
    818809        {
    819810                u = user_find( b->ic->irc, b->ic->irc->nick );
     
    958949{
    959950        char *buf = NULL;
    960         int st;
    961951       
    962952        if( ( c->ic->flags & OPT_CONN_HTML ) && ( g_strncasecmp( msg, "<html>", 6 ) != 0 ) )
  • protocols/nogaim.h

    rcd4723c rc2fb3809  
    8080        int permdeny;
    8181       
    82         char username[64];
    8382        char displayname[128];
    84         char password[32];
    85        
    8683        char *away;
    8784       
    8885        int evil;
    89         gboolean wants_to_die; /* defaults to FALSE */
    9086       
    9187        /* BitlBee */
     
    211207G_MODULE_EXPORT void imc_error( struct im_connection *ic, char *format, ... );
    212208G_MODULE_EXPORT void imc_connected( struct im_connection *ic );
    213 G_MODULE_EXPORT void imc_logout( struct im_connection *ic );
     209G_MODULE_EXPORT void imc_logout( struct im_connection *ic, int allow_reconnect );
    214210
    215211/* dialogs.c */
  • protocols/oscar/oscar.c

    rcd4723c rc2fb3809  
    263263                        aim_rxdispatch(odata->sess);
    264264                               if (odata->killme)
    265                                        imc_logout(ic);
     265                                       imc_logout(ic, TRUE);
    266266                } else {
    267267                        if ((conn->type == AIM_CONN_TYPE_BOS) ||
    268268                                   !(aim_getconn_type(odata->sess, AIM_CONN_TYPE_BOS))) {
    269269                                imc_error(ic, _("Disconnected."));
    270                                 imc_logout(ic);
     270                                imc_logout(ic, TRUE);
    271271                        } else if (conn->type == AIM_CONN_TYPE_CHAT) {
    272272                                struct chat_connection *c = find_oscar_chat_by_conn(ic, conn);
     
    326326        if (source < 0) {
    327327                imc_error(ic, _("Couldn't connect to host"));
    328                 imc_logout(ic);
     328                imc_logout(ic, TRUE);
    329329                return FALSE;
    330330        }
     
    361361                   We don't do those anymore, but let's stick with it, just in case
    362362                   it accidentally fixes something else too... </bitlbee> */
    363                 ic->password[8] = 0;
     363                /* ic->acc->pass[8] = 0;
     364                   Not touching this anymore now that it belongs to account_t!
     365                   Let's hope nothing will break. ;-) */
    364366        } else {
    365367                ic->flags |= OPT_CONN_HTML;
     
    379381        if (conn == NULL) {
    380382                imc_error(ic, _("Unable to login to AIM"));
    381                 imc_logout(ic);
     383                imc_logout(ic, TRUE);
    382384                return;
    383385        }
     
    385387        if (acc->server == NULL) {
    386388                imc_error(ic, "No servername specified");
    387                 imc_logout(ic);
     389                imc_logout(ic, FALSE);
    388390                return;
    389391        }
     
    394396        }
    395397       
    396         imc_log(ic, _("Signon: %s"), ic->username);
     398        imc_log(ic, _("Signon: %s"), ic->acc->user);
    397399
    398400        aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0);
     
    403405        if (conn->fd < 0) {
    404406                imc_error(ic, _("Couldn't connect to host"));
    405                 imc_logout(ic);
     407                imc_logout(ic, TRUE);
    406408                return;
    407409        }
    408         aim_request_login(sess, conn, ic->username);
     410        aim_request_login(sess, conn, ic->acc->user);
    409411}
    410412
     
    463465        if (source < 0) {
    464466                imc_error(ic, _("Could Not Connect"));
    465                 imc_logout(ic);
     467                imc_logout(ic, TRUE);
    466468                return FALSE;
    467469        }
     
    728730        va_end(ap);
    729731
    730         aim_send_login(sess, fr->conn, ic->username, ic->password, &info, key);
     732        aim_send_login(sess, fr->conn, ic->acc->user, ic->acc->pass, &info, key);
    731733
    732734        return 1;
     
    10131015                signon = time(NULL) - info->sessionlen;
    10141016
    1015         tmp = g_strdup(normalize(ic->username));
     1017        tmp = g_strdup(normalize(ic->acc->user));
    10161018        if (!strcmp(tmp, normalize(info->sn)))
    10171019                g_snprintf(ic->displayname, sizeof(ic->displayname), "%s", info->sn);
     
    21362138                switch(ic->permdeny) {
    21372139                case 1:
    2138                         aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_DENYADD, ic->username);
     2140                        aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_DENYADD, ic->acc->user);
    21392141                        break;
    21402142                case 2:
    2141                         aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_PERMITADD, ic->username);
     2143                        aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_PERMITADD, ic->acc->user);
    21422144                        break;
    21432145                case 3:
     
    21622164                        break;
    21632165                }
    2164                 signoff_blocked(ic);
    21652166        } else {
    21662167                if (od->sess->ssi.received_data)
     
    25842585        char * chatname;
    25852586       
    2586         chatname = g_strdup_printf("%s%d", ic->username, chat_id++);
     2587        chatname = g_strdup_printf("%s%d", ic->acc->user, chat_id++);
    25872588 
    25882589        ret = oscar_chat_join(ic, chatname);
  • protocols/yahoo/yahoo.c

    rcd4723c rc2fb3809  
    361361        YList *members;
    362362       
    363         roomname = g_new0( char, strlen( ic->username ) + 16 );
    364         g_snprintf( roomname, strlen( ic->username ) + 16, "%s-Bee-%d", ic->username, byahoo_chat_id );
     363        roomname = g_strdup_printf( "%s-Bee-%d", ic->acc->user, byahoo_chat_id );
    365364       
    366365        c = serv_got_joined_chat( ic, roomname );
    367         add_chat_buddy( c, ic->username );
     366        add_chat_buddy( c, ic->acc->user );
    368367       
    369368        /* FIXME: Free this thing when the chat's destroyed. We can't *always*
     
    518517        {
    519518                char *errstr;
     519                int allow_reconnect = TRUE;
    520520               
    521521                yd->logged_in = FALSE;
     
    530530                {
    531531                        errstr = "Logged in on a different machine or device";
    532                         ic->wants_to_die = TRUE;
     532                        allow_reconnect = FALSE;
    533533                }
    534534                else if( succ == YAHOO_LOGIN_SOCK )
     
    542542                        imc_error( ic, "Error %d (%s)", succ, errstr );
    543543               
    544                 imc_logout( ic );
     544                imc_logout( ic, allow_reconnect );
    545545        }
    546546}
     
    642642       
    643643        if( fatal )
    644                 imc_logout( ic );
     644                imc_logout( ic, TRUE );
    645645}
    646646
     
    768768{
    769769        yahoo_conference_logon( inv->yid, NULL, inv->members, inv->name );
    770         add_chat_buddy( inv->c, inv->ic->username );
     770        add_chat_buddy( inv->c, inv->ic->acc->user );
    771771        g_free( inv->name );
    772772        g_free( inv );
     
    798798       
    799799        for( m = members; m; m = m->next )
    800                 if( g_strcasecmp( m->data, ic->username ) != 0 )
     800                if( g_strcasecmp( m->data, ic->acc->user ) != 0 )
    801801                        add_chat_buddy( inv->c, m->data );
    802802       
Note: See TracChangeset for help on using the changeset viewer.