5.2.23
06/10/2023

[#182] PubSub Subscription fails to call handleMessage
Summary PubSub Subscription fails to call handleMessage
Queue gloox
Queue Version 1.0
Type Bug
State Unconfirmed
Priority 2. Medium
Owners
Requester rjackson78746 (at) yahoo (dot) com
Created 05/27/2010 (4762 days ago)
Due 05/27/2010 (4762 days ago)
Updated 05/27/2010 (4762 days ago)
Assigned
Resolved

History
05/27/2010 05:14:24 PM rjackson78746 (at) yahoo (dot) com Comment #1
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ PubSub Subscription fails to call handleMessage
Due ⇒ 05/27/2010
Queue ⇒ gloox
New Attachment: messagesession.cpp.patch
Reply to this comment
Version:     gloox 1.0
File:     messagesession.cpp
Function: void MessageSession::handleMessage( Message& msg )
Line:     50
Description:
Running pubsub. On Subscription event.
The validation that the msg has a body element is preventing the 
'handleMessage' from being called.
The additional check for a non-empty body seems unnecessary because 
validation is already done in clientbase.cpp (line 1432)
Not sure if I created the patch file correctly. I ran "diff -c 
<original version> <modified version>"

Additional Info
=================================================================
Original code:
======================================================
if( m_messageHandler && !msg.body().empty() )
    m_messageHandler->handleMessage( msg, this );
======================================================
Modified Code:
======================================================
if( m_messageHandler)
    m_messageHandler->handleMessage( msg, this );

======================================================
Log of Data published (I've indented for readability):
======================================================
<iq to='pubsub.bruhl' id='uid:4bfe8c8c:2eb141f2' type='set' 
from='dds@bruhl/ddsbridge' xmlns='jabber:client'>
   <pubsub xmlns='http://jabber.org/protocol/pubsub'>
     <publish node='lvtstatus'>
         <item>
           <entry>
             green eggs and ham
           </entry>
         </item>
     </publish>
   </pubsub>
</iq>

======================================================
Log of data received (I've indented for readability):
======================================================
<message from='pubsub.bruhl' to='dds@bruhl/subscriber'>
   <event xmlns='http://jabber.org/protocol/pubsub#event'>
     <items node='lvtstatus'>
       <item id='4FAEEB27EA604'>
         <entry>
           green eggs and ham
         </entry>
       </item>
     </items>
   </event>
   <delay xmlns='urn:xmpp:delay' from='dds@bruhl/ddsbridge' 
stamp='2010-05-27T16:28:23Z'/>
</message>