summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Aurich <darkrain42@pidgin.im>2009-11-13 19:00:03 +0000
committerPaul Aurich <darkrain42@pidgin.im>2009-11-13 19:00:03 +0000
commitf77d6d27bb86d4254fdabddbb43ae2d6165c23a6 (patch)
tree987ce83d0b38f929f19bbb812a69d379ad56094e
parentc17d89e94d237ed0d5f86ebd296292944549da50 (diff)
downloadpidgin-f77d6d27bb86d4254fdabddbb43ae2d6165c23a6.tar.gz
jabber: Properly request just the most recent item from a PEP node.
-rw-r--r--libpurple/protocols/jabber/pep.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libpurple/protocols/jabber/pep.c b/libpurple/protocols/jabber/pep.c
index b7013a344c..25aeecc70c 100644
--- a/libpurple/protocols/jabber/pep.c
+++ b/libpurple/protocols/jabber/pep.c
@@ -87,7 +87,7 @@ do_pep_iq_request_item_callback(JabberStream *js, const char *from,
void jabber_pep_request_item(JabberStream *js, const char *to, const char *node, const char *id, JabberPEPHandler cb) {
JabberIq *iq = jabber_iq_new(js, JABBER_IQ_GET);
- xmlnode *pubsub, *items, *item;
+ xmlnode *pubsub, *items;
xmlnode_set_attrib(iq->node,"to",to);
pubsub = xmlnode_new_child(iq->node,"pubsub");
@@ -97,9 +97,12 @@ void jabber_pep_request_item(JabberStream *js, const char *to, const char *node,
items = xmlnode_new_child(pubsub, "items");
xmlnode_set_attrib(items,"node",node);
- item = xmlnode_new_child(items, "item");
- if(id)
+ if (id) {
+ xmlnode *item = xmlnode_new_child(items, "item");
xmlnode_set_attrib(item, "id", id);
+ } else
+ /* Most recent item */
+ xmlnode_set_attrib(items, "max_items", "1");
jabber_iq_set_callback(iq,do_pep_iq_request_item_callback,(gpointer)cb);