mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 09:39:39 +02:00
More forgiving with values from incoming packets.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@1967 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
0e1a1a0feb
commit
5673eca059
4 changed files with 22 additions and 1 deletions
|
@ -276,6 +276,10 @@ public class RosterPacket extends IQ {
|
|||
public static final ItemStatus UNSUBCRIPTION_PENDING = new ItemStatus("unsubscribe");
|
||||
|
||||
public static ItemStatus fromString(String value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
value = value.toLowerCase();
|
||||
if ("unsubscribe".equals(value)) {
|
||||
return SUBSCRIPTION_PENDING;
|
||||
}
|
||||
|
@ -329,6 +333,10 @@ public class RosterPacket extends IQ {
|
|||
public static final ItemType BOTH = new ItemType("both");
|
||||
|
||||
public static ItemType fromString(String value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
value = value.toLowerCase();
|
||||
if ("none".equals(value)) {
|
||||
return NONE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue