*/
#include "config.h"
+#include "empathy-log-window.h"
#include <glib/gi18n-lib.h>
-#include <webkit/webkit.h>
-
#include <telepathy-glib/proxy-subclass.h>
-#include <extensions/extensions.h>
-
-#include <libempathy/action-chain-internal.h>
-#include <libempathy/empathy-camera-monitor.h>
-#include <libempathy/empathy-gsettings.h>
-#include <libempathy/empathy-request-util.h>
-#include <libempathy/empathy-utils.h>
-
-#include "empathy-log-window.h"
+#include "action-chain-internal.h"
#include "empathy-account-chooser.h"
#include "empathy-call-utils.h"
-#include "empathy-individual-information-dialog.h"
+#include "empathy-camera-monitor.h"
+#include "empathy-geometry.h"
+#include "empathy-gsettings.h"
#include "empathy-images.h"
+#include "empathy-individual-information-dialog.h"
+#include "empathy-request-util.h"
#include "empathy-theme-manager.h"
#include "empathy-ui-utils.h"
+#include "empathy-utils.h"
#include "empathy-webkit-utils.h"
-#include "empathy-geometry.h"
+#include "extensions.h"
#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
-#include <libempathy/empathy-debug.h>
+#include "empathy-debug.h"
#define EMPATHY_NS "http://live.gnome.org/Empathy"
{
char *str = gtk_tree_path_to_string (path);
char *script, *text, *date, *stock_icon;
+ GString *escaped_text;
char *icon = NULL;
+ gint i;
gtk_tree_model_get (model, iter,
COL_EVENTS_TEXT, &text,
gtk_icon_info_free (icon_info);
}
+ escaped_text = g_string_new (NULL);
+
+ /* Only need to deal with «'» and «\».
+ *
+ * Note that these never appear in non-ascii utf8 characters, so just
+ * pretend like we have an ascii string...
+ */
+ for (i = 0; text && text[i]; i++)
+ {
+ gchar c = text[i];
+
+ if (c == '\'' || c == '\\')
+ g_string_append_c (escaped_text, '\\');
+
+ g_string_append_c (escaped_text, c);
+ }
+
script = g_strdup_printf ("javascript:%s([%s], '%s', '%s', '%s');",
method,
g_strdelimit (str, ":", ','),
- text,
+ escaped_text->str,
icon != NULL ? icon : "",
date);
webkit_web_view_execute_script (WEBKIT_WEB_VIEW (self->priv->webview),
script);
+ g_string_free (escaped_text, TRUE);
g_free (str);
g_free (text);
g_free (date);