Committer  : entrope
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Commit time: 2005-01-20 04:00:39 UTC

Modified files:
     ChangeLog ircd/m_invite.c

Log message:

Add timestamps to S<->S INVITE messages and use them.

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.535 ircu2.10/ChangeLog:1.536
--- ircu2.10/ChangeLog:1.535    Sat Jan 15 07:22:50 2005
+++ ircu2.10/ChangeLog  Wed Jan 19 20:00:27 2005
@@ -1,3 +1,10 @@
+2005-01-19  Michael Poole <[EMAIL PROTECTED]>
+
+       * ircd/m_invite.c (m_invite, ms_invite): Include timestamp in
+       outbound INVITE messages.  On incoming INVITEs, ignore if the
+       timestamp is too recent or if the timestamp is missing and the
+       peer server is in burst.
+
 2005-01-15  Michael Poole <[EMAIL PROTECTED]>
 
        * RELEASE.NOTES: Mention CIDR support for Client, Operator, bans
Index: ircu2.10/ircd/m_invite.c
diff -u ircu2.10/ircd/m_invite.c:1.17 ircu2.10/ircd/m_invite.c:1.18
--- ircu2.10/ircd/m_invite.c:1.17       Fri Dec 10 21:13:47 2004
+++ ircu2.10/ircd/m_invite.c    Wed Jan 19 20:00:29 2005
@@ -20,7 +20,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: m_invite.c,v 1.17 2004/12/11 05:13:47 klmitch Exp $
+ * $Id: m_invite.c,v 1.18 2005/01/20 04:00:29 entrope Exp $
  */
 
 /*
@@ -190,9 +190,11 @@
       /* Announce to servers with channel operators, but skip acptr,
        * since they will be notified below. */
       sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, acptr, 
SKIP_NONOPS,
-                                       "%s :%H", cli_name(acptr), chptr);
+                                       "%s %H %Tu", cli_name(acptr),
+                                       chptr, chptr->creationtime);
     }
-    sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%H", cli_name(acptr), chptr);
+    sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H %Tu", cli_name(acptr),
+                  chptr, chptr->creationtime);
   }
 
   return 0;
@@ -204,6 +206,7 @@
  *   parv[0] - sender prefix
  *   parv[1] - user to invite
  *   parv[2] - channel name
+ *   parv[3] - (optional) channel timestamp
  *
  * - INVITE now is accepted only if who does it is chanop (this of course
  *   implies that channel must exist and he must be on it).
@@ -213,11 +216,15 @@
  *
  * - Invite with no parameters now lists the channels you are invited to.
  *                                                         - Isomer 23 Oct 99
+ *
+ * - Invite with too-late timestamp, or with no timestamp from a bursting
+ *   server, is silently discarded.                   - Entrope 19 Jan 05
  */
 int ms_invite(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 {
   struct Client *acptr;
   struct Channel *chptr;
+  time_t invite_ts;
   
   if (IsServer(sptr)) {
     /*
@@ -253,6 +260,13 @@
     return 0;
   }
 
+  if (parc > 3) {
+    invite_ts = atoi(parv[3]);
+    if (invite_ts > chptr->creationtime)
+      return 0;
+  } else if (IsBurstOrBurstAck(cptr))
+    return 0;
+
   if (!IsChannelService(sptr) && !find_channel_member(sptr, chptr)) {
     send_reply(sptr, ERR_NOTONCHANNEL, chptr->chname);
     return 0;
@@ -278,10 +292,13 @@
     /* Announce to servers with channel operators, but skip acptr,
      * since they will be notified below. */
     sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, acptr, 
SKIP_NONOPS,
-                                     "%s :%H", cli_name(acptr), chptr);
+                                     "%s %H %Tu", cli_name(acptr), chptr,
+                                     chptr->creationtime);
   }
 
-  sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%H", cli_name(acptr), chptr);
+  sendcmdto_one(sptr, CMD_INVITE, acptr,
+                "%s %H %Tu",
+                cli_name(acptr), chptr, chptr->creationtime);
   return 0;
 }
 
----------------------- End of diff -----------------------

Reply via email to