use of de.pixart.messenger.xml.Element in project Pix-Art-Messenger by kriztan.
the class IqGenerator method pubsubConfiguration.
private IqPacket pubsubConfiguration(Jid jid, String node, Data data) {
IqPacket packet = new IqPacket(data == null ? IqPacket.TYPE.GET : IqPacket.TYPE.SET);
packet.setTo(jid);
Element pubsub = packet.addChild("pubsub", "http://jabber.org/protocol/pubsub#owner");
Element configure = pubsub.addChild("configure").setAttribute("node", node);
if (data != null) {
configure.addChild(data);
}
return packet;
}
use of de.pixart.messenger.xml.Element in project Pix-Art-Messenger by kriztan.
the class IqGenerator method generateCreateAccountWithCaptcha.
public IqPacket generateCreateAccountWithCaptcha(Account account, String id, Data data) {
final IqPacket register = new IqPacket(IqPacket.TYPE.SET);
register.setFrom(account.getJid().toBareJid());
register.setTo(account.getServer());
register.setId(id);
Element query = register.query("jabber:iq:register");
if (data != null) {
query.addChild(data);
}
return register;
}
use of de.pixart.messenger.xml.Element in project Pix-Art-Messenger by kriztan.
the class MessageGenerator method confirm.
public MessagePacket confirm(final Account account, final Jid to, final String id, final Jid counterpart, final boolean groupChat) {
MessagePacket packet = new MessagePacket();
packet.setType(groupChat ? MessagePacket.TYPE_GROUPCHAT : MessagePacket.TYPE_CHAT);
packet.setTo(groupChat ? to.toBareJid() : to);
packet.setFrom(account.getJid());
Element displayed = packet.addChild("displayed", "urn:xmpp:chat-markers:0");
displayed.setAttribute("id", id);
if (groupChat && counterpart != null) {
displayed.setAttribute("sender", counterpart.toPreppedString());
}
packet.addChild("store", "urn:xmpp:hints");
return packet;
}
use of de.pixart.messenger.xml.Element in project Pix-Art-Messenger by kriztan.
the class MessageGenerator method addDelay.
public void addDelay(MessagePacket packet, long timestamp) {
final SimpleDateFormat mDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US);
mDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
Element delay = packet.addChild("delay", "urn:xmpp:delay");
Date date = new Date(timestamp);
delay.setAttribute("stamp", mDateFormat.format(date));
}
use of de.pixart.messenger.xml.Element in project Pix-Art-Messenger by kriztan.
the class Bookmark method setNick.
public void setNick(String nick) {
Element element = this.findChild("nick");
if (element == null) {
element = this.addChild("nick");
}
element.setContent(nick);
}
Aggregations