From bbdcc0c14bd0bd3486a6f3f1219a6017579e0430 Mon Sep 17 00:00:00 2001 From: Mikael Berthe Date: Thu, 25 Feb 2010 21:26:15 +0100 Subject: [PATCH] Do not use the full JID for vcard requests (Hermitifier) --- mcabber/mcabber/commands.c | 7 +++++-- mcabber/mcabber/xmpp.c | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mcabber/mcabber/commands.c b/mcabber/mcabber/commands.c index f78feea..556fd20 100644 --- a/mcabber/mcabber/commands.c +++ b/mcabber/mcabber/commands.c @@ -3227,7 +3227,7 @@ static void do_version(char *arg) static void do_request(char *arg) { char **paramlst; - char *fjid, *type; + char *fjid, *type, *tmp; enum iqreq_type numtype = iqreq_none; char *jid_utf8 = NULL; @@ -3289,10 +3289,13 @@ static void do_request(char *arg) if (fjid) { switch (numtype) { + case iqreq_vcard: + // vCards requests are done to bare jid + tmp = strchr(fjid, JID_RESOURCE_SEPARATOR); + if (tmp) *tmp = '\0'; case iqreq_version: case iqreq_time: case iqreq_last: - case iqreq_vcard: case iqreq_ping: xmpp_request(fjid, numtype); break; diff --git a/mcabber/mcabber/xmpp.c b/mcabber/mcabber/xmpp.c index a647e4f..ff02bcf 100644 --- a/mcabber/mcabber/xmpp.c +++ b/mcabber/mcabber/xmpp.c @@ -254,8 +254,9 @@ void xmpp_request(const char *fjid, enum iqreq_type reqtype) } else return; - if (strchr(fjid, JID_RESOURCE_SEPARATOR)) { + if (strchr(fjid, JID_RESOURCE_SEPARATOR) || reqtype == iqreq_vcard) { // This is a full JID + // Or a vCard request, resource should have been stripped before xmpp_iq_request(fjid, xmlns); scr_LogPrint(LPRINT_NORMAL, "Sent %s request to <%s>", strreqtype, fjid); return; -- 2.11.4.GIT