Suggestion about an emoticon plugin implementation ...
Mauro Sérgio Ferreira Brasil
mauro.brasil at tqi.com.br
Wed Jul 18 15:04:48 EDT 2007
Hello there!!!
I would like to suggest an alternative to the "emoticon cache" that is
not working by now.
The idea is to use a registrable set of interfaces.
This way, the main code won't need any changes as this functionality
becames a reality, and this will allow another developers that use only
the libpurple to create their own "emoticon cache" implementation.
The point for this is quite simple, I work on a IM client that uses
libpurple, and after the migration from libgaim 1.5 to libpurple 2.0.2,
our customer wants to see the new features implemented on their client,
and one they want the most is the custom emoticon receiving (and, soon I
hope... the sending too).
As I saw on the code, the emoticon caching is not implemented, but is
there a comment that gives the idea that this will be done some day, but
not when.
If it takes too long, I think our customer will ask us to implement our own.
Making a long discuttion short, let me give you guys a more programatic
example.
On some place we could have an struct called "PurpleCustomEmoticonOps",
a global static pointer to an instance, and a method to set it as well.
Same way to PurpleAccountUiOps struct, and others.
The "PurpleCustomEmoticonOps" members could be something like that:
struct _PurpleCustomEmoticonOps
{
/* A buddy we already have added us to their buddy list. */
gboolean (*is_cached)(PurpleConversation *conv, const char *smile,
const char *crc_method, const char *crc_value);
void (*save)(PurpleConversation *conv, const char *smile,
const char *crc_value, const guchar *data, gsize size);
void (*load)(PurpleConversation *conv, const char *smile,
const char *crc_value);
void (*_purple_reserved1)(void);
void (*_purple_reserved2)(void);
void (*_purple_reserved3)(void);
void (*_purple_reserved4)(void);
};
On method "msn_emoticon_msg" of file "slp.c" of MSN protocol, we will
make the change:
<-- Original code -->
if (purple_conv_custom_smiley_add(conv, smile, "sha1", sha1, TRUE)) {
msn_slplink_request_object(slplink, smile, got_emoticon, NULL, obj);
}
<-- New code -->
if (!purple_custom_smiley_is_cached(conv, smile, "sha1", sha1))
msn_slplink_request_object(slplink, smile, got_emoticon, NULL, obj);
}
<-- End of change -->
Considering that our customer agree with that (anyway he is paying us
here), I can make the necessary changes and post them for approval on
you site.
But before anything, even before contact our customer with this
suggestion, I need to know whether this effort won't collide with
another in course one, and whether the suggestion will be considered by
the Pidgin board of developers (if any).
Best regards,
Mauro.
--
__At.,
_
*Tecnologia e Qualidade em Informática Ltda*
Mauro Sérgio Ferreira Brasil
Analista de Sistemas
+ mauro.brasil at tqi.com.br <mailto:@tqi.com.br>
: www.tqi.com.br <http://www.tqi.com.br>
( + 55 (34)3291-1700
( + 55 (34)9971-2572
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/devel/attachments/20070718/2edb5dfd/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CMMI.jpg
Type: image/jpeg
Size: 9241 bytes
Desc: not available
URL: <http://pidgin.im/pipermail/devel/attachments/20070718/2edb5dfd/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TQI.gif
Type: image/gif
Size: 653 bytes
Desc: not available
URL: <http://pidgin.im/pipermail/devel/attachments/20070718/2edb5dfd/attachment-0002.gif>
More information about the Devel
mailing list