From dda1f862f0d96571e1353e4deefe10bb57a7d269 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Fri, 29 Jun 2018 22:27:28 +0200 Subject: code clean up in contact details presence handling --- .../de/pixart/messenger/ui/ContactDetailsActivity.java | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/main/java/de/pixart/messenger/ui') diff --git a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java index 6ce1e7e70..11cf78858 100644 --- a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java @@ -72,23 +72,16 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp private OnCheckedChangeListener mOnSendCheckedChange = new OnCheckedChangeListener() { @Override - public void onCheckedChanged(CompoundButton buttonView, - boolean isChecked) { + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { - if (contact - .getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)) { - xmppConnectionService.sendPresencePacket(contact - .getAccount(), - xmppConnectionService.getPresenceGenerator() - .sendPresenceUpdatesTo(contact)); + if (contact.getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)) { + xmppConnectionService.sendPresencePacket(contact.getAccount(), xmppConnectionService.getPresenceGenerator().sendPresenceUpdatesTo(contact)); } else { contact.setOption(Contact.Options.PREEMPTIVE_GRANT); } } else { contact.resetOption(Contact.Options.PREEMPTIVE_GRANT); - xmppConnectionService.sendPresencePacket(contact.getAccount(), - xmppConnectionService.getPresenceGenerator() - .stopPresenceUpdatesTo(contact)); + xmppConnectionService.sendPresencePacket(contact.getAccount(), xmppConnectionService.getPresenceGenerator().stopPresenceUpdatesTo(contact)); } } }; -- cgit v1.2.3