1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-10 18:59:41 +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:
Matt Tucker 2003-06-19 14:40:48 +00:00 committed by mtucker
parent 0e1a1a0feb
commit 5673eca059
4 changed files with 22 additions and 1 deletions

View file

@ -252,6 +252,10 @@ public class Presence extends Packet {
* Returns the type constant associated with the String value.
*/
public static Type fromString(String value) {
if (value == null) {
return AVAILABLE;
}
value = value.toLowerCase();
if ("unavailable".equals(value)) {
return UNAVAILABLE;
}
@ -306,7 +310,8 @@ public class Presence extends Packet {
if (value == null) {
return AVAILABLE;
}
else if (value.equals("chat")) {
value = value.toLowerCase();
if (value.equals("chat")) {
return CHAT;
}
else if (value.equals("away")) {