From 50e1776cb0c76b3328d458dd8a1bfb379b6b0e43 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 19 Nov 2007 22:23:58 +0000 Subject: Merging /TOPIC code from Miklos Vajna. Untested, because I still have to implement the Jabber hooks. --- irc.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'irc.c') diff --git a/irc.c b/irc.c index 72bc5d92..ebb2876b 100644 --- a/irc.c +++ b/irc.c @@ -787,19 +787,14 @@ void irc_motd( irc_t *irc ) void irc_topic( irc_t *irc, char *channel ) { - if( g_strcasecmp( channel, irc->channel ) == 0 ) - { + struct groupchat *c = irc_chat_by_channel( irc, channel ); + + if( c && c->topic ) + irc_reply( irc, 332, "%s :%s", channel, c->topic ); + else if( g_strcasecmp( channel, irc->channel ) == 0 ) irc_reply( irc, 332, "%s :%s", channel, CONTROL_TOPIC ); - } else - { - struct groupchat *c = irc_chat_by_channel( irc, channel ); - - if( c ) - irc_reply( irc, 332, "%s :BitlBee groupchat: \"%s\". Please keep in mind that root-commands won't work here. Have fun!", channel, c->title ); - else - irc_reply( irc, 331, "%s :No topic for this channel", channel ); - } + irc_reply( irc, 331, "%s :No topic for this channel", channel ); } void irc_umode_set( irc_t *irc, char *s, int allow_priv ) -- cgit v1.2.3