Forward port of delayed-join.patch from Quakenet's "Asuka" patch set
[ircu2.10.12-pk.git] / ircd / m_part.c
index 492469202f0e9a0e0987a95c58447e3c5827abb6..00da1ef64f5d07fbb9d763e92ff2ccda2e385420 100644 (file)
@@ -139,13 +139,16 @@ int m_part(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
     assert(!IsZombie(member)); /* Local users should never zombie */
 
-    if (!member_can_send_to_channel(member))
+    if (!member_can_send_to_channel(member, 0))
     {
       flags |= CHFL_BANNED;
       /* Remote clients don't want to see a comment either. */
       parts.jb_comment = 0;
     }
 
+    if (IsDelayedJoin(member))
+      flags |= CHFL_DELAYED;
+
     joinbuf_join(&parts, chptr, flags); /* part client from channel */
   }
 
@@ -194,12 +197,15 @@ int ms_part(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     if (IsZombie(member)) /* figure out special flags... */
       flags |= CHFL_ZOMBIE;
 
+    if (IsDelayedJoin(member))
+      flags |= CHFL_DELAYED;
+
     /*
      * XXX BUG: If a client /part's with a part notice, on channels where
      * he's banned, local clients will not see the part notice, but remote
      * clients will.
      */
-    if (!member_can_send_to_channel(member))
+    if (!member_can_send_to_channel(member, 0))
       flags |= CHFL_BANNED;
 
     /* part user from channel */