]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/chanserv.c
Try again to correct the issue. :/
[irc/evilnet/x3.git] / src / chanserv.c
index c7758497d83b05001fbc43ed00e1c0df2cb48976..a84813540b4324ebbfb7fb4389b282eeae7eccff 100644 (file)
@@ -2388,8 +2388,20 @@ merge_bans(struct chanData *source, struct chanData *target)
 static void
 merge_data(struct chanData *source, struct chanData *target)
 {
+    /* Use more recent visited and owner-transfer time; use older
+     * registered time.  Bitwise or may_opchan.  Use higher max.
+     * Do not touch last_refresh, ban count or user counts.
+     */
     if(source->visited > target->visited)
        target->visited = source->visited;
+    if(source->registered < target->registered)
+        target->registered = source->registered;
+    if(source->ownerTransfer > target->ownerTransfer)
+        target->ownerTransfer = source->ownerTransfer;
+    if(source->may_opchan)
+        target->may_opchan = 1;
+    if(source->max > target->max)
+        target->max = source->max;
 }
 
 static void
@@ -3002,7 +3014,7 @@ static CHANSERV_FUNC(cmd_devoice)
 }
 
 static int
-bad_channel_ban(struct chanNode *channel, struct userNode *user, const char *ban, int *victimCount, struct modeNode **victims)
+bad_channel_ban(struct chanNode *channel, struct userNode *user, const char *ban, unsigned int *victimCount, struct modeNode **victims)
 {
     unsigned int ii;
 
@@ -3104,18 +3116,18 @@ eject_user(struct userNode *user, struct chanNode *channel, unsigned int argc, c
                reply("CSMSG_MASK_PROTECTED", argv[1]);
            return 0;
        }
-        /* We dont actually want a victem count if were banning a mask manually, IMO -Rubin*/
-        if(cmd)
-            victimCount = 0;  /* Dont deop etc ppl who match this */
-
-#ifdef entropy_lameness
-        if((victimCount > 4) && ((victimCount * 3) > channel->members.used) && !IsOper(user))
+/* If i want to ban *.nl and theres 5 of them, what is it to the bot?!? 
+//      if((victimCount > 4) && ((victimCount * 3) > channel->members.used) && !IsOper(user)) 
+                                                                           And, ^^^^^^^^^ BAH! 
+   We use x2 style over-mask detection instead because it doesnt stop channel owners from doing 
+   reasonable bans, but does stop *@*, *@*a* *@*b* etc type masks.  Yes, you can defeat it with 
+   some creativity, but its not x3's job to be the ban censor anyway.  */
+        if(is_overmask(argv[1]))
         {
            if(cmd)
                 reply("CSMSG_LAME_MASK", argv[1]);
             return 0;
         }
-#endif
 
         if((action == ACTION_KICK) && (victimCount == 0))
         {
@@ -4419,9 +4431,10 @@ static CHANSERV_FUNC(cmd_info)
     reply("CSMSG_CHANNEL_USERS", cData->userCount);
     reply("CSMSG_CHANNEL_LAMERS", cData->banCount);
     reply("CSMSG_CHANNEL_VISITED", intervalString(buffer, now - cData->visited, user->handle_info));
-    reply("CSMSG_CHANNEL_REGISTERED", intervalString(buffer, now - cData->registered, user->handle_info));
 
     privileged = IsStaff(user);
+    if(privileged)
+        reply("CSMSG_CHANNEL_REGISTERED", intervalString(buffer, now - cData->registered, user->handle_info));
     if(((uData && uData->access >= UL_COOWNER) || privileged) && cData->registrar)
         reply("CSMSG_CHANNEL_REGISTRAR", cData->registrar);