Enhancements, possibilities and random ideas
--------------------------------------------
-- Retrieve federated domain records (!)
- Support federated IDN domains (??) (Claws Mail itself doesn't support it
http://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=1670)
-- Domain validation when searching for federated avatars, or at least
- exclude some domains (eg.: localhost) (???)
-- Check box to enable/disable domain validation (?)
- http://data.iana.org/TLD/tlds-alpha-by-domain.txt may be useful.
- Button for checking custom default URL is not 404 (!) check on apply (?)
- Make it run in cache-less mode if cache dir cannot be created (??)
- Only cache "mystery man" once for all hashes (what if changes) (?)
#include "libravatar.h"
#include "libravatar_prefs.h"
#include "libravatar_missing.h"
+#include "libravatar_federation.h"
#include "prefs_common.h"
#include "procheader.h"
#include "procmsg.h"
static gchar *federated_base_url_from_address(const gchar *address)
{
- /*
- TODO: no federation supported right now
- Details on http://wiki.libravatar.org/running_your_own/
- */
+#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+ gchar *base_url = NULL;
+
+ if (!libravatarprefs.allow_federated) {
+ debug_print("federated domains disabled by configuration\n");
+ goto default_url;
+ }
+
+ base_url = federated_url_for_address(address);
+ if (base_url != NULL) {
+ return base_url;
+ }
+
+default_url:
+#endif
return g_strdup(libravatarprefs.base_url);
}