diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-08-05 22:58:46 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-08-05 22:58:46 +0200 |
commit | ba63727f50c192e63e171bedca92d7003981800c (patch) | |
tree | 6b4956817a46266ec3de683bc6d7a4e46681a656 /src/eu/siacs/conversations/generator | |
parent | 08755e56a5bf861c97eefd545f629ac67a804275 (diff) |
fetch missing avatars from server
Diffstat (limited to 'src/eu/siacs/conversations/generator')
-rw-r--r-- | src/eu/siacs/conversations/generator/IqGenerator.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/generator/IqGenerator.java b/src/eu/siacs/conversations/generator/IqGenerator.java index 1a38347b..c4d84020 100644 --- a/src/eu/siacs/conversations/generator/IqGenerator.java +++ b/src/eu/siacs/conversations/generator/IqGenerator.java @@ -39,6 +39,15 @@ public class IqGenerator extends AbstractGenerator { return packet; } + protected IqPacket retrieve(String node, Element item) { + IqPacket packet = new IqPacket(IqPacket.TYPE_GET); + Element pubsub = packet.addChild("pubsub", "http://jabber.org/protocol/pubsub"); + Element items = pubsub.addChild("items"); + items.setAttribute("node", node); + items.addChild(item); + return packet; + } + public IqPacket publishAvatar(Avatar avatar) { Element item = new Element("item"); item.setAttribute("id", avatar.sha1sum); @@ -59,4 +68,12 @@ public class IqGenerator extends AbstractGenerator { info.setAttribute("type", avatar.type); return publish("urn:xmpp:avatar:metadata",item); } + + public IqPacket retrieveAvatar(Avatar avatar) { + Element item = new Element("item"); + item.setAttribute("id", avatar.sha1sum); + IqPacket packet = retrieve("urn:xmpp:avatar:data", item); + packet.setTo(avatar.owner); + return packet; + } } |