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.c42
1 files changed, 37 insertions, 5 deletions
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index 4e32630d5..9c23d3517 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -541,7 +541,8 @@ theme_adium_append_html (EmpathyThemeAdium *theme,
const gchar *service_name,
const gchar *message_classes,
gint64 timestamp,
- gboolean is_backlog)
+ gboolean is_backlog,
+ gboolean outgoing)
{
EmpathyThemeAdiumPriv *priv = GET_PRIV (theme);
GString *string;
@@ -571,7 +572,12 @@ theme_adium_append_html (EmpathyThemeAdium *theme,
* Incoming/SenderColors.txt it will be used instead of
* the default colors.
*/
- if (contact_id != NULL) {
+
+ /* Ensure we always use the same color when sending messages
+ * (bgo #658821) */
+ if (outgoing) {
+ replace = "inherit";
+ } else if (contact_id != NULL) {
guint hash = g_str_hash (contact_id);
replace = colors[hash % G_N_ELEMENTS (colors)];
}
@@ -687,7 +693,7 @@ theme_adium_append_event_escaped (EmpathyChatView *view,
theme_adium_append_html (theme, "appendMessage",
priv->data->status_html, escaped, NULL, NULL, NULL,
NULL, "event",
- empathy_time_get_current (), FALSE);
+ empathy_time_get_current (), FALSE, FALSE);
/* There is no last contact */
if (priv->last_contact) {
@@ -944,7 +950,7 @@ theme_adium_append_message (EmpathyChatView *view,
theme_adium_append_html (theme, func, html, body_escaped,
avatar_filename, name, contact_id,
service_name, message_classes->str,
- timestamp, is_backlog);
+ timestamp, is_backlog, empathy_contact_is_user (sender));
/* Keep the sender of the last displayed message */
if (priv->last_contact) {
@@ -976,6 +982,14 @@ theme_adium_append_event (EmpathyChatView *view,
}
static void
+theme_adium_append_event_markup (EmpathyChatView *view,
+ const gchar *markup_text,
+ const gchar *fallback_text)
+{
+ theme_adium_append_event_escaped (view, markup_text);
+}
+
+static void
theme_adium_edit_message (EmpathyChatView *view,
EmpathyMessage *message)
{
@@ -1291,6 +1305,7 @@ theme_adium_iface_init (EmpathyChatViewIface *iface)
{
iface->append_message = theme_adium_append_message;
iface->append_event = theme_adium_append_event;
+ iface->append_event_markup = theme_adium_append_event_markup;
iface->edit_message = theme_adium_edit_message;
iface->scroll = theme_adium_scroll;
iface->scroll_down = theme_adium_scroll_down;
@@ -1648,6 +1663,20 @@ empathy_theme_adium_set_variant (EmpathyThemeAdium *theme,
g_object_notify (G_OBJECT (theme), "variant");
}
+void
+empathy_theme_adium_show_inspector (EmpathyThemeAdium *theme)
+{
+ WebKitWebView *web_view = WEBKIT_WEB_VIEW (theme);
+ WebKitWebInspector *inspector;
+
+ g_object_set (G_OBJECT (webkit_web_view_get_settings (web_view)),
+ "enable-developer-extras", TRUE,
+ NULL);
+
+ inspector = webkit_web_view_get_inspector (web_view);
+ webkit_web_inspector_show (inspector);
+}
+
gboolean
empathy_adium_path_is_valid (const gchar *path)
{
@@ -1733,8 +1762,11 @@ adium_info_dup_path_for_variant (GHashTable *info,
return g_strdup ("main.css");
}
- /* Verify the variant exists, fallback to the first one */
variants = empathy_adium_info_get_available_variants (info);
+ if (variants->len == 0)
+ return g_strdup ("main.css");
+
+ /* Verify the variant exists, fallback to the first one */
for (i = 0; i < variants->len; i++) {
if (!tp_strdiff (variant, g_ptr_array_index (variants, i))) {
break;