Changeset 50e1776 for protocols/nogaim.c


Ignore:
Timestamp:
2007-11-19T22:23:58Z (13 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
ef5c185
Parents:
ebb95b6
Message:

Merging /TOPIC code from Miklos Vajna. Untested, because I still have to
implement the Jabber hooks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.c

    rebb95b6 r50e1776  
    760760}
    761761
     762void imcb_chat_topic( struct groupchat *c, char *who, char *topic )
     763{
     764        struct im_connection *ic = c->ic;
     765        user_t *u = NULL;
     766       
     767        if( who == NULL)
     768                u = user_find( ic, ic->irc->mynick );
     769        else if( g_strcasecmp( who, ic->acc->user ) == 0 )
     770                u = user_find( ic, ic->irc->nick );
     771        else
     772                u = user_findhandle( ic, who );
     773       
     774        if( ( g_strcasecmp( set_getstr( &ic->irc->set, "strip_html" ), "always" ) == 0 ) ||
     775            ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->irc->set, "strip_html" ) ) )
     776                strip_html( topic );
     777       
     778        g_free( c->topic );
     779        c->topic = g_strdup( topic );
     780       
     781        if( c->joined && u )
     782                irc_write( ic->irc, ":%s!%s@%s TOPIC %s :%s", u->nick, u->user, u->host, c->channel, topic );
     783}
     784
    762785struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle )
    763786{
     
    777800        c->title = g_strdup( handle );
    778801        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 );
    779803       
    780804        if( set_getbool( &ic->irc->set, "debug" ) )
Note: See TracChangeset for help on using the changeset viewer.