aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/nogaim.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2007-11-19 22:23:58 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2007-11-19 22:23:58 +0000
commit50e1776cb0c76b3328d458dd8a1bfb379b6b0e43 (patch)
tree8e7d9cf4480f507d6fc644605e91794395c211cf /protocols/nogaim.c
parentebb95b68792dde490a1ea1042209525f176af58d (diff)
Merging /TOPIC code from Miklos Vajna. Untested, because I still have to
implement the Jabber hooks.
Diffstat (limited to 'protocols/nogaim.c')
-rw-r--r--protocols/nogaim.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/protocols/nogaim.c b/protocols/nogaim.c
index d1aceb1a..2ad8a049 100644
--- a/protocols/nogaim.c
+++ b/protocols/nogaim.c
@@ -759,6 +759,29 @@ void imcb_chat_msg( struct groupchat *c, char *who, char *msg, u_int32_t flags,
g_free( wrapped );
}
+void imcb_chat_topic( struct groupchat *c, char *who, char *topic )
+{
+ struct im_connection *ic = c->ic;
+ user_t *u = NULL;
+
+ if( who == NULL)
+ u = user_find( ic, ic->irc->mynick );
+ else if( g_strcasecmp( who, ic->acc->user ) == 0 )
+ u = user_find( ic, ic->irc->nick );
+ else
+ u = user_findhandle( ic, who );
+
+ if( ( g_strcasecmp( set_getstr( &ic->irc->set, "strip_html" ), "always" ) == 0 ) ||
+ ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->irc->set, "strip_html" ) ) )
+ strip_html( topic );
+
+ g_free( c->topic );
+ c->topic = g_strdup( topic );
+
+ if( c->joined && u )
+ irc_write( ic->irc, ":%s!%s@%s TOPIC %s :%s", u->nick, u->user, u->host, c->channel, topic );
+}
+
struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle )
{
struct groupchat *c;
@@ -776,6 +799,7 @@ struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle )
c->ic = ic;
c->title = g_strdup( handle );
c->channel = g_strdup_printf( "&chat_%03d", ic->irc->c_id++ );
+ 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 );
if( set_getbool( &ic->irc->set, "debug" ) )
imcb_log( ic, "Creating new conversation: (id=0x%x,handle=%s)", (int) c, handle );