]> git.0d.be Git - empathy.git/commitdiff
Partial fix for bug #586379
authorPatryk Zawadzki <patrys@pld-linux.org>
Fri, 19 Jun 2009 14:23:57 +0000 (16:23 +0200)
committerPatryk Zawadzki <patrys@pld-linux.org>
Fri, 19 Jun 2009 14:23:57 +0000 (16:23 +0200)
Added naive support for footer files in adium themes. No macros are
actually parsed and replaces but these are mostly used in headers.

libempathy-gtk/empathy-theme-adium.c

index 4aa32a3f660e7971467a23fe163bca69d417e1c9..9715946741e4146496606f131462980fc459dc02 100644 (file)
@@ -86,6 +86,8 @@ theme_adium_load (EmpathyThemeAdium *theme)
        gchar                 *file;
        gchar                 *template_html = NULL;
        gsize                  template_len;
+       gchar                 *footer_html = NULL;
+       gsize                  footer_len;
        GString               *string;
        gchar                **strv = NULL;
        gchar                 *css_path;
@@ -117,6 +119,10 @@ theme_adium_load (EmpathyThemeAdium *theme)
        g_file_get_contents (file, &priv->status_html, &priv->status_len, NULL);
        g_free (file);
 
+       file = g_build_filename (priv->basedir, "Footer.html", NULL);
+       g_file_get_contents (file, &footer_html, &footer_len, NULL);
+       g_free (file);
+
        file = g_build_filename (priv->basedir, "Incoming", "buddy_icon.png", NULL);
        if (g_file_test (file, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) {
                priv->default_incoming_avatar_filename = file;
@@ -173,7 +179,8 @@ theme_adium_load (EmpathyThemeAdium *theme)
        g_string_append (string, strv[i++]);
        g_string_append (string, ""); /* We don't want header */
        g_string_append (string, strv[i++]);
-       g_string_append (string, ""); /* FIXME: We don't support footer yet */
+       /* FIXME: We should replace adium %macros% in footer */
+       g_string_append (string, footer_html);
        g_string_append (string, strv[i++]);
        priv->template_html = g_string_free (string, FALSE);
 
@@ -182,6 +189,7 @@ theme_adium_load (EmpathyThemeAdium *theme)
                                          priv->template_html, basedir_uri);
 
        g_free (basedir_uri);
+       g_free (footer_html);
        g_free (template_html);
        g_free (css_path);
        g_strfreev (strv);