powered by Jive Software

StanzaIdElement does not recognise stanza-id elements


#1

Smack version 4.3.2

I have the following if statement in a StanzaAcknowledgedListener.

if (StanzaIdElement.hasStanzaId(message)) ...

The if statement above returns false for the message received below:

<a xmlns='urn:xmpp:sm:3' h='305'/>
<message from='e4aec989-3e20-4846-83bf-f50df89b5d07@muclight.example.com/user1@example.com' to='user1@example.com' id='6b71fe3a-3cb2-489c-9c8e-b6879761d15e' type='groupchat'>
  <body>Test message</body>
  <markable xmlns='urn:xmpp:chat-markers:0'/>
  <stanza-id by='e4aec989-3e20-4846-83bf-f50df89b5d07@muclight.example.com' id='B0KK24ETVC81' xmlns='urn:xmpp:sid:0'/>
  <stanza-id by='user1@example.com' id='B0KK24EV89G1' xmlns='urn:xmpp:sid:0'/>
</message><r xmlns='urn:xmpp:sm:3'/>

StanzaIdElement.hasStanzaId someshow cannot recognise the stanza-id elements. What am I doing wrong?

Please advise.

Many thanks in advance.


#2

I am unable to reproduce this: The following (junit) test is successful with Smack 4.3.2 when I run it:

@Test
public void testMultipleUssidExtensions() throws Exception {
    String message =
                   "<message xmlns='jabber:client' from='e4aec989-3e20-4846-83bf-f50df89b5d07@muclight.example.com/user1@example.com' to='user1@example.com' id='6b71fe3a-3cb2-489c-9c8e-b6879761d15e' type='groupchat'>" + 
                      "<body>Test message</body>" + 
                      "<markable xmlns='urn:xmpp:chat-markers:0'/>" + 
                      "<stanza-id by='e4aec989-3e20-4846-83bf-0df89b5d07@muclight.example.com' id='B0KK24ETVC81' xmlns='urn:xmpp:sid:0'/>" + 
                      "<stanza-id by='user1@example.com' id='B0KK24EV89G1' xmlns='urn:xmpp:sid:0'/>" + 
                    "</message>";
     Message messageStanza = PacketParserUtils.parseStanza(message);

    assertTrue(StanzaIdElement.hasStanzaId(messageStanza));
}

#3

My apologies for the misleading information. It seems the processStanza(Stanza packet) callback never received the XML (or the stanza-id by attributes were stripped).

At the risk of sounding pedantic, the processStanza(Stanza packet) callback is in StanzaAcknowledgedListener.

Did I misunderstand or miss a step to cause this to happen?

Many thanks in advance.


#4

That sounds like the Provider for <stanza-id/> is not registered.


#5

Uhm, how would I remedy that?


closed #6

This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.