Changeset 83e92bf for irc_send.c


Ignore:
Timestamp:
2010-03-27T12:30:00Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
9b69eb7
Parents:
b95932e
Message:

Topic handling changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_send.c

    rb95932e r83e92bf  
    135135                irc_write( irc, ":%s MODE %s +%s", irc->root->host, ic->name, ic->mode );
    136136                irc_send_names( ic );
    137                 irc_send_topic( ic );
     137                irc_send_topic( ic, FALSE );
    138138        }
    139139}
     
    182182}
    183183
    184 void irc_send_topic( irc_channel_t *ic )
    185 {
    186         if( ic->topic )
     184void irc_send_topic( irc_channel_t *ic, gboolean topic_change )
     185{
     186        if( topic_change && ic->topic_who )
     187        {
     188                irc_write( ic->irc, ":%s TOPIC %s :%s", ic->topic_who,
     189                           ic->name, ic->topic && *ic->topic ? ic->topic : "" );
     190        }
     191        else if( ic->topic )
     192        {
    187193                irc_send_num( ic->irc, 332, "%s :%s", ic->name, ic->topic );
     194                if( ic->topic_who )
     195                        irc_send_num( ic->irc, 333, "%s %s %d",
     196                                      ic->name, ic->topic_who, (int) ic->topic_time );
     197        }
    188198        else
    189199                irc_send_num( ic->irc, 331, "%s :No topic for this channel", ic->name );
Note: See TracChangeset for help on using the changeset viewer.