/soc/2012/tomkiewicz/gg: c71e5e8976ba: Gadu-Gadu: avatar removal...

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Sun Aug 5 17:49:46 EDT 2012


Changeset: c71e5e8976baa038e53bd0fe0bc97e2e2b22cbdc
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2012-08-05 23:49 +0200
Branch:	 soc.2012.gg
URL: http://hg.pidgin.im/soc/2012/tomkiewicz/gg/rev/c71e5e8976ba

Description:

Gadu-Gadu: avatar removal is possible, so lets handle it

diffstat:

 libpurple/protocols/gg/avatar.c         |  7 ++++---
 libpurple/protocols/gg/libgadu-events.c |  9 ++++++++-
 2 files changed, 12 insertions(+), 4 deletions(-)

diffs (36 lines):

diff --git a/libpurple/protocols/gg/avatar.c b/libpurple/protocols/gg/avatar.c
--- a/libpurple/protocols/gg/avatar.c
+++ b/libpurple/protocols/gg/avatar.c
@@ -117,9 +117,10 @@ void ggp_avatar_buddy_update(PurpleConne
 
 void ggp_avatar_buddy_remove(PurpleConnection *gc, uin_t uin)
 {
-	//TODO: verbose mode
-	//purple_debug_misc("gg", "ggp_avatar_buddy_remove(%p, %u) - "
-	//	"probably not necessary, thus not implemented\n", gc, uin);
+	purple_debug_info("gg", "ggp_avatar_buddy_remove(%p, %u)\n", gc, uin);
+
+	purple_buddy_icons_set_for_user(purple_connection_get_account(gc),
+		ggp_uin_to_str(uin), NULL, 0, NULL);
 }
 
 /* return TRUE if avatar update was performed or there is no new requests,
diff --git a/libpurple/protocols/gg/libgadu-events.c b/libpurple/protocols/gg/libgadu-events.c
--- a/libpurple/protocols/gg/libgadu-events.c
+++ b/libpurple/protocols/gg/libgadu-events.c
@@ -33,7 +33,14 @@ void ggp_events_user_data(PurpleConnecti
 				&data_user->attrs[attr_idx];
 			if (strcmp(data_attr->key, "avatar") == 0)
 			{
-				time_t timestamp = atoi(data_attr->value);
+				time_t timestamp;
+				if (data_attr->type == 0)
+				{
+					ggp_avatar_buddy_remove(gc, uin);
+					continue;
+				}
+				
+				timestamp = atoi(data_attr->value);
 				if (timestamp <= 0)
 					continue;
 				got_avatar = TRUE;



More information about the Commits mailing list