1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-27 14:47:59 +01:00

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
This commit is contained in:
Gaston Dombiak 2004-02-10 15:39:36 +00:00 committed by gdombiak
parent 627b38fe5b
commit 0b26452666

View file

@ -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;