aboutsummaryrefslogtreecommitdiffstats
path: root/irc.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 /irc.c
parentebb95b68792dde490a1ea1042209525f176af58d (diff)
Merging /TOPIC code from Miklos Vajna. Untested, because I still have to
implement the Jabber hooks.
Diffstat (limited to 'irc.c')
-rw-r--r--irc.c17
1 files changed, 6 insertions, 11 deletions
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 )