]> git.0d.be Git - empathy.git/commitdiff
Don't parse message in EmpathyMessage:body setter
authorWill Thompson <will.thompson@collabora.co.uk>
Wed, 26 Aug 2009 18:47:49 +0000 (19:47 +0100)
committerWill Thompson <will.thompson@collabora.co.uk>
Thu, 27 Aug 2009 20:16:53 +0000 (21:16 +0100)
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

index 0da55112de70d65d681024ccda132e00eaaf4581..34a4667525790d95fc1142f5e8d4de45bcfae80a 100644 (file)
@@ -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");