2009-02-15 [colin] 3.7.0cvs66
[claws.git] / src / privacy.c
index 3b9a14498ebd45886d6be69a75d29dc27fa4afb3..4bf73f0dec52190d17472b58ca18d8fde8fda0cb 100644 (file)
@@ -417,6 +417,8 @@ gboolean privacy_sign(const gchar *id, MimeInfo *target, PrefsAccount *account,
 gchar *privacy_get_encrypt_data(const gchar *id, GSList *recp_names)
 {
        PrivacySystem *system;
+       gchar *ret = NULL;
+       GSList *uniq_names = NULL, *cur;
 
        g_return_val_if_fail(id != NULL, NULL);
        g_return_val_if_fail(recp_names != NULL, NULL);
@@ -429,7 +431,15 @@ gchar *privacy_get_encrypt_data(const gchar *id, GSList *recp_names)
        if (system->get_encrypt_data == NULL)
                return NULL;
 
-       return system->get_encrypt_data(recp_names);
+       for (cur = recp_names; cur; cur = cur->next) {
+               if (!g_slist_find_custom(uniq_names, cur->data, (GCompareFunc)strcmp)) {
+                       uniq_names = g_slist_prepend(uniq_names, cur->data);
+               }
+       }
+       ret = system->get_encrypt_data(uniq_names);
+       
+       g_slist_free(uniq_names);
+       return ret;
 }
 
 const gchar *privacy_get_encrypt_warning(const gchar *id)