mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 01:29:38 +02:00
Use new presence types.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@1794 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
e83cc69730
commit
642396a100
3 changed files with 11 additions and 12 deletions
|
@ -440,16 +440,15 @@ public class PacketReader {
|
|||
* @throws Exception if an exception occurs while parsing the packet.
|
||||
*/
|
||||
private static Packet parsePresence(XmlPullParser parser) throws Exception {
|
||||
String type = parser.getAttributeValue("", "type");
|
||||
// If the type value isn't set, it should default to available.
|
||||
if (type == null) {
|
||||
type = "available";
|
||||
}
|
||||
Presence.Type type = Presence.Type.fromString(parser.getAttributeValue("", "type"));
|
||||
// We only handle "available" or "unavailable" packets for now.
|
||||
if (!(type.equals("available") || type.equals("unavailable"))) {
|
||||
if (!(type == Presence.Type.AVAILABLE || type == Presence.Type.UNAVAILABLE)) {
|
||||
System.out.println("FOUND OTHER PRESENCE TYPE: " + type);
|
||||
}
|
||||
Presence presence = new Presence("available".equals(type));
|
||||
|
||||
// Otherwise, it's a presence packet that has nothing to do with roster items.
|
||||
|
||||
Presence presence = new Presence(type);
|
||||
presence.setTo(parser.getAttributeValue("", "to"));
|
||||
presence.setFrom(parser.getAttributeValue("", "from"));
|
||||
presence.setPacketID(parser.getAttributeValue("", "id"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue