aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-theme-adium.c
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy-gtk/empathy-theme-adium.c')
-rw-r--r--libempathy-gtk/empathy-theme-adium.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index 5cd306520..634b4b2cd 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -1752,10 +1752,30 @@ 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)
+ {
+ g_free (tmp);
+ return FALSE;
+ }
+
+ dir = tmp[g_strv_length (tmp) - 1];
+
+ if (!g_str_has_suffix (dir, ".AdiumMessageStyle"))
+ {
+ g_free (tmp);
+ return FALSE;
+ }
+
+ g_free (tmp);
+
/* The theme is not valid if there is no Info.plist */
file = g_build_filename (path, "Contents", "Info.plist",
NULL);