Changeset 83ba3e5 for protocols


Ignore:
Timestamp:
2008-01-18T13:20:37Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
bea1305
Parents:
ac4adf9
Message:

Moving imcb_chat_new() to a saner location (no code changes) and fixing
default channel topic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.c

    rac4adf9 r83ba3e5  
    692692}
    693693
     694struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle )
     695{
     696        struct groupchat *c;
     697       
     698        /* This one just creates the conversation structure, user won't see anything yet */
     699       
     700        if( ic->groupchats )
     701        {
     702                for( c = ic->groupchats; c->next; c = c->next );
     703                c = c->next = g_new0( struct groupchat, 1 );
     704        }
     705        else
     706                ic->groupchats = c = g_new0( struct groupchat, 1 );
     707       
     708        c->ic = ic;
     709        c->title = g_strdup( handle );
     710        c->channel = g_strdup_printf( "&chat_%03d", ic->irc->c_id++ );
     711        c->topic = g_strdup_printf( "BitlBee groupchat: \"%s\". Please keep in mind that root-commands won't work here. Have fun!", c->title );
     712       
     713        if( set_getbool( &ic->irc->set, "debug" ) )
     714                imcb_log( ic, "Creating new conversation: (id=%p,handle=%s)", c, handle );
     715       
     716        return c;
     717}
     718
    694719void imcb_chat_free( struct groupchat *c )
    695720{
     
    728753                g_free( c->channel );
    729754                g_free( c->title );
     755                g_free( c->topic );
    730756                g_free( c );
    731757        }
     
    781807        if( c->joined && u )
    782808                irc_write( ic->irc, ":%s!%s@%s TOPIC %s :%s", u->nick, u->user, u->host, c->channel, topic );
    783 }
    784 
    785 struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle )
    786 {
    787         struct groupchat *c;
    788        
    789         /* This one just creates the conversation structure, user won't see anything yet */
    790        
    791         if( ic->groupchats )
    792         {
    793                 for( c = ic->groupchats; c->next; c = c->next );
    794                 c = c->next = g_new0( struct groupchat, 1 );
    795         }
    796         else
    797                 ic->groupchats = c = g_new0( struct groupchat, 1 );
    798        
    799         c->ic = ic;
    800         c->title = g_strdup( handle );
    801         c->channel = g_strdup_printf( "&chat_%03d", ic->irc->c_id++ );
    802         c->topic = g_strdup_printf( "%s :BitlBee groupchat: \"%s\". Please keep in mind that root-commands won't work here. Have fun!", c->channel, c->title );
    803        
    804         if( set_getbool( &ic->irc->set, "debug" ) )
    805                 imcb_log( ic, "Creating new conversation: (id=%p,handle=%s)", c, handle );
    806        
    807         return c;
    808809}
    809810
Note: See TracChangeset for help on using the changeset viewer.