Custom smilies without shortcuts

Peter Saint-Andre stpeter at
Wed Sep 3 22:22:47 EDT 2008

Marcus Lundblad wrote:

> The way it works currently is that the user will have assigned a number
> of "shortcuts" to various emoticons.

Are these assigned per-user? For example, can you and I assign different 
shortcuts to the same emoticon?

> So when a message is sent and the receiver supports XHTML-IM and
> XEP-0231 the occurances of these shortcuts are substituted in the html
> body with an <img/> tag where the "alt" attribute is set to that
> shortcut. The src will be a cid-based URI according to XEP-0231. Now the
> receiver would ask for the data if it hasn't already cached it. 

OK, so the receiving client essentially does a search and replace on the 
message body, replace the textual shortcut with the image data.

> What Jean La was wondering would be if it would be possible to insert
> emoticons without assigning a smiley shortcut. This would ofcourse be
> possible using the specification of the XEPs. I'm not sure wether the
> "alt" attributes on <img/> is required in XEP-0071, but in that case it
> would be possible to auto-generate that string. But the way it will work
> in libpurple is probably that it will always be a shortcut associated
> with each custom emoticon.

Support for the 'alt' attribute is required on the receiving end 
according to XEP-0071, but the spec doesn't say whether the sender must 
always include that attribute.

> Presently I only cache received data by CID in memory for the running
> instance. Further on, implementing a persistent data cache would
> probably be a good idea. Since we now have the hash algorithm and hash
> in the CID it might make sense to implement a cache based on hash
> values. This might make it possible to share cached emoticons between
> the protocols that implement similar featurs.

Yes that would be good.

> So for this use-case the current specification of XEP-0231 in
> conjunction with XHTML-IM works nicely.
> The implementation seems to work quite nice, I've even done some interop
> testing with the Jabbim developers.


> I haven't looked that much at XEP-0038. But I think I remember there
> being a discussion about a common format for distributing smiley themes
> among various IM clients. The thing that makes it a bit more complicated
> is that libpurple-based clients (and Kopete and others) supports
> multiple protocols. The proprietary protocols tend to have a fixed set
> of smiley codes used by their respective "official" client. Maybe
> something based on XEP-0038 might make sense for this.

By "smiley code" do you mean the shortcuts or the images? Either way I 
think we can handle common shortcuts and images by convention (e.g., an 
opens-source project that everyone can re-use) rather than spec it out 
in a document -- but I'm happy to help document it if that would be useful.

> By the way, XEP-0231 mentions the use for XHTML-IM. In the old
> specification there was a use-case for providing a preview in a file
> transfer. Would this be added to the new Jingle file transfer XEP,
> f.ex.?

Yes. Or XEP-0096 or something. We'll find the right place for it. :)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6751 bytes
Desc: S/MIME Cryptographic Signature
URL: <>

More information about the Devel mailing list