GNOME Bugzilla – Bug 747415
Encoding Issues with the Topic
Last modified: 2016-02-10 10:08:41 UTC
Created attachment 301026 [details] Encoding issues in the topic. I'm not exactly sure what's causing this, but whenever there are some special symbols (or could it be colored titles?) in the topic, encoding issues such as these in the attachment appear.
Yeah, those look like color codes ...
Bug 711081 already provides a fix for status messages, we just need to apply it to the topic too.
Created attachment 320738 [details] [review] room: Strip color codes from room topics Topic can be set by user, and some IRC clients support color codes. We don't support color codes, so displaying escape sequences looks broken. We already strip color codes for status messages (bug 711081), do the same for room topics.
Review of attachment 320738 [details] [review]: ::: src/lib/polari-room.c @@ +380,1 @@ if (subject == NULL || g_strcmp0 (priv->topic, subject) == 0) You leak subject if that condition is met.
Created attachment 320753 [details] [review] room: Strip color codes from room topics Topic can be set by user, and some IRC clients support color codes. We don't support color codes, so displaying escape sequences looks broken. We already strip color codes for status messages (bug 711081), do the same for room topics.
Review of attachment 320753 [details] [review]: Looks good, just some style nits ::: src/lib/polari-room.c @@ +371,3 @@ + raw_subject = tp_asv_get_string (properties, "Subject"); + + if (raw_subject) I think this is slightly cleaner: raw_subject = ... if (raw_subject == NULL) return; subject = strip_color_codes(); if (g_strcmp0 (topic, subject) == 0) ... @@ +381,2 @@ g_free (priv->topic); + priv->topic = g_strdup (subject); We already own the memory for subject here (i.e. the return value of strip_color_codes()), so we could just use that directly (i.e. no strdup()/free())
Created attachment 320754 [details] [review] room: Strip color codes from room topics Topic can be set by user, and some IRC clients support color codes. We don't support color codes, so displaying escape sequences looks broken. We already strip color codes for status messages (bug 711081), do the same for room topics.
Review of attachment 320754 [details] [review]: OK
Comment on attachment 320754 [details] [review] room: Strip color codes from room topics Attachment 320754 [details] pushed as 5944ead - room: Strip color codes from room topics