cburschka / cadence

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

Move user text color to meta element. #418

Closed cburschka closed 8 years ago

cburschka commented 8 years ago

The way user color is conveyed right now, as part of the HTML markup in a data attribute, is somewhat counter to the spirit of XMPP.

Instead, this patch will create a <cadence xmlns="cadence:meta"> element in the <message> stanza to convey simple key-value meta-data to the recipient. For now, the only such key will be a <color> element containing a valid CSS color value.

This will also allow the text color to be shown when HTML markup is otherwise off.

cburschka commented 8 years ago

eg.

<message xmlns="jabber:client" from="" to="" type="groupchat">
  <body>Test</body>
  <html xmlns="http://jabber.org/protocol/xhtml-im">
    <body xmlns="http://www.w3.org/1999/xhtml">
      <p>Test</p>
    </body>
  </html>
  <cadence xmlns="cadence:meta">
    <color>#c71585</color>
  </cadence>
</message>