After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 658821 - Use a stable colour for the local user's messages
Use a stable colour for the local user's messages
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Chat themes
3.1.x
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
Depends on:
Blocks:
 
 
Reported: 2011-09-12 13:37 UTC by Will Thompson
Modified: 2011-09-13 08:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
theme-adium: ensure we always use the same color when sending messages (2.39 KB, patch)
2011-09-12 14:59 UTC, Guillaume Desmottes
rejected Details | Review
theme-adium: ensure we always use the same color when sending messages (2.23 KB, patch)
2011-09-13 08:42 UTC, Guillaume Desmottes
committed Details | Review

Description Will Thompson 2011-09-12 13:37:07 UTC
Empathy picks values for the %senderColor% field based on a hash of the identifier of the contact:

		} else if (theme_adium_match (&cur, "%senderColor%")) {
			if (contact_id != NULL) {
				guint hash = g_str_hash (contact_id);
				replace = colors[hash % G_N_ELEMENTS (colors)];
			}

where 'colors' is a big list o' colour names, as illustrated by <http://willthompson.co.uk/misc/colours.html>.

Since my contact identifier is different on each of my different accounts, I show up in a different colour in each tab. It might be nice for this to be consistent. We could, for instance, always choose the theme's standard foreground colour by substituting the string "inherit"; or we could reserve one of these colours always to be used for the local user; or we could base it on a hash of the user's Unix username. The first is the simplest. :)
Comment 1 Guillaume Desmottes 2011-09-12 14:59:00 UTC
Created attachment 196269 [details] [review]
theme-adium: ensure we always use the same color when sending messages
Comment 2 Will Thompson 2011-09-12 15:09:09 UTC
Review of attachment 196269 [details] [review]:

::: libempathy-gtk/empathy-theme-adium.c
@@ +578,3 @@
+			 * (bgo #658821) */
+			if (outgoing)
+				to_hash = "inherit";

Don't hash "inherit"... use it as the colour name.
Comment 3 Guillaume Desmottes 2011-09-13 08:42:35 UTC
Created attachment 196339 [details] [review]
theme-adium: ensure we always use the same color when sending messages
Comment 4 Guillaume Desmottes 2011-09-13 08:47:17 UTC
Attachment 196339 [details] pushed as 2a85625 - theme-adium: ensure we always use the same color when sending messages