mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-12-22 20:47:57 +01:00
Use switch-case in Roster.hasValidSubscriptionType()
This commit is contained in:
parent
61cc6a36da
commit
d7d4c8a4fd
1 changed files with 9 additions and 4 deletions
|
@ -844,10 +844,15 @@ public class Roster {
|
|||
* This is used by {@link RosterPushListener} and {@link RosterResultListener}.
|
||||
* */
|
||||
private static boolean hasValidSubscriptionType(RosterPacket.Item item) {
|
||||
return item.getItemType().equals(RosterPacket.ItemType.none)
|
||||
|| item.getItemType().equals(RosterPacket.ItemType.from)
|
||||
|| item.getItemType().equals(RosterPacket.ItemType.to)
|
||||
|| item.getItemType().equals(RosterPacket.ItemType.both);
|
||||
switch (item.getItemType()) {
|
||||
case none:
|
||||
case from:
|
||||
case to:
|
||||
case both:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isRosterVersioningSupported() {
|
||||
|
|
Loading…
Reference in a new issue