I writing a bot and need to send a couple of html formatted messages, but what is possible seems to be pretty basic.
First of all, Is this documented somewhere?
- Is it possible to render an html table with borders? I've been trying inline styles with no luck
- What about consistency among devices? I've managed to render a <table> in hipchat desktop, but on iOS it is totally ignored.
- And regarding how hipchat manages xmpp stanzas:
<message to='some-id' type='chat'> <body>dummy</body> <html xmlns='http://jabber.org/protocol/xhtml-im'> <body xmlns='http://www.w3.org/1999/xhtml'> <b> this is the message text</b> </body> </html> </message>
If I don't add the `<body>dummy</body>` tag there, the html message won't get displayed. Is this on purpose or it is a bug?
thanks in advance!
Support for the XHTML-IM XEP is pretty basic and isn't something we document specifically, since we only use it behind the scenes (and like you've noticed, it's not necessarily fleshed out on all platforms, like mobile).
I believe including the <body> element is a requirement on the server side (certainly most of the examples in the spec have it). As far as tag support, your best best is to check out https://developer.atlassian.com/hipchat/guide/sending-messages (see the table at the bottom for a list of HTML tags and attributes). Chances are the XHTML-IM support through XMPP will be similar to that list.
What other requirements are there and can you tell me what I am missing? I composed the message below but hipchat always just shows the plain-text body.
<message firstname.lastname@example.org' type='groupchat' xmlns='jabber:client'>
You can probably leave out the hipchat-specific extension node (xmlns='http://hipchat.com/protocol/muc#room') - that's meant for the HipChat server to send down additional information to the client.
I believe if you follow the examples under https://xmpp.org/extensions/xep-0071.html#examples you should be able to get things to work. I just ran a test using Adium and it was able to send bold/italic text successfully, so it's probably just a matter of trying out a few different things. Unfortunately, it's not something we have docs for or officially support like I mentioned, so I'm not sure what specifically you'd need to change.
This example works :
<message from="email@example.com/hubot-hipchat" to="firstname.lastname@example.org" type="chat">
But not this:
<message from="email@example.com/jarvisbot" to="firstname.lastname@example.org" type="groupchat">
I believe we only pass through XHTML bodies in 1-1 chats, although I'm not totally sure what the purpose behind the restriction is. Generally if you want to display custom content in rooms, the best option is using the API or creating an addon. We do have plans to allow more custom formatting of chat messages as well, but it's not yet available as a feature.
...from the beginning. We have built up a lot of content in HipChat, with it being a core tool in our distributed company model. While it is true that we didn’t need to move to Slack immediately, we felt it...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs