]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-theme-adium.c
include telepathy-glib.h
[empathy.git] / libempathy-gtk / empathy-theme-adium.c
index 5cd30652008fa43a5025e6e33cb639cacd8cafa9..37c8698e443bf4201dbdab07cf218c141ef42ebc 100644 (file)
@@ -24,8 +24,7 @@
 #include <glib/gi18n-lib.h>
 
 #include <webkit/webkit.h>
-#include <telepathy-glib/dbus.h>
-#include <telepathy-glib/util.h>
+#include <telepathy-glib/telepathy-glib.h>
 
 #include <pango/pango.h>
 #include <gdk/gdk.h>
@@ -864,9 +863,9 @@ empathy_theme_adium_append_message (EmpathyThemeAdium *self,
   sender = empathy_message_get_sender (msg);
   account = empathy_contact_get_account (sender);
   service_name = empathy_protocol_name_to_display_name
-    (tp_account_get_protocol (account));
+    (tp_account_get_protocol_name (account));
   if (service_name == NULL)
-    service_name = tp_account_get_protocol (account);
+    service_name = tp_account_get_protocol_name (account);
   timestamp = empathy_message_get_timestamp (msg);
   body_escaped = theme_adium_parse_body (self,
     empathy_message_get_body (msg),
@@ -1439,6 +1438,8 @@ theme_adium_finalize (GObject *object)
   g_object_unref (self->priv->gsettings_chat);
   g_object_unref (self->priv->gsettings_desktop);
 
+  g_free (self->priv->variant);
+
   G_OBJECT_CLASS (empathy_theme_adium_parent_class)->finalize (object);
 }
 
@@ -1752,10 +1753,27 @@ empathy_adium_path_is_valid (const gchar *path)
 {
   gboolean ret;
   gchar *file;
+  gchar **tmp;
+  const gchar *dir;
 
   if (path[0] != '/')
     return FALSE;
 
+  /* The directory has to be *.AdiumMessageStyle per the Adium spec */
+  tmp = g_strsplit (path, "/", 0);
+  if (tmp == NULL)
+    return FALSE;
+
+  dir = tmp[g_strv_length (tmp) - 1];
+
+  if (!g_str_has_suffix (dir, ".AdiumMessageStyle"))
+    {
+      g_strfreev (tmp);
+      return FALSE;
+    }
+
+  g_strfreev (tmp);
+
   /* The theme is not valid if there is no Info.plist */
   file = g_build_filename (path, "Contents", "Info.plist",
          NULL);