]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_whois.c
presence: If CLICAP_PRESENCE is enabled, then RPL_AWAY is replaced by the "away"...
[irc/rqf/shadowircd.git] / modules / m_whois.c
index 085e4d64d00a73556310a07d88d20514fdb1408e..04423f725755e1cafc7147b3dc977ca860e22a66 100644 (file)
@@ -69,7 +69,6 @@ DECLARE_MODULE_AV1(whois, NULL, NULL, whois_clist, whois_hlist, NULL, "$Revision
 
 /*
  * m_whois
- *      parv[0] = sender prefix
  *      parv[1] = nickname masklist
  */
 static int
@@ -115,7 +114,6 @@ m_whois(struct Client *client_p, struct Client *source_p, int parc, const char *
 
 /*
  * ms_whois
- *      parv[0] = sender prefix
  *      parv[1] = server to reply
  *      parv[2] = nickname to whois
  */
@@ -230,6 +228,7 @@ do_whois(struct Client *client_p, struct Client *source_p, int parc, const char
 static void
 single_whois(struct Client *source_p, struct Client *target_p, int operspy)
 {
+       const char *awaymsg;
        char buf[BUFSIZE];
        rb_dlink_node *ptr;
        struct membership *msptr;
@@ -306,9 +305,9 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
                           target_p->name, target_p->servptr->name,
                           target_p->servptr->info);
 
-       if(target_p->user->away)
+       if(!IsCapable(source_p, CLICAP_PRESENCE) && (awaymsg = get_metadata(target_p, "away")) != NULL)
                sendto_one_numeric(source_p, RPL_AWAY, form_str(RPL_AWAY),
-                                  target_p->name, target_p->user->away);
+                                  target_p->name, awaymsg);
 
        if(IsOper(target_p))
        {