Changeset 256899f for irc_commands.c


Ignore:
Timestamp:
2007-11-19T23:16:18Z (16 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
7df5a08
Parents:
cd428e4 (diff), ef5c185 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merging Jabber groupchat support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_commands.c

    rcd428e4 r256899f  
    144144                irc_join( irc, u, irc->channel );
    145145        }
    146         else if( ( c = chat_by_channel( cmd[1] ) ) )
     146        else if( ( c = irc_chat_by_channel( irc, cmd[1] ) ) )
    147147        {
    148148                user_t *u = user_find( irc, irc->nick );
     
    201201{
    202202        char *nick = cmd[1], *channel = cmd[2];
    203         struct groupchat *c = chat_by_channel( channel );
     203        struct groupchat *c = irc_chat_by_channel( irc, channel );
    204204        user_t *u = user_find( irc, nick );
    205205       
     
    287287                        u = u->next;
    288288                }
    289         else if( ( c = chat_by_channel( channel ) ) )
     289        else if( ( c = irc_chat_by_channel( irc, channel ) ) )
    290290                for( l = c->in_room; l; l = l->next )
    291291                {
     
    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.