Mercurial > pidgin
comparison libpurple/protocols/qq/buddy_info.c @ 24018:c0c82c50897f
Remove the (win32 only?!) QQ buddy icon pixmaps due to copyright concerns
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Sat, 30 Aug 2008 02:30:04 +0000 |
parents | 5f454b975a99 |
children | 147ada94a1d8 |
comparison
equal
deleted
inserted
replaced
24017:05907ea114ef | 24018:c0c82c50897f |
---|---|
744 PurpleAccount *account = purple_connection_get_account(gc); | 744 PurpleAccount *account = purple_connection_get_account(gc); |
745 const gchar *icon_path = purple_account_get_buddy_icon_path(account); | 745 const gchar *icon_path = purple_account_get_buddy_icon_path(account); |
746 const gchar *buddy_icon_dir = qq_buddy_icon_dir(); | 746 const gchar *buddy_icon_dir = qq_buddy_icon_dir(); |
747 gint prefix_len = strlen(QQ_ICON_PREFIX); | 747 gint prefix_len = strlen(QQ_ICON_PREFIX); |
748 gint suffix_len = strlen(QQ_ICON_SUFFIX); | 748 gint suffix_len = strlen(QQ_ICON_SUFFIX); |
749 gint dir_len = strlen(buddy_icon_dir); | 749 gint dir_len = buddy_icon_dir ? strlen(buddy_icon_dir) : 0; |
750 gchar *errmsg = g_strdup_printf(_("Setting custom faces is not currently supported. Please choose an image from %s."), buddy_icon_dir); | 750 gchar *errmsg = g_strdup_printf(_("Setting custom faces is not currently supported. Please choose an image from %s."), buddy_icon_dir ? buddy_icon_dir : "(null)"); |
751 gboolean icon_global = purple_account_get_bool(gc->account, "use-global-buddyicon", TRUE); | 751 gboolean icon_global = purple_account_get_bool(gc->account, "use-global-buddyicon", TRUE); |
752 | 752 |
753 if (!icon_path) | 753 if (!icon_path) |
754 icon_path = ""; | 754 icon_path = ""; |
755 | 755 |
756 icon_len = strlen(icon_path) - dir_len - 1 - prefix_len - suffix_len; | 756 icon_len = strlen(icon_path) - dir_len - 1 - prefix_len - suffix_len; |
757 | 757 |
758 /* make sure we're using an appropriate icon */ | 758 /* make sure we're using an appropriate icon */ |
759 if (!(g_ascii_strncasecmp(icon_path, buddy_icon_dir, dir_len) == 0 | 759 if (buddy_icon_dir && !(g_ascii_strncasecmp(icon_path, buddy_icon_dir, dir_len) == 0 |
760 && icon_path[dir_len] == G_DIR_SEPARATOR | 760 && icon_path[dir_len] == G_DIR_SEPARATOR |
761 && g_ascii_strncasecmp(icon_path + dir_len + 1, QQ_ICON_PREFIX, prefix_len) == 0 | 761 && g_ascii_strncasecmp(icon_path + dir_len + 1, QQ_ICON_PREFIX, prefix_len) == 0 |
762 && g_ascii_strncasecmp(icon_path + dir_len + 1 + prefix_len + icon_len, QQ_ICON_SUFFIX, suffix_len) == 0 | 762 && g_ascii_strncasecmp(icon_path + dir_len + 1 + prefix_len + icon_len, QQ_ICON_SUFFIX, suffix_len) == 0 |
763 && icon_len <= 3)) { | 763 && icon_len <= 3)) { |
764 if (icon_global) | 764 if (icon_global) |
796 const gchar *old_icon_num = NULL; | 796 const gchar *old_icon_num = NULL; |
797 | 797 |
798 if ((buddy = purple_find_buddy(account, name))) | 798 if ((buddy = purple_find_buddy(account, name))) |
799 old_icon_num = purple_buddy_icons_get_checksum_for_user(buddy); | 799 old_icon_num = purple_buddy_icons_get_checksum_for_user(buddy); |
800 | 800 |
801 if (old_icon_num == NULL || | 801 if ((old_icon_num == NULL || |
802 strcmp(icon_num_str, old_icon_num)) | 802 strcmp(icon_num_str, old_icon_num)) && (qq_buddy_icon_dir() != NULL)) |
803 { | 803 { |
804 gchar *icon_path; | 804 gchar *icon_path; |
805 | 805 |
806 icon_path = g_strconcat(qq_buddy_icon_dir(), G_DIR_SEPARATOR_S, | 806 icon_path = g_strconcat(qq_buddy_icon_dir(), G_DIR_SEPARATOR_S, |
807 QQ_ICON_PREFIX, icon_num_str, | 807 QQ_ICON_PREFIX, icon_num_str, |