cburschka / cadence

A strophe.js-powered XMPP web client for chatrooms.
7 stars 2 forks source link

Receiving XEP-0337 message stanzas cause an empty message to appear in chatList #334

Closed sylae closed 8 years ago

sylae commented 8 years ago

I am currently getting ligrev to beam event logs over XMPP (see this issue). Example stanza below:

<body xmlns='http://jabber.org/protocol/httpbind'>
  <message xmlns='jabber:client' from='ligrev@calref.net/jaxl#6056e12474bcd47b2ea9e3d61c225b22' to='sylae@calref.net' xml:lang='en' type='chat'>
    <log xmlns='urn:xmpp:eventlog' timestamp='2016-03-16T11:11:19+00:00' type='Debug' module='JAXL'>
      <message>Connected to XMPP Server</message>
      <tag name='jid' value='ligrev@calref.net/jaxl#6056e12474bcd47b2ea9e3d61c225b22' type='xs:string'/>
      <tag name='git' value='f6140a5ce0beefb3a2dc94f065c620151ac30d31'/>
      <tag name='file' value='/home/sylae/ligrev/ligrev.php'/>
      <tag name='line' value='25'/>
      <tag name='class'/>
      <tag name='function' value='Ligrev\{closure}'/>
    </log>
    <!-- optionally, more log elements -->
  </message>
</body>

Output received:

(05:11:25) ligrev@calref.net: (whispers) 

Presumably, this happens with any XEP that "extends" <message />.

Now, what would be really nifty is having Cadence display the debug info (with a config switch to turn off output when not debugging) but I doubt that would ever be used by literally anyone but me.

A more reasonable fix: If a message contains neither a <body /> element not a <html><body /></html> element, don't display anything.

cburschka commented 8 years ago

Yeah, there's a related issue with another message extension, let me find it.

cburschka commented 8 years ago

Right, #201 (Chat State), and the "ignore <body />-less message" fix was in #313. Looks like it's already fixed in 1.11.

cburschka commented 8 years ago

https://github.com/cburschka/cadence/commit/71d898bb50b8f480035b7af1ca46008677f80e8a

Versions after this commit should ignore the message; going to close for now.