From ad601e47c8eb17d1c939c329bde4866d9ec5fc9e Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 28 Jul 2017 18:34:55 +0200 Subject: [PATCH] fixed roster items w/o subscription (request) not being shown --- .../siacs/conversations/parser/IqParser.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/parser/IqParser.java b/src/main/java/eu/siacs/conversations/parser/IqParser.java index 7e8bbcba1..7719ec701 100644 --- a/src/main/java/eu/siacs/conversations/parser/IqParser.java +++ b/src/main/java/eu/siacs/conversations/parser/IqParser.java @@ -59,16 +59,14 @@ public class IqParser extends AbstractParser implements OnIqPacketReceived { contact.setServerName(name); contact.parseGroupsFromElement(item); } - if (subscription != null) { - if (subscription.equals("remove")) { - contact.resetOption(Contact.Options.IN_ROSTER); - contact.resetOption(Contact.Options.DIRTY_DELETE); - contact.resetOption(Contact.Options.PREEMPTIVE_GRANT); - } else { - contact.setOption(Contact.Options.IN_ROSTER); - contact.resetOption(Contact.Options.DIRTY_PUSH); - contact.parseSubscriptionFromElement(item); - } + if ("remove".equals(subscription)) { + contact.resetOption(Contact.Options.IN_ROSTER); + contact.resetOption(Contact.Options.DIRTY_DELETE); + contact.resetOption(Contact.Options.PREEMPTIVE_GRANT); + } else { + contact.setOption(Contact.Options.IN_ROSTER); + contact.resetOption(Contact.Options.DIRTY_PUSH); + contact.parseSubscriptionFromElement(item); } boolean both = contact.getOption(Contact.Options.TO) && contact.getOption(Contact.Options.FROM); if ((both != bothPre) && both) {