]> jfr.im git - irc/evilnet/x3.git/commitdiff
fix for autojoin happening before autohide
authorsirvulcan <redacted>
Sat, 16 Sep 2006 07:18:19 +0000 (07:18 +0000)
committersirvulcan <redacted>
Sat, 16 Sep 2006 07:18:19 +0000 (07:18 +0000)
ChangeLog
src/chanserv.c
src/chanserv.help
src/proto-p10.c

index 5389160efdefb903d8facf4a5a90f64db3da4845..111d1da469bc00b181dbb81a974c20a41dd7bdca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,14 @@
 /***********************************************************************
  X3 ChangeLog
 
+2006-09-16  Neil Spierling  <sirvulcan@gmail.com>
+
+       * src/chanserv.c: Do autojoin 5 seconds after handle_auth. Seems its
+       happening before autohide. Let me know if its still happening before
+       autohide.
+
+       * src/chanserv.help: Updated the AUTOJOIN bit.
+
 2006-09-10  Neil Spierling  <sirvulcan@gmail.com>
 
        * src/mod-memoserv.c: Fixed crash bug.
index e934108124a86ee8f8dccdef977ac2c65ab82556..b3af80444ed832a3543911d57147444f5211360a 100644 (file)
@@ -7192,6 +7192,35 @@ handle_join(struct modeNode *mNode)
     return 0;
 }
 
+static void
+chanserv_autojoin_channel(void *data)
+{
+    struct userData *channel;
+    struct userNode *user = data;
+
+    for(channel = user->handle_info->channels; channel; channel = channel->u_next)
+    {
+        struct chanNode *cn;
+        struct modeNode *mn;
+
+        if(IsUserSuspended(channel)
+           || IsSuspended(channel->channel)
+           || !(cn = channel->channel->channel))
+            continue;
+
+        mn = GetUserMode(cn, user);
+        if(!mn)
+        {
+            if(!IsUserSuspended(channel)
+               && IsUserAutoJoin(channel)
+               && (channel->access >= channel->channel->lvlOpts[lvlInviteMe])
+               && !self->burst
+               && !user->uplink->burst)
+                irc_svsjoin(chanserv, user, cn);
+        }
+    }
+}
+
 static void
 handle_auth(struct userNode *user, UNUSED_ARG(struct handle_info *old_handle))
 {
@@ -7222,14 +7251,6 @@ handle_auth(struct userNode *user, UNUSED_ARG(struct handle_info *old_handle))
                && !self->burst
                && !user->uplink->burst)
                 irc_invite(chanserv, user, cn);
-
-            if(!IsUserSuspended(channel)
-               && IsUserAutoJoin(channel)
-               && (channel->access >= channel->channel->lvlOpts[lvlInviteMe])
-               && !self->burst
-               && !user->uplink->burst)
-                irc_svsjoin(chanserv, user, cn);
-
             continue;
         }
 
@@ -7304,6 +7325,10 @@ handle_auth(struct userNode *user, UNUSED_ARG(struct handle_info *old_handle))
 
     if (user->handle_info->epithet)
       irc_swhois(chanserv, user, user->handle_info->epithet);
+
+   /* process autojoin channels 5 seconds later as this sometimes 
+      happens before autohide */
+   timeq_add(now + 5, chanserv_autojoin_channel, user);
 }
 
 static void
index 862227fc9caf11fef7257fb73f30de5fc431edd2..d9b51bb909872a7cf8850e3d951ab746db4a2a77 100644 (file)
          "INFO:       Sets the infoline that $C sends when you join the channel.",
          "AUTOOP:     Enable or disable $C automatically opping you upon joining or authenticating.",
         "AUTOINVITE: $C will invite you to this channel if you have access to and are not in when you authenticate if this setting is on.",
-        "AUTOJOIN: $C will forcibly you to this channel if you have access to and are not in when you authenticate if this setting is on.",
+        "AUTOJOIN: $C will forcibly join you into this channel if you have access to and are not in it when you authenticate if this setting is on.",
          "$uSee Also:$u set");
 "USET INFO" ("/msg $C USET <#channel> INFO <info>",
         "This command will set a user defined information message to be displayed when you join the channel. Set to '*' to clear the message.",
index 73d23a6d009f28ff7e2df1f1642d44c0761aba99..05c92a02c3c36769a0c3863511ed0f825542f37a 100644 (file)
@@ -1038,7 +1038,7 @@ irc_topic(struct userNode *service, struct userNode *who, struct chanNode *what,
       host_in_topic = atoi(hstr);
    }
 
-   if (type == 5) {
+   if (type >= 5) {
      putsock("%s " P10_TOPIC " %s %s%s%s%s%s " FMT_TIME_T " " FMT_TIME_T " :%s", service->numeric, what->name,
              who->nick, host_in_topic ? "!" : "", host_in_topic ? (IsSetHost(who) ? sident : who->ident) : "", 
              host_in_topic ? "@" : "", host_in_topic ? shost : "", what->timestamp, now, topic);