aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/ui/ContactDetailsActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/ui/ContactDetailsActivity.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/ContactDetailsActivity.java19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/ContactDetailsActivity.java b/src/main/java/de/thedevstack/conversationsplus/ui/ContactDetailsActivity.java
index 3ca9fce7..6577c9ce 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/ContactDetailsActivity.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/ContactDetailsActivity.java
@@ -33,6 +33,7 @@ import java.security.cert.X509Certificate;
import java.util.List;
import de.thedevstack.conversationsplus.ConversationsPlusPreferences;
+import de.thedevstack.conversationsplus.generator.PresenceGenerator;
import de.thedevstack.conversationsplus.ui.listeners.ShowResourcesListDialogListener;
import de.thedevstack.conversationsplus.Config;
import de.thedevstack.conversationsplus.R;
@@ -47,6 +48,7 @@ import de.thedevstack.conversationsplus.services.XmppConnectionService.OnAccount
import de.thedevstack.conversationsplus.services.XmppConnectionService.OnRosterUpdate;
import de.thedevstack.conversationsplus.utils.CryptoHelper;
import de.thedevstack.conversationsplus.utils.UIHelper;
+import de.thedevstack.conversationsplus.utils.XmppSendUtil;
import de.thedevstack.conversationsplus.xmpp.OnKeyStatusUpdated;
import de.thedevstack.conversationsplus.xmpp.OnUpdateBlocklist;
import de.thedevstack.conversationsplus.xmpp.XmppConnection;
@@ -72,18 +74,13 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
if (isChecked) {
if (contact
.getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)) {
- xmppConnectionService.sendPresencePacket(contact
- .getAccount(),
- xmppConnectionService.getPresenceGenerator()
- .sendPresenceUpdatesTo(contact));
+ XmppSendUtil.sendPresencePacket(contact.getAccount(), PresenceGenerator.sendPresenceUpdatesTo(contact));
} else {
contact.setOption(Contact.Options.PREEMPTIVE_GRANT);
}
} else {
contact.resetOption(Contact.Options.PREEMPTIVE_GRANT);
- xmppConnectionService.sendPresencePacket(contact.getAccount(),
- xmppConnectionService.getPresenceGenerator()
- .stopPresenceUpdatesTo(contact));
+ XmppSendUtil.sendPresencePacket(contact.getAccount(), PresenceGenerator.stopPresenceUpdatesTo(contact));
}
}
};
@@ -93,13 +90,9 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
if (isChecked) {
- xmppConnectionService.sendPresencePacket(contact.getAccount(),
- xmppConnectionService.getPresenceGenerator()
- .requestPresenceUpdatesFrom(contact));
+ XmppSendUtil.sendPresencePacket(contact.getAccount(), PresenceGenerator.requestPresenceUpdatesFrom(contact));
} else {
- xmppConnectionService.sendPresencePacket(contact.getAccount(),
- xmppConnectionService.getPresenceGenerator()
- .stopPresenceUpdatesFrom(contact));
+ XmppSendUtil.sendPresencePacket(contact.getAccount(), PresenceGenerator.stopPresenceUpdatesFrom(contact));
}
}
};