summaryrefslogtreecommitdiff
path: root/src/idle-text.c
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2008-08-29 16:47:48 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2008-08-29 17:01:29 +0100
commite86db64ce63408f00d5bd988545984ebac0c3c91 (patch)
tree34906a1e4e25cd6a8c98d3e5ac1a883f9310637d /src/idle-text.c
parent6d2cdaa645d0b626d719aa8edb444eddc602a7e5 (diff)
Don't use an invalid enum value as a failure flag
Diffstat (limited to 'src/idle-text.c')
-rw-r--r--src/idle-text.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/idle-text.c b/src/idle-text.c
index 982c5ea..bd71eec 100644
--- a/src/idle-text.c
+++ b/src/idle-text.c
@@ -29,7 +29,7 @@
#include "idle-ctcp.h"
#include "idle-debug.h"
-void idle_text_decode(const gchar *text, TpChannelTextMessageType *type, gchar **body) {
+gboolean idle_text_decode(const gchar *text, TpChannelTextMessageType *type, gchar **body) {
gchar *tmp = NULL;
if (text[0] != '\001') {
@@ -41,13 +41,14 @@ void idle_text_decode(const gchar *text, TpChannelTextMessageType *type, gchar *
*type = TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION;
tmp = g_strndup(text + actionlen, strlen(text + actionlen) - 1);
} else {
- *type = -1;
- tmp = NULL;
+ *body = NULL;
+ return FALSE;
}
}
*body = idle_ctcp_kill_blingbling(tmp);
g_free(tmp);
+ return TRUE;
}
void idle_text_send(GObject *obj, guint type, const gchar *recipient, const gchar *text, IdleConnection *conn, DBusGMethodInvocation *context) {