From 50aa2dd31d070cbad762c1aedb46d544b53376f3 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Tue, 2 Jun 2009 02:44:31 -0500 Subject: [PATCH] presence: Use RPL_WHOISMETADATA. --- modules/m_whois.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/m_whois.c b/modules/m_whois.c index 04423f7..a111e91 100644 --- a/modules/m_whois.c +++ b/modules/m_whois.c @@ -240,6 +240,8 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy) hook_data_client hdata; int visible; int extra_space = 0; + struct DictionaryIter iter; + struct MetadataEntry *md; if(target_p->user == NULL) { @@ -367,6 +369,17 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy) } } + DICTIONARY_FOREACH(md, &iter, target_p->user->metadata) + { + /* XXX: hack around "away" for legacy clients. --nenolod */ + if (!IsCapable(source_p, CLICAP_PRESENCE) && !irccmp(md->key, "away")) + continue; + + sendto_one_numeric(source_p, RPL_WHOISMETADATA, + form_str(RPL_WHOISMETADATA), + target_p->name, md->key, md->value); + } + hdata.client = source_p; hdata.target = target_p;