comparison mcabber/mcabber/commands.c @ 1722:b18142457ca9

Fix vCard requests in MUC rooms
author Mikael Berthe <mikael@lilotux.net>
date Sun, 28 Feb 2010 11:33:39 +0100
parents 98d99485d276
children 318c64ceb494
comparison
equal deleted inserted replaced
1721:8cfc2a386b1f 1722:b18142457ca9
3225 } 3225 }
3226 3226
3227 static void do_request(char *arg) 3227 static void do_request(char *arg)
3228 { 3228 {
3229 char **paramlst; 3229 char **paramlst;
3230 char *fjid, *type, *tmp; 3230 char *fjid, *type;
3231 enum iqreq_type numtype = iqreq_none; 3231 enum iqreq_type numtype = iqreq_none;
3232 char *jid_utf8 = NULL; 3232 char *jid_utf8 = NULL;
3233 3233
3234 paramlst = split_arg(arg, 2, 0); // type, jid 3234 paramlst = split_arg(arg, 2, 0); // type, jid
3235 type = *paramlst; 3235 type = *paramlst;
3288 } 3288 }
3289 3289
3290 if (fjid) { 3290 if (fjid) {
3291 switch (numtype) { 3291 switch (numtype) {
3292 case iqreq_vcard: 3292 case iqreq_vcard:
3293 // vCards requests are done to bare jid 3293 { // vCards requests are sent to the bare jid, except in MUC rooms
3294 tmp = strchr(fjid, JID_RESOURCE_SEPARATOR); 3294 gchar *tmp = strchr(fjid, JID_RESOURCE_SEPARATOR);
3295 if (tmp) *tmp = '\0'; 3295 if (tmp) {
3296 gchar *bjid = jidtodisp(fjid);
3297 if (!roster_find(bjid, jidsearch, ROSTER_TYPE_ROOM))
3298 *tmp = '\0';
3299 g_free(bjid);
3300 }
3301 }
3296 case iqreq_version: 3302 case iqreq_version:
3297 case iqreq_time: 3303 case iqreq_time:
3298 case iqreq_last: 3304 case iqreq_last:
3299 case iqreq_ping: 3305 case iqreq_ping:
3300 xmpp_request(fjid, numtype); 3306 xmpp_request(fjid, numtype);