comparison 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
comparison
equal deleted inserted replaced
12760:c5acba513363 12761:95a73ce6e285
204 204
205 /* Set default attributes */ 205 /* Set default attributes */
206 if (!gaim_account_get_bool(account, "reject-attrs", FALSE)) { 206 if (!gaim_account_get_bool(account, "reject-attrs", FALSE)) {
207 SilcUInt32 mask; 207 SilcUInt32 mask;
208 const char *tmp; 208 const char *tmp;
209 #ifdef SILC_ATTRIBUTE_USER_ICON
210 char *icon;
211 #endif
209 #ifdef HAVE_SYS_UTSNAME_H 212 #ifdef HAVE_SYS_UTSNAME_H
210 struct utsname u; 213 struct utsname u;
211 #endif 214 #endif
212 215
213 mask = SILC_ATTRIBUTE_MOOD_NORMAL; 216 mask = SILC_ATTRIBUTE_MOOD_NORMAL;
238 tmp = tzname[0]; 241 tmp = tzname[0];
239 #endif 242 #endif
240 silc_client_attribute_add(client, conn, 243 silc_client_attribute_add(client, conn,
241 SILC_ATTRIBUTE_TIMEZONE, 244 SILC_ATTRIBUTE_TIMEZONE,
242 (void *)tmp, strlen(tmp)); 245 (void *)tmp, strlen(tmp));
246
247 #ifdef SILC_ATTRIBUTE_USER_ICON
248 /* Set our buddy icon */
249 icon = gaim_buddy_icons_get_full_path(gaim_account_get_buddy_icon(account));
250 silcgaim_buddy_set_icon(gc, icon);
251 g_free(icon);
252 #endif
243 } 253 }
244 254
245 silc_free(params.detach_data); 255 silc_free(params.detach_data);
246 } 256 }
247 257
1722 OPT_PROTO_CHAT_TOPIC | OPT_PROTO_UNIQUE_CHATNAME | 1732 OPT_PROTO_CHAT_TOPIC | OPT_PROTO_UNIQUE_CHATNAME |
1723 OPT_PROTO_PASSWORD_OPTIONAL, 1733 OPT_PROTO_PASSWORD_OPTIONAL,
1724 #endif 1734 #endif
1725 NULL, /* user_splits */ 1735 NULL, /* user_splits */
1726 NULL, /* protocol_options */ 1736 NULL, /* protocol_options */
1727 NO_BUDDY_ICONS, /* icon_spec */ 1737 #ifdef SILC_ATTRIBUTE_USER_ICON
1738 {"jpeg,gif,png,bmp", 0, 0, 96, 96, GAIM_ICON_SCALE_DISPLAY}, /* icon_spec */
1739 #else
1740 NO_BUDDY_ICONS,
1741 #endif
1728 silcgaim_list_icon, /* list_icon */ 1742 silcgaim_list_icon, /* list_icon */
1729 silcgaim_list_emblems, /* list_emblems */ 1743 silcgaim_list_emblems, /* list_emblems */
1730 silcgaim_status_text, /* status_text */ 1744 silcgaim_status_text, /* status_text */
1731 silcgaim_tooltip_text, /* tooltip_text */ 1745 silcgaim_tooltip_text, /* tooltip_text */
1732 silcgaim_away_states, /* away_states */ 1746 silcgaim_away_states, /* away_states */
1766 NULL, /* group_buddy */ 1780 NULL, /* group_buddy */
1767 NULL, /* rename_group */ 1781 NULL, /* rename_group */
1768 NULL, /* buddy_free */ 1782 NULL, /* buddy_free */
1769 NULL, /* convo_closed */ 1783 NULL, /* convo_closed */
1770 NULL, /* normalize */ 1784 NULL, /* normalize */
1771 NULL, /* set_buddy_icon */ 1785 #ifdef SILC_ATTRIBUTE_USER_ICON
1786 silcgaim_buddy_set_icon, /* set_buddy_icon */
1787 #else
1788 NULL,
1789 #endif
1772 NULL, /* remove_group */ 1790 NULL, /* remove_group */
1773 NULL, /* get_cb_real_name */ 1791 NULL, /* get_cb_real_name */
1774 silcgaim_chat_set_topic, /* set_chat_topic */ 1792 silcgaim_chat_set_topic, /* set_chat_topic */
1775 NULL, /* find_blist_chat */ 1793 NULL, /* find_blist_chat */
1776 silcgaim_roomlist_get_list, /* roomlist_get_list */ 1794 silcgaim_roomlist_get_list, /* roomlist_get_list */