diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2007-11-19 22:23:58 +0000 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2007-11-19 22:23:58 +0000 |
commit | 50e1776cb0c76b3328d458dd8a1bfb379b6b0e43 (patch) | |
tree | 8e7d9cf4480f507d6fc644605e91794395c211cf /irc_commands.c | |
parent | ebb95b68792dde490a1ea1042209525f176af58d (diff) |
Merging /TOPIC code from Miklos Vajna. Untested, because I still have to
implement the Jabber hooks.
Diffstat (limited to 'irc_commands.c')
-rw-r--r-- | irc_commands.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/irc_commands.c b/irc_commands.c index 266d9732..287a126f 100644 --- a/irc_commands.c +++ b/irc_commands.c @@ -420,10 +420,21 @@ static void irc_cmd_watch( irc_t *irc, char **cmd ) static void irc_cmd_topic( irc_t *irc, char **cmd ) { - if( cmd[2] ) - irc_reply( irc, 482, "%s :Cannot change topic", cmd[1] ); + char *channel = cmd[1]; + char *topic = cmd[2]; + + if( topic ) + { + /* Send the topic */ + struct groupchat *c = irc_chat_by_channel( irc, channel ); + if( c && c->ic && c->ic->acc->prpl->chat_topic ) + c->ic->acc->prpl->chat_topic( c, topic ); + } else - irc_topic( irc, cmd[1] ); + { + /* Get the topic */ + irc_topic( irc, channel ); + } } static void irc_cmd_away( irc_t *irc, char **cmd ) |