Mercurial > hg
comparison mcabber/src/jab_iq.c @ 1310:a5336c44d4e2
Allow vcard requests to a full jid
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Mon, 10 Sep 2007 21:56:50 +0200 |
parents | e42f48103609 |
children | e30a9d907105 |
comparison
equal
deleted
inserted
replaced
1309:887f8801418c | 1310:a5336c44d4e2 |
---|---|
674 } | 674 } |
675 | 675 |
676 void request_vcard(const char *bjid) | 676 void request_vcard(const char *bjid) |
677 { | 677 { |
678 eviqs *iqn; | 678 eviqs *iqn; |
679 char *barejid; | |
680 | |
681 barejid = jidtodisp(bjid); | |
682 | 679 |
683 // Create a new IQ structure. We use NULL for the namespace because | 680 // Create a new IQ structure. We use NULL for the namespace because |
684 // we'll have to use a special tag, not the usual "query" one. | 681 // we'll have to use a special tag, not the usual "query" one. |
685 iqn = iqs_new(JPACKET__GET, NULL, "vcard", IQS_DEFAULT_TIMEOUT); | 682 iqn = iqs_new(JPACKET__GET, NULL, "vcard", IQS_DEFAULT_TIMEOUT); |
686 xmlnode_put_attrib(iqn->xmldata, "to", barejid); | 683 xmlnode_put_attrib(iqn->xmldata, "to", bjid); |
687 // Remove the useless <query/> tag, and insert a vCard one. | 684 // Remove the useless <query/> tag, and insert a vCard one. |
688 xmlnode_hide(xmlnode_get_tag(iqn->xmldata, "query")); | 685 xmlnode_hide(xmlnode_get_tag(iqn->xmldata, "query")); |
689 xmlnode_put_attrib(xmlnode_insert_tag(iqn->xmldata, "vCard"), | 686 xmlnode_put_attrib(xmlnode_insert_tag(iqn->xmldata, "vCard"), |
690 "xmlns", NS_VCARD); | 687 "xmlns", NS_VCARD); |
691 iqn->callback = &iqscallback_vcard; | 688 iqn->callback = &iqscallback_vcard; |
692 jab_send(jc, iqn->xmldata); | 689 jab_send(jc, iqn->xmldata); |
693 | |
694 g_free(barejid); | |
695 } | 690 } |
696 | 691 |
697 static void storage_bookmarks_parse_conference(xmlnode xmldata) | 692 static void storage_bookmarks_parse_conference(xmlnode xmldata) |
698 { | 693 { |
699 const char *fjid, *name, *autojoin; | 694 const char *fjid, *name, *autojoin; |