]> 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 8dfcfbad80c4f493e4c650a37c1021fe27e13d8c..834ab7544a5fea5dd7d41468787e1ae91dd6daea 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;
 }
@@ -468,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,