Changeset 50e1776 for irc_commands.c


Ignore:
Timestamp:
2007-11-19T22:23:58Z (16 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
  • irc_commands.c

    rebb95b6 r50e1776  
    421421static void irc_cmd_topic( irc_t *irc, char **cmd )
    422422{
    423         if( cmd[2] )
    424                 irc_reply( irc, 482, "%s :Cannot change topic", cmd[1] );
    425         else
    426                 irc_topic( irc, cmd[1] );
     423        char *channel = cmd[1];
     424        char *topic = cmd[2];
     425       
     426        if( topic )
     427        {
     428                /* Send the topic */
     429                struct groupchat *c = irc_chat_by_channel( irc, channel );
     430                if( c && c->ic && c->ic->acc->prpl->chat_topic )
     431                        c->ic->acc->prpl->chat_topic( c, topic );
     432        }
     433        else
     434        {
     435                /* Get the topic */
     436                irc_topic( irc, channel );
     437        }
    427438}
    428439
Note: See TracChangeset for help on using the changeset viewer.