From c74685b02308c82d355fc59e1aa8491c84a2f114 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Wed, 26 Aug 2009 19:47:49 +0100 Subject: [PATCH] Don't parse message in EmpathyMessage:body setter This fixes a bug where the message (Type_Action, "/me wooo yay") is printed as " ! wjt woo yay" rather than as " ! wjt /me woo yay". This also fixes Gnome bug #593101 (Empathy exits sending empty /me message), which was caused by this deleted code walking off the end of the string "/me". --- libempathy/empathy-message.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/libempathy/empathy-message.c b/libempathy/empathy-message.c index 0da55112..34a46675 100644 --- a/libempathy/empathy-message.c +++ b/libempathy/empathy-message.c @@ -393,28 +393,15 @@ empathy_message_set_body (EmpathyMessage *message, const gchar *body) { EmpathyMessagePriv *priv = GET_PRIV (message); - TpChannelTextMessageType type; g_return_if_fail (EMPATHY_IS_MESSAGE (message)); g_free (priv->body); - priv->body = NULL; - - type = TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL; - if (g_str_has_prefix (body, "/me")) { - type = TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION; - body += 4; - } - else if (g_str_has_prefix (body, "/say")) { - body += 5; - } if (body) { priv->body = g_strdup (body); - } - - if (type != priv->type) { - empathy_message_set_tptype (message, type); + } else { + priv->body = NULL; } g_object_notify (G_OBJECT (message), "body"); -- 2.39.2