From 94933e21cd08c53a23e5ec6c12bc1dc383b1f3ce Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Fri, 29 Jul 2016 19:52:37 +0200 Subject: changed package id inside manifest and project --- .../conversations/generator/PresenceGenerator.java | 67 ---------------------- 1 file changed, 67 deletions(-) delete mode 100644 src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java (limited to 'src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java') diff --git a/src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java b/src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java deleted file mode 100644 index f9fed9140..000000000 --- a/src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java +++ /dev/null @@ -1,67 +0,0 @@ -package eu.siacs.conversations.generator; - -import eu.siacs.conversations.entities.Account; -import eu.siacs.conversations.entities.Contact; -import eu.siacs.conversations.entities.Presence; -import eu.siacs.conversations.services.XmppConnectionService; -import eu.siacs.conversations.xml.Element; -import eu.siacs.conversations.xmpp.stanzas.PresencePacket; - -public class PresenceGenerator extends AbstractGenerator { - - public PresenceGenerator(XmppConnectionService service) { - super(service); - } - - private PresencePacket subscription(String type, Contact contact) { - PresencePacket packet = new PresencePacket(); - packet.setAttribute("type", type); - packet.setTo(contact.getJid()); - packet.setFrom(contact.getAccount().getJid().toBareJid()); - return packet; - } - - public PresencePacket requestPresenceUpdatesFrom(Contact contact) { - return subscription("subscribe", contact); - } - - public PresencePacket stopPresenceUpdatesFrom(Contact contact) { - return subscription("unsubscribe", contact); - } - - public PresencePacket stopPresenceUpdatesTo(Contact contact) { - return subscription("unsubscribed", contact); - } - - public PresencePacket sendPresenceUpdatesTo(Contact contact) { - return subscription("subscribed", contact); - } - - public PresencePacket selfPresence(Account account, Presence.Status status) { - PresencePacket packet = new PresencePacket(); - if(status.toShowString() != null) { - packet.addChild("show").setContent(status.toShowString()); - } - packet.setFrom(account.getJid()); - String sig = account.getPgpSignature(); - if (sig != null && mXmppConnectionService.getPgpEngine() != null) { - packet.addChild("x", "jabber:x:signed").setContent(sig); - } - String capHash = getCapHash(); - if (capHash != null) { - Element cap = packet.addChild("c", - "http://jabber.org/protocol/caps"); - cap.setAttribute("hash", "sha-1"); - cap.setAttribute("node", "http://conversations.im"); - cap.setAttribute("ver", capHash); - } - return packet; - } - - public PresencePacket sendOfflinePresence(Account account) { - PresencePacket packet = new PresencePacket(); - packet.setFrom(account.getJid()); - packet.setAttribute("type","unavailable"); - return packet; - } -} -- cgit v1.2.3