diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-11-23 13:51:53 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-11-23 13:55:13 +0100 |
commit | 06ada3372ea812adb3ea1233bc6e224f7ba3de8b (patch) | |
tree | 4b6f9c09aa5804f85da4b1dd6c95534b77407d45 /src/main/java/de/pixart/messenger/generator | |
parent | b2969350c6b9ff64c9ae14fb7edcdcc5e69d7ae2 (diff) |
added interface to edit nick
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/generator/AbstractGenerator.java | 2 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/generator/IqGenerator.java | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/generator/AbstractGenerator.java b/src/main/java/de/pixart/messenger/generator/AbstractGenerator.java index ac57c74d1..710a4fb8e 100644 --- a/src/main/java/de/pixart/messenger/generator/AbstractGenerator.java +++ b/src/main/java/de/pixart/messenger/generator/AbstractGenerator.java @@ -35,7 +35,7 @@ public abstract class AbstractGenerator { "http://jabber.org/protocol/caps", "http://jabber.org/protocol/disco#info", "urn:xmpp:avatar:metadata+notify", - "http://jabber.org/protocol/nick+notify", + Namespace.NICK + "+notify", Namespace.BOOKMARKS + "+notify", "urn:xmpp:ping", "jabber:iq:version", diff --git a/src/main/java/de/pixart/messenger/generator/IqGenerator.java b/src/main/java/de/pixart/messenger/generator/IqGenerator.java index 86f58af69..cb56d66a8 100644 --- a/src/main/java/de/pixart/messenger/generator/IqGenerator.java +++ b/src/main/java/de/pixart/messenger/generator/IqGenerator.java @@ -126,8 +126,15 @@ public class IqGenerator extends AbstractGenerator { public IqPacket publishNick(String nick) { final Element item = new Element("item"); - item.addChild("nick", "http://jabber.org/protocol/nick").setContent(nick); - return publish("http://jabber.org/protocol/nick", item); + item.addChild("nick", Namespace.NICK).setContent(nick); + return publish(Namespace.NICK, item); + } + + public IqPacket deleteNode(String node) { + IqPacket packet = new IqPacket(IqPacket.TYPE.SET); + final Element pubsub = packet.addChild("pubsub", Namespace.PUBSUB_OWNER); + pubsub.addChild("delete").setAttribute("node", node); + return packet; } public IqPacket publishAvatar(Avatar avatar) { |