]> jfr.im git - irc/rizon/plexus4.git/commitdiff
sjoin: remove unnecessary tstosend
authorAdam <redacted>
Mon, 6 Jun 2022 22:02:21 +0000 (22:02 +0000)
committerAdam <redacted>
Mon, 6 Jun 2022 22:02:21 +0000 (22:02 +0000)
modules/core/m_sjoin.c

index 8c1ad4b221d5242788ea7322dbb3d58c52570d7b..ba71bc8d4692503803cf2631243d49604c02c754 100644 (file)
@@ -76,7 +76,6 @@ ms_sjoin(struct Client *client_p, struct Client *source_p,
   struct Client  *target_p = NULL;
   time_t         newts;
   time_t         oldts;
-  time_t         tstosend;
   struct Mode mode, oldmode;
   int            args = 0;
   char           keep_our_modes = 1;
@@ -183,20 +182,17 @@ ms_sjoin(struct Client *client_p, struct Client *source_p,
   }
 
   if (isnew)
-    chptr->channelts = tstosend = newts;
+    chptr->channelts = newts;
   else if (newts == 0 || oldts == 0)
-    chptr->channelts = tstosend = 0;
-  else if (newts == oldts)
-    tstosend = oldts;
+    chptr->channelts = 0;
   else if (newts < oldts)
   {
     keep_our_modes = 0;
-    chptr->channelts = tstosend = newts;
+    chptr->channelts = newts;
   }
-  else
+  else if (newts > oldts)
   {
     keep_new_modes = 0;
-    tstosend = oldts;
   }
 
   if (!keep_new_modes)
@@ -272,12 +268,12 @@ ms_sjoin(struct Client *client_p, struct Client *source_p,
   }
 
   buflen = snprintf(nick_buf, sizeof(nick_buf), ":%s SJOIN %lu %s %s %s:",
-                    source_p->name, (unsigned long)tstosend,
+                    source_p->name, (unsigned long)chptr->channelts,
                     chptr->chname, modebuf, parabuf);
   nick_ptr = nick_buf + buflen;
 
   buflen = snprintf(uid_buf, sizeof(uid_buf), ":%s SJOIN %lu %s %s %s:",
-                    ID(source_p), (unsigned long)tstosend,
+                    ID(source_p), (unsigned long)chptr->channelts,
                     chptr->chname, modebuf, parabuf);
   uid_ptr = uid_buf + buflen;
 
@@ -426,7 +422,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p,
       sendto_server(client_p, 0, CAP_TS6, "%s", nick_buf);
 
       buflen = snprintf(nick_buf, sizeof(nick_buf), ":%s SJOIN %lu %s %s %s:",
-                        source_p->name, (unsigned long)tstosend,
+                        source_p->name, (unsigned long)chptr->channelts,
                         chptr->chname, modebuf, parabuf);
       nick_ptr = nick_buf + buflen;
     }
@@ -438,7 +434,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p,
       sendto_server(client_p, CAP_TS6, 0, "%s", uid_buf);
 
       buflen = snprintf(uid_buf, sizeof(uid_buf), ":%s SJOIN %lu %s %s %s:",
-                        ID(source_p), (unsigned long)tstosend,
+                        ID(source_p), (unsigned long)chptr->channelts,
                         chptr->chname, modebuf, parabuf);
       uid_ptr = uid_buf + buflen;
     }