Ignore:
Timestamp:
2007-03-28T05:53:11Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
0da65d5
Parents:
723e611
Message:

Preparing for Jabber conference room support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.c

    r723e611 rfa29d093  
    682682}
    683683
    684 void serv_got_chat_left( struct gaim_connection *gc, int id )
    685 {
    686         struct conversation *c, *l = NULL;
     684void serv_got_chat_left( struct conversation *c )
     685{
     686        struct gaim_connection *gc = c->gc;
     687        struct conversation *l = NULL;
    687688        GList *ir;
    688689       
    689690        if( set_getbool( &gc->irc->set, "debug" ) )
    690                 serv_got_crap( gc, "You were removed from conversation %d", (int) id );
    691        
    692         for( c = gc->conversations; c && c->id != id; c = (l=c)->next );
     691                serv_got_crap( gc, "You were removed from conversation 0x%x", (int) c );
    693692       
    694693        if( c )
     
    720719}
    721720
    722 void serv_got_chat_in( struct gaim_connection *gc, int id, char *who, int whisper, char *msg, time_t mtime )
    723 {
    724         struct conversation *c;
     721void serv_got_chat_in( struct conversation *c, char *who, int whisper, char *msg, time_t mtime )
     722{
     723        struct gaim_connection *gc = c->gc;
    725724        user_t *u;
    726725       
     
    730729       
    731730        u = user_findhandle( gc, who );
    732         for( c = gc->conversations; c && c->id != id; c = c->next );
    733731       
    734732        if( ( g_strcasecmp( set_getstr( &gc->irc->set, "strip_html" ), "always" ) == 0 ) ||
     
    739737                irc_privmsg( gc->irc, u, "PRIVMSG", c->channel, "", msg );
    740738        else
    741                 serv_got_crap( gc, "Message from/to conversation %s@%d (unknown conv/user): %s", who, id, msg );
    742 }
    743 
    744 struct conversation *serv_got_joined_chat( struct gaim_connection *gc, int id, char *handle )
     739                serv_got_crap( gc, "Message from/to conversation %s@0x%x (unknown conv/user): %s", who, (int) c, msg );
     740}
     741
     742struct conversation *serv_got_joined_chat( struct gaim_connection *gc, char *handle )
    745743{
    746744        struct conversation *c;
    747         char *s;
    748745       
    749746        /* This one just creates the conversation structure, user won't see anything yet */
     
    755752        }
    756753        else
    757                 gc->conversations = c = g_new0( struct conversation, 1);
    758        
    759         c->id = id;
     754                gc->conversations = c = g_new0( struct conversation, 1 );
     755       
    760756        c->gc = gc;
    761757        c->title = g_strdup( handle );
    762        
    763         s = g_new( char, 16 );
    764         sprintf( s, "&chat_%03d", gc->irc->c_id++ );
    765         c->channel = g_strdup( s );
    766         g_free( s );
     758        c->channel = g_strdup_printf( "&chat_%03d", gc->irc->c_id++ );
    767759       
    768760        if( set_getbool( &gc->irc->set, "debug" ) )
    769                 serv_got_crap( gc, "Creating new conversation: (id=%d,handle=%s)", id, handle );
    770        
    771         return( c );
     761                serv_got_crap( gc, "Creating new conversation: (id=0x%x,handle=%s)", (int) c, handle );
     762       
     763        return c;
    772764}
    773765
     
    781773       
    782774        if( set_getbool( &b->gc->irc->set, "debug" ) )
    783                 serv_got_crap( b->gc, "User %s added to conversation %d", handle, b->id );
     775                serv_got_crap( b->gc, "User %s added to conversation 0x%x", handle, (int) b );
    784776       
    785777        /* It might be yourself! */
     
    815807       
    816808        if( set_getbool( &b->gc->irc->set, "debug" ) )
    817                 serv_got_crap( b->gc, "User %s removed from conversation %d (%s)", handle, b->id, reason ? reason : "" );
     809                serv_got_crap( b->gc, "User %s removed from conversation 0x%x (%s)", handle, (int) b, reason ? reason : "" );
    818810       
    819811        /* It might be yourself! */
     
    858850/* Misc. BitlBee stuff which shouldn't really be here */
    859851
    860 struct conversation *conv_findchannel( char *channel )
     852struct conversation *chat_by_channel( char *channel )
    861853{
    862854        struct gaim_connection *gc;
     
    870862                for( c = gc->conversations; c && g_strcasecmp( c->channel, channel ) != 0; c = c->next );
    871863                if( c )
    872                         return( c );
    873         }
    874        
    875         return( NULL );
     864                        return c;
     865        }
     866       
     867        return NULL;
    876868}
    877869
     
    958950}
    959951
    960 int bim_chat_msg( struct gaim_connection *gc, int id, char *msg )
     952int bim_chat_msg( struct conversation *c, char *msg )
    961953{
    962954        char *buf = NULL;
    963955        int st;
    964956       
    965         if( ( gc->flags & OPT_CONN_HTML ) && ( g_strncasecmp( msg, "<html>", 6 ) != 0 ) )
     957        if( ( c->gc->flags & OPT_CONN_HTML ) && ( g_strncasecmp( msg, "<html>", 6 ) != 0 ) )
    966958        {
    967959                buf = escape_html( msg );
     
    969961        }
    970962       
    971         st = gc->acc->prpl->chat_send( gc, id, msg );
     963        st = c->gc->acc->prpl->chat_send( c, msg );
    972964        g_free( buf );
    973965       
Note: See TracChangeset for help on using the changeset viewer.