Ver código fonte

* Fixed closed-invite not being checked correctly

svn: 1590
Bryan Drewery 21 anos atrás
pai
commit
ec0a82c9ea
2 arquivos alterados com 11 adições e 3 exclusões
  1. 1 0
      doc/UPDATES
  2. 10 3
      src/mod/irc.mod/chan.c

+ 1 - 0
doc/UPDATES

@@ -4,6 +4,7 @@ This is a summary of ChangeLog basically.
 
 * No longer reading in /etc/hosts, still reading .hosts though
 * Disabled all the DEBUG emailing and context shit, it was utterly pointless
+* Fixed closed-invite not being checked correctly.
 
 1.2
 * No longer displaying SALTS on ./bin -v

+ 10 - 3
src/mod/irc.mod/chan.c

@@ -822,9 +822,16 @@ void recheck_channel_modes(struct chanset_t *chan)
   int cur = chan->channel.mode,
       mns = chan->mode_mns_prot,
       pls = chan->mode_pls_prot;
+
   if (channel_closed(chan)) {
-    pls |= CHANINV;
-    mns &= ~CHANINV;
+    if (chan->closed_invite) {
+      pls |= CHANINV;
+      mns &= ~CHANINV;
+    }
+    if (chan->closed_private) {
+      pls |= CHANPRIV;
+      mns &= ~CHANPRIV;
+    }
   }
 
   if (!(chan->status & CHAN_ASKEDMODES)) {
@@ -985,7 +992,7 @@ void enforce_closed(struct chanset_t *chan) {
   if (!chan || !me_op(chan)) 
     return;
 
-  char buf[1024] = "";
+  char buf[3] = "";
 
   if (chan->closed_invite && !(chan->channel.mode & CHANINV))
     strcat(buf, "i");