I'm writing an xmpp bot in scala I am unable to send an xmpp message to display a notification. I was unable to find any documentation in regards to hipchats custom stanzas. I am using smack 4.1.7
Here is the message I see when I send a notif via curl:
<message
to='17702_2503775@chat.hipchat.com/bot||proxy|pubproxy-d300.hipchat.com|5262'
from='17702_testbot@conf.hipchat.com/BuildBot' type='groupchat'>
<body><pre>hello world</pre></body>
<x xmlns='http://hipchat.com/protocol/muc#room'>
<message_format>html</message_format>
<color>yellow</color>
<type>system</type>
<notify>0</notify>
</x>
<html xmlns='http://jabber.org/protocol/xhtml-im'>
<body xmlns='http://www.w3.org/1999/xhtml'>
<pre>hello world</pre>
</body>
</html>
</message>
So I constructed and sent this message:
<message
to='17702_testbot_1@conf.hipchat.com'
id='rHeL8-678'
type='groupchat'>
<body><pre>hello world</pre></body>
<x xmlns='http://hipchat.com/protocol/muc#room'>
<message_format>html</message_format>
<color>yellow</color>
<type>system</type>
<notify>0</notify>
</x>
<html xmlns='http://jabber.org/protocol/xhtml-im'>
<body xmlns='http://www.w3.org/1999/xhtml'>
<pre>hello world</pre>
</body>
</html>
</message>
HipChat does support xhtml-im for 1-1 conversations. Here's an example stanza:
<message to='10804_51380@chat.hipchat.com' id='325323535' type='chat'> <body>Unstyled message</body> <html xmlns='http://jabber.org/protocol/xhtml-im'> <body xmlns='http://www.w3.org/1999/xhtml'> <p> Styled message<br/> <a href='a'>https://google.com'>a link</a><br/> <b>&lt;b&gt;</b> and <strong>&lt;strong&gt;</strong> and <em>&lt;em&gt;</em> and <i>&lt;i&gt;</i> and <code>&lt;code&gt;</code><br/> <pre> console.log('Hello Vito!') </pre> <span style='color:red'>This is red</span> <table> <thead> <tr> <th>a</th> <th>b</th> <th>c</th> </tr> </thead> <tbody> <tr> <td>d</td> <td>e</td> <td>f</td> </tr> </tbody> </table> <ul> <li>1</li> <li>2</li> <li>3</li> </ul> <ol> <li>1</li> <li>2</li> <li>3</li> </ol> <hc-mention>@rich</hc-mention> <hc-mention>@vito</hc-mention><br/> <img src='https://cdn.meme.am/instances/57918848.jpg' alt='meme' height='50' width='50' align='right' style='border:1px;solid:red' /><br/> <span style='text-decoration:line-through'>redacted</span> </p> </body> </html> </message>
One thing to note is for this to work, your styled body needs to be inside the html>body>p tag.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.