"retro"
};
-static guint update_hook_id;
-static guint render_hook_id;
+static gulong update_hook_id = HOOK_NONE;
+static gulong render_hook_id = HOOK_NONE;
static gchar *cache_dir = NULL; /* dir-separator terminated */
static gboolean libravatar_header_update_hook(gpointer source, gpointer data)
static gchar *federated_base_url_from_address(const gchar *address)
{
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
gchar *base_url = NULL;
if (!libravatarprefs.allow_federated) {
static void unregister_hooks()
{
- if (render_hook_id != -1) {
+ if (render_hook_id != HOOK_NONE) {
hooks_unregister_hook(AVATAR_IMAGE_RENDER_HOOKLIST,
render_hook_id);
- render_hook_id = -1;
+ render_hook_id = HOOK_NONE;
}
- if (update_hook_id != -1) {
+ if (update_hook_id != HOOK_NONE) {
hooks_unregister_hook(AVATAR_HEADER_UPDATE_HOOKLIST,
update_hook_id);
- update_hook_id = -1;
+ update_hook_id = HOOK_NONE;
}
}
update_hook_id = hooks_register_hook(AVATAR_HEADER_UPDATE_HOOKLIST,
libravatar_header_update_hook,
NULL);
- if (update_hook_id == -1) {
+ if (update_hook_id == HOOK_NONE) {
*error = g_strdup(_("Failed to register avatar header update hook"));
return -1;
}
render_hook_id = hooks_register_hook(AVATAR_IMAGE_RENDER_HOOKLIST,
libravatar_image_render_hook,
NULL);
- if (render_hook_id == -1) {
+ if (render_hook_id == HOOK_NONE) {
unregister_hooks();
*error = g_strdup(_("Failed to register avatar image render hook"));
return -1;