]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_who.c
Allow /ojoin !#channel/%#channel, if admin/halfop are enabled.
[irc/rqf/shadowircd.git] / modules / m_who.c
index 718ed094aa12ae1dc0ef3b4cab0d846ad42bb4fc..b8ffc873d99ac14aec01ae5c634dee74048a40e5 100644 (file)
@@ -84,7 +84,6 @@ static void do_who(struct Client *source_p,
 
 /*
 ** m_who
-**      parv[0] = sender prefix
 **      parv[1] = nickname mask list
 **      parv[2] = additional selection flag and format options
 */
@@ -443,7 +442,7 @@ append_format(char *buf, size_t bufsize, size_t *pos, const char *fmt, ...)
 
        max = *pos >= bufsize ? 0 : bufsize - *pos;
        va_start(ap, fmt);
-       result = rb_vsnprintf(buf + *pos, bufsize - *pos, fmt, ap);
+       result = rb_vsnprintf(buf + *pos, max, fmt, ap);
        va_end(ap);
        *pos += result;
 }
@@ -475,7 +474,7 @@ do_who(struct Client *source_p, struct Client *target_p, struct membership *mspt
                           source_p->name, msptr ? msptr->chptr->chname : "*",
                           target_p->username, target_p->host,
                           target_p->servptr->name, target_p->name, status,
-                          ConfigServerHide.flatten_links ? 0 : target_p->hopcount, 
+                          ConfigServerHide.flatten_links && !IsOper(source_p) && !IsExemptShide(source_p) ? 0 : target_p->hopcount, 
                           target_p->info);
        else
        {
@@ -505,7 +504,7 @@ do_who(struct Client *source_p, struct Client *target_p, struct membership *mspt
                if (fmt->fields & FIELD_FLAGS)
                        append_format(str, sizeof str, &pos, " %s", status);
                if (fmt->fields & FIELD_HOP)
-                       append_format(str, sizeof str, &pos, " %d", ConfigServerHide.flatten_links ? 0 : target_p->hopcount);
+                       append_format(str, sizeof str, &pos, " %d", ConfigServerHide.flatten_links && !IsOper(source_p) && !IsExemptShide(source_p) ? 0 : target_p->hopcount);
                if (fmt->fields & FIELD_IDLE)
                        append_format(str, sizeof str, &pos, " %d", (int)(MyClient(target_p) ? rb_current_time() - target_p->localClient->last : 0));
                if (fmt->fields & FIELD_ACCOUNT)