ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid-8/src/s_serv.c
(Generate patch)

Comparing ircd-hybrid-7.2/src/s_serv.c (file contents):
Revision 329 by michael, Sun Dec 25 10:45:42 2005 UTC vs.
Revision 337 by michael, Mon Dec 26 19:20:47 2005 UTC

# Line 1545 | Line 1545 | static void
1545   send_tb(struct Client *client_p, struct Channel *chptr)
1546   {
1547    /*
1548 <   * XXX - Logic here isn't right either.  What if the topic got unset?
1549 <   * We would need to send an empty TOPIC to reset the topic from the
1550 <   * other side
1548 >   * We may also send an empty topic here, but only if topic_time isn't 0,
1549 >   * i.e. if we had a topic that got unset.  This is required for syncing
1550 >   * topics properly.
1551 >   *
1552 >   * Imagine the following scenario: Our downlink introduces a channel
1553 >   * to us with a TS that is equal to ours, but the channel topic on
1554 >   * their side got unset while the servers were in splitmode, which means
1555 >   * their 'topic' is newer.  They simply wanted to unset it, so we have to
1556 >   * deal with it in a more sophisticated fashion instead of just resetting
1557 >   * it to their old topic they had before.  Read m_tburst.c:ms_tburst
1558 >   * for further information   -Michael
1559     */
1560 <  if (chptr->topic != NULL)
1560 >  if (chptr->topic_time != 0)
1561    {
1562      if (IsCapable(client_p, CAP_TBURST))
1563        sendto_one(client_p, ":%s TBURST %lu %s %lu %s :%s",
1564                   me.name, (unsigned long)chptr->channelts, chptr->chname,
1565 <                 (unsigned long)chptr->topic_time, chptr->topic_info,
1566 <                 chptr->topic);
1565 >                 (unsigned long)chptr->topic_time,
1566 >                 chptr->topic_info ? chptr->topic_info : "",
1567 >                 chptr->topic ? chptr->topic : "");
1568      else if (IsCapable(client_p, CAP_TB))
1569      {
1570        if (ConfigChannel.burst_topicwho)
# Line 1563 | Line 1572 | send_tb(struct Client *client_p, struct
1572          sendto_one(client_p, ":%s TB %s %lu %s :%s",
1573                     me.name, chptr->chname,
1574                     (unsigned long)chptr->topic_time,
1575 <                   chptr->topic_info, chptr->topic);
1575 >                   chptr->topic_info, chptr->topic ? chptr->topic : "");
1576        }
1577        else
1578        {
1579          sendto_one(client_p, ":%s TB %s %lu :%s",
1580                     me.name, chptr->chname,
1581 <                   (unsigned long)chptr->topic_time, chptr->topic);
1581 >                   (unsigned long)chptr->topic_time,
1582 >                   chptr->topic ? chptr->topic : "");
1583        }
1584      }
1585    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines