diff options
author | Richard Laager <rlaager@pidgin.im> | 2007-04-25 00:56:13 +0000 |
---|---|---|
committer | Richard Laager <rlaager@pidgin.im> | 2007-04-25 00:56:13 +0000 |
commit | f516737396b5b38151376d2f050e140dde156be5 (patch) | |
tree | c63dc954034fae1ea008f2c5cf294e1e6ffd82cc /libpurple/buddyicon.h | |
parent | 470165f2f663e32b53ecfc7696ba0c9b8fd62693 (diff) | |
download | pidgin-f516737396b5b38151376d2f050e140dde156be5.tar.gz |
Move the prpl icon checksum code into the core, so we can delete the
checksum if the cache file disappears.
See ticket #223
Diffstat (limited to 'libpurple/buddyicon.h')
-rw-r--r-- | libpurple/buddyicon.h | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/libpurple/buddyicon.h b/libpurple/buddyicon.h index 218e9426fa..4bc6628168 100644 --- a/libpurple/buddyicon.h +++ b/libpurple/buddyicon.h @@ -54,11 +54,13 @@ char *purple_buddy_icons_get_full_path(const char *icon); * @param username The username the icon belongs to. * @param icon_data The buddy icon data. * @param icon_len The buddy icon length. + * @param checksum A protocol checksum from the prpl or @c NULL. * * @return The buddy icon structure. */ PurpleBuddyIcon *purple_buddy_icon_new(PurpleAccount *account, const char *username, - void *icon_data, size_t icon_len); + void *icon_data, size_t icon_len, + const char *checksum); /** * Increments the reference count on a buddy icon. @@ -93,8 +95,11 @@ void purple_buddy_icon_update(PurpleBuddyIcon *icon); * @param icon The buddy icon. * @param data The buddy icon data received over the wire. * @param len The length of the data in @a data. + * @param checksum A protocol checksum from the prpl or @c NULL. */ -void purple_buddy_icon_set_data(PurpleBuddyIcon *icon, guchar *data, size_t len); +void +purple_buddy_icon_set_data(PurpleBuddyIcon *icon, guchar *data, + size_t len, const char *checksum); /** * Returns the buddy icon's account. @@ -115,6 +120,17 @@ PurpleAccount *purple_buddy_icon_get_account(const PurpleBuddyIcon *icon); const char *purple_buddy_icon_get_username(const PurpleBuddyIcon *icon); /** + * Returns the buddy icon's checksum. + * + * This function is really only for prpl use. + * + * @param icon The buddy icon. + * + * @return The checksum. + */ +const char *purple_buddy_icon_get_checksum(const PurpleBuddyIcon *icon); + +/** * Returns the buddy icon's data. * * @param icon The buddy icon. @@ -149,12 +165,27 @@ const char *purple_buddy_icon_get_extension(const PurpleBuddyIcon *icon); * @param username The username of the user. * @param icon_data The icon data. * @param icon_len The length of the icon data. + * @param checksum A protocol checksum from the prpl or @c NULL. * * @return The buddy icon set, or NULL if no icon was set. */ void purple_buddy_icons_set_for_user(PurpleAccount *account, const char *username, - void *icon_data, size_t icon_len); + void *icon_data, size_t icon_len, + const char *checksum); + +/** + * Returns the checksum for the buddy icon of a specified buddy. + * + * This avoids loading the icon image data from the cache if it's + * not already loaded for some other reason. + * + * @param buddy The buddy + * + * @return The checksum. + */ +const char * +purple_buddy_icons_get_checksum_for_user(PurpleBuddy *buddy); /** * Returns the buddy icon information for a user. |