GNOME Bugzilla – Bug 654015
empathy-chat asserts with adium themes in tp_escape_as_identifier
Last modified: 2011-07-08 11:25:40 UTC
Sending messages in some CMs cause empathy-chat to spit assertions like the one below. The cause is that in empathy-theme-adium.c we do: tp_msg = empathy_message_get_tp_message (msg); if (tp_msg != NULL) { gchar *tmp = tp_escape_as_identifier ( tp_message_get_token (tp_msg)); g_string_append_printf (message_classes, " x-empathy-message-id-%s", tmp); g_free (tmp); } tp_message_get_token() may return NULL, and we pass that unconditionally to tp_escape_as_identifier(), which doesn't accept NULL. tp-glib-CRITICAL **: tp_escape_as_identifier: assertion `name != NULL' failed aborting... Program received signal SIGABRT, Aborted. 0x00007fffef839405 in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory. in ../nptl/sysdeps/unix/sysv/linux/raise.c (gdb) bt
+ Trace 227663
Created attachment 191327 [details] [review] theme_adium_append_message: cope with tp_message_get_token() returning NULL
+ const gchar *token = tp_message_get_token (tp_msg); + + if (token != NULL) { + gchar *tmp = tp_escape_as_identifier ( + tp_message_get_token (tp_msg)); That could be gchar *tmp = tp_escape_as_identifier (token); theme_adium_remove_mark_from_message() has the same issue (it's passed a token which comes from tp_message_get_token (tp_msg) in theme_adium_message_acknowledged(). What are the consequences of not adding x-empathy-message-id-* ? Will we fail to mark messages as read? If so maybe we shouldn't add the focus classes? And we probably want to implement message-token whenever possible in every CM.
(In reply to comment #2) > + const gchar *token = tp_message_get_token (tp_msg); > + > + if (token != NULL) { > + gchar *tmp = tp_escape_as_identifier ( > + tp_message_get_token (tp_msg)); > > That could be > > gchar *tmp = tp_escape_as_identifier (token); Humm that's what I meant to write, I plan the last patch of the day. :p > theme_adium_remove_mark_from_message() has the same issue (it's passed a token > which comes from tp_message_get_token (tp_msg) in > theme_adium_message_acknowledged(). > > What are the consequences of not adding x-empathy-message-id-* ? Will we fail > to mark messages as read? If so maybe we shouldn't add the focus classes? And > we probably want to implement message-token whenever possible in every CM. Humm I thought this token was used for message editing but it's actually use for acking indeed. Jonny: shouldn't we use pending-message-id instead of message-token? The former is guaranteed to be present on all incoming messages while the later is not.
Created attachment 191399 [details] [review] theme-adium: use the pending-message-id instead of message-token in x-empathy-message-id message-token is not guaranteed to be implemented by all CMs while pending-message-id is (for incoming messages).
This needs https://bugs.freedesktop.org/show_bug.cgi?id=39000 which is merged but not yet released. I'll do a tp-glib release soon.
Comment on attachment 191399 [details] [review] theme-adium: use the pending-message-id instead of message-token in x-empathy-message-id Looks good, but also add a minimum tp-glib version bump when comitting this.
Attachment 191399 [details] pushed as c5efee1 - theme-adium: use the pending-message-id instead of message-token in x-empathy-message-id