Bug report: "urn:xmpp:delay" not supported

Hi,

while debugging time stamps in chat room I found following bug:

xml parser skips all attributes from unknown entities.

for instance in this message

hey, I see that the hover over a room member list now shows the online names. Thx!


is “urn:xmpp:delay” wrongly interpreted. Stamp attribute is completely ignored. Maybe it can be fixed by my patch. But I didn’t test it at all. Second issue is, that “urn:xmpp:delay” should be officially supported, since it replaces older “jabber:x:delay”. Implementation is easy - just update DelayInformationProvider to support little bit different time format:

SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSz");
formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
String stampString = parser.getAttributeValue("", "stamp");
String modifed = stampString.substring(0, stampString.length() - 6) + "GMT" + stampString.substring(stampString.length() - 6);
 stamp = formatter.parse(modifed);

smack.patch (1216 Bytes)

I ran into the same thing while writing pubsub extensions . I have also included a fix for this. In my case, I created a new PacketExtensionProvider for reading the new delay format. This provider still returns a DelayInformation instance, so it makes any client code still compatible with both delay schemas.