diff src/protocols/silc/silc.c @ 12761:95a73ce6e285

[gaim-migrate @ 15108] Patch from Pekka Riikonen to add Buddy Icon support to SILC. This requires SILC Toolkit 1.0.2, but I modified it so you can build without buddy icon support on older toolkit versions. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sun, 08 Jan 2006 16:17:22 +0000
parents a0fd3ebcd6fa
children b704e60fe5de
line wrap: on
line diff
--- a/src/protocols/silc/silc.c	Sun Jan 08 01:16:23 2006 +0000
+++ b/src/protocols/silc/silc.c	Sun Jan 08 16:17:22 2006 +0000
@@ -206,6 +206,9 @@
 	if (!gaim_account_get_bool(account, "reject-attrs", FALSE)) {
 		SilcUInt32 mask;
 		const char *tmp;
+#ifdef SILC_ATTRIBUTE_USER_ICON
+		char *icon;
+#endif
 #ifdef HAVE_SYS_UTSNAME_H
 		struct utsname u;
 #endif
@@ -240,6 +243,13 @@
 		silc_client_attribute_add(client, conn,
 					  SILC_ATTRIBUTE_TIMEZONE,
 					  (void *)tmp, strlen(tmp));
+
+#ifdef SILC_ATTRIBUTE_USER_ICON
+		/* Set our buddy icon */
+		icon = gaim_buddy_icons_get_full_path(gaim_account_get_buddy_icon(account));
+		silcgaim_buddy_set_icon(gc, icon);
+		g_free(icon);
+#endif
 	}
 
 	silc_free(params.detach_data);
@@ -1724,7 +1734,11 @@
 #endif
 	NULL,						/* user_splits */
 	NULL,						/* protocol_options */
-	NO_BUDDY_ICONS,				/* icon_spec */
+#ifdef SILC_ATTRIBUTE_USER_ICON
+	{"jpeg,gif,png,bmp", 0, 0, 96, 96, GAIM_ICON_SCALE_DISPLAY}, /* icon_spec */
+#else
+	NO_BUDDY_ICONS,
+#endif
 	silcgaim_list_icon,			/* list_icon */
 	silcgaim_list_emblems,		/* list_emblems */
 	silcgaim_status_text,		/* status_text */
@@ -1768,7 +1782,11 @@
 	NULL,						/* buddy_free */
 	NULL,						/* convo_closed */
 	NULL,						/* normalize */
-	NULL,						/* set_buddy_icon */
+#ifdef SILC_ATTRIBUTE_USER_ICON
+	silcgaim_buddy_set_icon,			/* set_buddy_icon */
+#else
+	NULL,
+#endif
 	NULL,						/* remove_group */
 	NULL,						/* get_cb_real_name */
 	silcgaim_chat_set_topic,	/* set_chat_topic */