From 0b26452666ca89859566203c1d3abe7194509303 Mon Sep 17 00:00:00 2001 From: Gaston Dombiak Date: Tue, 10 Feb 2004 15:39:36 +0000 Subject: [PATCH] 1. The packet id is parsed while parsing Messages 2. Parsed Messages and Presences could now have EMPTY ids git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2224 b35dd754-fafc-0310-a699-88a17e54d16e --- source/org/jivesoftware/smack/PacketReader.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/org/jivesoftware/smack/PacketReader.java b/source/org/jivesoftware/smack/PacketReader.java index be785d388..eea036ca4 100644 --- a/source/org/jivesoftware/smack/PacketReader.java +++ b/source/org/jivesoftware/smack/PacketReader.java @@ -653,6 +653,8 @@ class PacketReader { */ private Packet parseMessage(XmlPullParser parser) throws Exception { Message message = new Message(); + String id = parser.getAttributeValue("", "id"); + message.setPacketID(id == null ? Packet.ID_NOT_AVAILABLE : id); message.setTo(parser.getAttributeValue("", "to")); message.setFrom(parser.getAttributeValue("", "from")); message.setType(Message.Type.fromString(parser.getAttributeValue("", "type"))); @@ -730,7 +732,8 @@ class PacketReader { Presence presence = new Presence(type); presence.setTo(parser.getAttributeValue("", "to")); presence.setFrom(parser.getAttributeValue("", "from")); - presence.setPacketID(parser.getAttributeValue("", "id")); + String id = parser.getAttributeValue("", "id"); + presence.setPacketID(id == null ? Packet.ID_NOT_AVAILABLE : id); // Parse sub-elements boolean done = false;