use of de.pixart.messenger.xml.Element in project Pix-Art-Messenger by kriztan.
the class IqGenerator method publishNick.
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);
}
use of de.pixart.messenger.xml.Element in project Pix-Art-Messenger by kriztan.
the class IqGenerator method publishAvatar.
public IqPacket publishAvatar(Avatar avatar) {
final Element item = new Element("item");
item.setAttribute("id", avatar.sha1sum);
final Element data = item.addChild("data", "urn:xmpp:avatar:data");
data.setContent(avatar.image);
return publish("urn:xmpp:avatar:data", item);
}
use of de.pixart.messenger.xml.Element in project Pix-Art-Messenger by kriztan.
the class IqGenerator method generateSetUnblockRequest.
public IqPacket generateSetUnblockRequest(final Jid jid) {
final IqPacket iq = new IqPacket(IqPacket.TYPE.SET);
final Element block = iq.addChild("unblock", Namespace.BLOCKING);
block.addChild("item").setAttribute("jid", jid.toBareJid().toString());
return iq;
}
use of de.pixart.messenger.xml.Element in project Pix-Art-Messenger by kriztan.
the class IqGenerator method enablePush.
public IqPacket enablePush(Jid jid, String node, String secret) {
IqPacket packet = new IqPacket(IqPacket.TYPE.SET);
Element enable = packet.addChild("enable", "urn:xmpp:push:0");
enable.setAttribute("jid", jid.toString());
enable.setAttribute("node", node);
Data data = new Data();
data.setFormType("http://jabber.org/protocol/pubsub#publish-options");
data.put("secret", secret);
data.submit();
enable.addChild(data);
return packet;
}
use of de.pixart.messenger.xml.Element in project Pix-Art-Messenger by kriztan.
the class MessageGenerator method conferenceSubject.
public MessagePacket conferenceSubject(Conversation conversation, String subject) {
MessagePacket packet = new MessagePacket();
packet.setType(MessagePacket.TYPE_GROUPCHAT);
packet.setTo(conversation.getJid().toBareJid());
Element subjectChild = new Element("subject");
subjectChild.setContent(subject);
packet.addChild(subjectChild);
packet.setFrom(conversation.getAccount().getJid().toBareJid());
return packet;
}
Aggregations