Make federated_url_for_address() return the same thing whether a
[claws.git] / src / plugins / libravatar / libravatar_federation.c
index 106fdfbad830c0c5b204bfa19b3f43d71fd4a791..f84e629b5fa03febcc7ad51056cc8c78e50bbd8e 100644 (file)
@@ -22,6 +22,7 @@
 #include "libravatar_federation.h"
 #include "libravatar_prefs.h"
 #include "utils.h"
+#include "gtkutils.h"
 
 #define MISSING "x"
 
@@ -105,20 +106,20 @@ gchar *federated_url_for_address(const gchar *address)
        if (url != NULL) {
                g_free(addr);
                if (!strcmp(url, MISSING)) {
-                       return g_strdup(libravatarprefs.base_url);
+                       return NULL;
                }
                return g_strdup(url);
        }
 
        /* not cached, try secure service first */
-       if (auto_configure_service("avatars-sec", domain, &host, &port)) {
+       if (auto_configure_service_sync("avatars-sec", domain, &host, &port)) {
                if (port != 443) {
                        url = g_strdup_printf("https://%s:%d/avatar", host, port);
                } else {
                        url = g_strdup_printf("https://%s/avatar", host);
                }
        } else { /* try standard one if no secure service available */
-               if (auto_configure_service("avatars", domain, &host, &port)) {
+               if (auto_configure_service_sync("avatars", domain, &host, &port)) {
                        if (port != 80) {
                                url = g_strdup_printf("http://%s:%d/avatar", host, port);
                        } else {