mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-26 08:12:05 +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}.
|
* This is used by {@link RosterPushListener} and {@link RosterResultListener}.
|
||||||
* */
|
* */
|
||||||
private static boolean hasValidSubscriptionType(RosterPacket.Item item) {
|
private static boolean hasValidSubscriptionType(RosterPacket.Item item) {
|
||||||
return item.getItemType().equals(RosterPacket.ItemType.none)
|
switch (item.getItemType()) {
|
||||||
|| item.getItemType().equals(RosterPacket.ItemType.from)
|
case none:
|
||||||
|| item.getItemType().equals(RosterPacket.ItemType.to)
|
case from:
|
||||||
|| item.getItemType().equals(RosterPacket.ItemType.both);
|
case to:
|
||||||
|
case both:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isRosterVersioningSupported() {
|
private boolean isRosterVersioningSupported() {
|
||||||
|
|
Loading…
Reference in a new issue