z-ismeretlen at freemail.hu
Tue Apr 16 11:45:04 EDT 2013
On 13/04/16 17:12, Jorge Villaseñor wrote:
> On Tue, Apr 16, 2013 at 3:23 AM, Zoltán Sólyom
> <z-ismeretlen at freemail.hu <mailto:z-ismeretlen at freemail.hu>> wrote:
> Yesterday I tried to implement custom_smiley_add etc. in
> PurpleConversationUiOps for my Visual Studio program. The callback
> gets a PurpleConversation pointer, the text of the smiley, and a
> bool called "remote" (which I have no idea what it does, but it
> doesn't matter right now).
> The PurpleConversation contains the name/title of the
> conversation, and it seems to be used for identifying the sender
> of the smiley. As I see it, this is the only way to know who sent
> it. This works if talking with a single buddy, but not in a group
> chat. Is there no way to find out who sent the smiley in a chat? I
> could probably read the next sent message to identify the sender,
> but in that case I can't cache the custom smiles. It is always
> possible that someone else also sent a custom smiley with the same
> text, but it is a different smiley.
> For smiley caching and identifying any given smiley, we store them
> using a hash of the image as filename/identifier, not the name. Maybe
> this can help on that.
Does that mean that the custom_smiley_add callback is not the place to
handle received custom smiles? It does not get a filename nor an
identifier, just the shortcut text that was entered on the other side. I
saw that the raw data contains some code that could be taken as an
identifier (i.e.: <img alt='_D'
src='cid:sha1+0113a2090b8a4ad3ca1d04df2ac866b7c21c10c2 at bob.xmpp.org'/>)
though I'm not sure whether it's for that purpose. The callback for
received messages gets some meaningless XML tags too (i.e. <html
xmlns='http://www.w3.org/1999/xhtml'>), but that is only called once
That XML tag (and the raw data) seems to be XMPP specific and I'm sure
it's not a good idea to directly use it, if the program should be able
to show custom smileys from many protocols. (I tried custom smileys from
Live Messenger but those arrived as simple text so I don't know how
other protocols handle this.)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Devel