Problem: In an XMPP IM client we are working on, it is necessary for mentions of other users (for alerting, highlighting) to be based on a normalised user identity, but displayed in a denormalized human-readable format. Additionally, for a particular denormalized identity, there may be any number of normalised identities. For example, user [email protected] should be mentioned as Joe Bloggs. The relationship between the normalized and denormalized identities is known by the client authoring the message, and must be transmitted with the message for appropriate display and behaviour on the receiving end.
Requirements: - Allow a denormalized username to show up as highlighted/special when displayed in the client-side, up to and including unique selection in the DOM (for JavaScript). - Allow more than one denormalized username per message. - Allow non-unique denormalized username displays. - Continue to allow more text either before, after, or between mentions so that mentions can fit in with normal conversation flow. Current Solution: XEP-0071 allows for the <span> tag to have the following attributes: id, class, name, and style. We could misappropriate these attributes and do something like <span class=”user-mention” title=”#ID#”>John Smith</span>. Complex data would have to be serialized somehow, and if you need to genuinely use all of the standard attributes currently allowed, there are none left to misappropriate. Proposed Solution: Update XEP-0071 to XHTML5 to allow the use of data-* attributes within elements. Does anyone see a flaw with this approach, or have an alternative suggestion which meets the requirements and/or which is already in use for similar functionality?
