diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2008-10-30 18:31:21 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2008-10-30 18:33:07 +0000 |
commit | a90d5f35d244121b1bb8b9248e9e6c278761ba47 (patch) | |
tree | c7f8d28981b71410d2b2e6e327c3b8a163752d99 /telepathy-glib/text-mixin.c | |
parent | 1ef1d842f6d4c79f5be8507c686a4cd075d8e27a (diff) | |
download | telepathy-glib-a90d5f35d244121b1bb8b9248e9e6c278761ba47.tar.gz |
Add tp_text_mixin_receive_with_flags
This lets us signal that we have received messages with special flags
(MUC scrollback is the only useful one at the moment).
Diffstat (limited to 'telepathy-glib/text-mixin.c')
-rw-r--r-- | telepathy-glib/text-mixin.c | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/telepathy-glib/text-mixin.c b/telepathy-glib/text-mixin.c index 50ad778cc..2fbd8322d 100644 --- a/telepathy-glib/text-mixin.c +++ b/telepathy-glib/text-mixin.c @@ -267,12 +267,13 @@ tp_text_mixin_finalize (GObject *obj) } /** - * tp_text_mixin_receive: + * tp_text_mixin_receive_with_flags: * @obj: An object with the text mixin * @type: The type of message received from the underlying protocol * @sender: The handle of the message sender * @timestamp: The time the message was received * @text: The text of the message + * @flags: the message's flags * * Add a message to the pending queue and emit Received. * @@ -280,11 +281,12 @@ tp_text_mixin_finalize (GObject *obj) * limit. */ gboolean -tp_text_mixin_receive (GObject *obj, - TpChannelTextMessageType type, - TpHandle sender, - time_t timestamp, - const char *text) +tp_text_mixin_receive_with_flags (GObject *obj, + TpChannelTextMessageType type, + TpHandle sender, + time_t timestamp, + const char *text, + TpChannelTextMessageFlags flags) { TpTextMixin *mixin = TP_TEXT_MIXIN (obj); _PendingMessage *msg; @@ -298,6 +300,7 @@ tp_text_mixin_receive (GObject *obj, msg->id = mixin->priv->recv_id++; msg->timestamp = timestamp; msg->type = type; + msg->flags = flags; len = strlen (text); msg->text = g_try_malloc (len + 1); @@ -336,6 +339,32 @@ tp_text_mixin_receive (GObject *obj, return TRUE; } + +/** + * tp_text_mixin_receive: + * @obj: An object with the text mixin + * @type: The type of message received from the underlying protocol + * @sender: The handle of the message sender + * @timestamp: The time the message was received + * @text: The text of the message + * + * Add a message to the pending queue and emit Received. Exactly equivalent + * to tp_text_mixin_receive_with_flags() with @flags == 0. + * + * Returns: %TRUE on success; %FALSE if the message was lost due to the memory + * limit. + */ +gboolean +tp_text_mixin_receive (GObject *obj, + TpChannelTextMessageType type, + TpHandle sender, + time_t timestamp, + const char *text) +{ + return tp_text_mixin_receive_with_flags (obj, type, sender, timestamp, text, + 0); +} + static gint compare_pending_message (gconstpointer haystack, gconstpointer needle) |