Through the dubious magic of autoconf, install man files in the proper directory.
[ircu2.10.12-pk.git] / ircd / m_kick.c
index 82c97931e556eb1c53bced60381f539ce6ebb0e5..2c95a8ea344906deb0f8a367ecf0662c92741398 100644 (file)
@@ -142,8 +142,12 @@ int m_kick(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
   if (!(member = find_member_link(chptr, who)) || IsZombie(member))
     return send_reply(sptr, ERR_USERNOTINCHANNEL, cli_name(who), chptr->chname);
 
-  /* Don't allow to kick member with a higher or equal op-level */
-  if (chptr->mode.apass[0] && OpLevel(member) <= OpLevel(member2))
+  /* Don't allow to kick member with a higher op-level,
+   * or members with the same op-level unless both are MAXOPLEVEL.
+   */
+  if (OpLevel(member) < OpLevel(member2)
+      || (OpLevel(member) == OpLevel(member2)
+          && OpLevel(member) < MAXOPLEVEL))
     return send_reply(sptr, ERR_NOTLOWEROPLEVEL, cli_name(who), chptr->chname,
        OpLevel(member2), OpLevel(member), "kick",
        OpLevel(member) == OpLevel(member2) ? "the same" : "a higher");
@@ -209,7 +213,7 @@ int ms_kick(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
   /* 2002-10-17: Don't send HACK if the users local server is kicking them */
   if (IsServer(sptr) &&
       !IsBurstOrBurstAck(sptr) &&
-      sptr!=cli_from(who))
+      sptr!=cli_user(who)->server)
     sendto_opmask_butone(0, SNO_HACK4, "HACK: %C KICK %H %C %s", sptr, chptr,
                         who, comment);
 
@@ -249,7 +253,7 @@ int ms_kick(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
       if (IsDelayedJoin(member)) {
         if (MyUser(who))
           sendcmdto_one(IsServer(sptr) ? &his : sptr, CMD_KICK,
-                        who, "%h %C :%s", chptr, who, comment);
+                        who, "%H %C :%s", chptr, who, comment);
       } else {
         sendcmdto_channel_butserv_butone(IsServer(sptr) ? &his : sptr, CMD_KICK,
                                          chptr, NULL, 0, "%H %C :%s", chptr, who,