aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/parser/PresenceParser.java
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-07-12 03:44:23 +0200
committeriNPUTmice <daniel@gultsch.de>2014-07-12 03:44:23 +0200
commit99935dd630b59d6cff05714c888b01e4c88c6351 (patch)
treee84968da60ea8bc8f117bed39cf430259f9958aa /src/eu/siacs/conversations/parser/PresenceParser.java
parent789383e5cb900baf55595e91f47f6d3ab4cec75e (diff)
moved most of the message/presence generation into seperate classes
Diffstat (limited to 'src/eu/siacs/conversations/parser/PresenceParser.java')
-rw-r--r--src/eu/siacs/conversations/parser/PresenceParser.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/parser/PresenceParser.java b/src/eu/siacs/conversations/parser/PresenceParser.java
index b050f4ca..8fb97bd8 100644
--- a/src/eu/siacs/conversations/parser/PresenceParser.java
+++ b/src/eu/siacs/conversations/parser/PresenceParser.java
@@ -5,6 +5,7 @@ import eu.siacs.conversations.entities.Account;
import eu.siacs.conversations.entities.Contact;
import eu.siacs.conversations.entities.Conversation;
import eu.siacs.conversations.entities.Presences;
+import eu.siacs.conversations.generator.PresenceGenerator;
import eu.siacs.conversations.services.XmppConnectionService;
import eu.siacs.conversations.xml.Element;
import eu.siacs.conversations.xmpp.OnPresencePacketReceived;
@@ -13,8 +14,11 @@ import eu.siacs.conversations.xmpp.stanzas.PresencePacket;
public class PresenceParser extends AbstractParser implements
OnPresencePacketReceived {
+ private PresenceGenerator mPresenceGenerator;
+
public PresenceParser(XmppConnectionService service) {
super(service);
+ mPresenceGenerator = service.getPresenceGenerator();
}
public void parseConferencePresence(PresencePacket packet, Account account) {
@@ -91,11 +95,10 @@ public class PresenceParser extends AbstractParser implements
.onContactStatusChanged(contact, false);
} else if (type.equals("subscribe")) {
if (contact.getOption(Contact.Options.PREEMPTIVE_GRANT)) {
- mXmppConnectionService.sendPresenceUpdatesTo(contact);
+ mXmppConnectionService.sendPresencePacket(account, mPresenceGenerator.stopPresenceUpdatesTo(contact));
if ((contact.getOption(Contact.Options.ASKING))
&& (!contact.getOption(Contact.Options.TO))) {
- mXmppConnectionService
- .requestPresenceUpdatesFrom(contact);
+ mXmppConnectionService.sendPresencePacket(account,mPresenceGenerator.requestPresenceUpdatesFrom(contact));
}
} else {
contact.setOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST);