]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_who.c
presence: If CLICAP_PRESENCE is enabled, then RPL_AWAY is replaced by the "away"...
[irc/rqf/shadowircd.git] / modules / m_who.c
index 63fb2ed35f35ed221c1afb4c85b640c023030211..834ab7544a5fea5dd7d41468787e1ae91dd6daea 100644 (file)
@@ -442,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;
 }
@@ -467,7 +467,7 @@ do_who(struct Client *source_p, struct Client *target_p, struct membership *mspt
        const char *q;
 
        rb_sprintf(status, "%c%s%s",
-                  target_p->user->away ? 'G' : 'H', IsOper(target_p) ? "*" : "", msptr ? find_channel_status(msptr, fmt->fields || IsCapable(source_p, CLICAP_MULTI_PREFIX)) : "");
+                  (get_metadata(target_p, "away") != NULL) ? 'G' : 'H', IsOper(target_p) ? "*" : "", msptr ? find_channel_status(msptr, fmt->fields || IsCapable(source_p, CLICAP_MULTI_PREFIX)) : "");
 
        if (fmt->fields == 0)
                sendto_one(source_p, form_str(RPL_WHOREPLY), me.name,