[empathy: 3/5] Don't parse message in EmpathyMessage:body setter
- From: Will Thompson <wjt src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [empathy: 3/5] Don't parse message in EmpathyMessage:body setter
- Date: Fri, 28 Aug 2009 12:19:17 +0000 (UTC)
commit c74685b02308c82d355fc59e1aa8491c84a2f114
Author: Will Thompson <will thompson collabora co uk>
Date: Wed Aug 26 19:47:49 2009 +0100
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 files changed, 2 insertions(+), 15 deletions(-)
---
diff --git a/libempathy/empathy-message.c b/libempathy/empathy-message.c
index 0da5511..34a4667 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");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]