Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / ircd / m_mode.c
index eaa5f19ebf27c1b0f4dfcd9608d5924c01b0cb14..74792320bcf3d8e73e92ec7cdf2c0bdaf96e2748 100644 (file)
@@ -114,7 +114,7 @@ m_mode(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
       !(chptr = FindChannel(parv[1])))
     return set_user_mode(cptr, sptr, parc, parv);
 
-  sptr->flags &= ~FLAGS_TS8;
+  cli_flags(sptr) &= ~FLAGS_TS8;
 
   if (parc < 3) {
     char modebuf[MODEBUFLEN];
@@ -129,8 +129,7 @@ m_mode(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
   }
 
   if (!(member = find_member_link(chptr, sptr)) || !IsChanOp(member)) {
-#ifdef OPER_MODE_LCHAN
-    if (IsOperOnLocalChannel(sptr, chptr->chname)) {
+    if (IsLocalChannel(chptr->chname) && HasPriv(sptr, PRIV_MODE_LCHAN)) {
       modebuf_init(&mbuf, sptr, cptr, chptr,
                   (MODEBUF_DEST_CHANNEL | /* Send mode to channel */
                    MODEBUF_DEST_HACK4));  /* Send HACK(4) notice */
@@ -139,7 +138,6 @@ m_mode(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
                  MODE_PARSE_FORCE)); /* Force it to take */
       return modebuf_flush(&mbuf);
     } else
-#endif
       mode_parse(0, cptr, sptr, chptr, parc - 2, parv + 2,
                 (member ? MODE_PARSE_NOTOPER : MODE_PARSE_NOTMEMBER));
     return 0;
@@ -168,10 +166,10 @@ ms_mode(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
   if (('#' != *parv[1] && '+' != *parv[1])|| !(chptr = FindChannel(parv[1])))
     return set_user_mode(cptr, sptr, parc, parv);
 
-  sptr->flags &= ~FLAGS_TS8;
+  cli_flags(sptr) &= ~FLAGS_TS8;
 
   if (IsServer(sptr)) {
-    if (find_conf_byhost(cptr->confs, sptr->name, CONF_UWORLD))
+    if (find_conf_byhost(cli_confs(cptr), cli_name(sptr), CONF_UWORLD))
       modebuf_init(&mbuf, sptr, cptr, chptr,
                   (MODEBUF_DEST_CHANNEL | /* Send mode to clients */
                    MODEBUF_DEST_SERVER  | /* Send mode to servers */