diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-12-10 14:46:38 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-12-10 14:58:51 +0000 |
commit | 0748712748d2a02a13a15141283253e844b6edac (patch) | |
tree | 6f8866032bd0b2ab79ff7e03ff0e7490b7d9d85b /telepathy-glib/message-mixin.c | |
parent | 10cf1d1447dbc116a0ca1312437aceb10f391315 (diff) | |
download | telepathy-glib-0748712748d2a02a13a15141283253e844b6edac.tar.gz |
tp_message_mixin_sent: set the sender
Diffstat (limited to 'telepathy-glib/message-mixin.c')
-rw-r--r-- | telepathy-glib/message-mixin.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/telepathy-glib/message-mixin.c b/telepathy-glib/message-mixin.c index c57ba99ee..2ac2f1e3c 100644 --- a/telepathy-glib/message-mixin.c +++ b/telepathy-glib/message-mixin.c @@ -62,6 +62,7 @@ #include <telepathy-glib/dbus.h> #include <telepathy-glib/enums.h> #include <telepathy-glib/errors.h> +#include <telepathy-glib/group-mixin.h> #include <telepathy-glib/gtypes.h> #include <telepathy-glib/interfaces.h> #include <telepathy-glib/message-internal.h> @@ -876,10 +877,22 @@ tp_message_mixin_sent (GObject *object, TpChannelTextMessageType message_type; gchar *string; GHashTable *header = g_ptr_array_index (message->parts, 0); + TpHandle self_handle = 0; if (tp_asv_get_uint64 (header, "message-sent", NULL) == 0) tp_message_set_uint64 (message, 0, "message-sent", time (NULL)); + if (TP_HAS_GROUP_MIXIN (object)) + { + tp_group_mixin_get_self_handle (object, &self_handle, NULL); + } + + if (self_handle == 0) + self_handle = tp_base_connection_get_self_handle ( + mixin->priv->connection); + + tp_cm_message_set_sender (message, self_handle); + /* emit Sent and MessageSent */ tp_svc_channel_interface_messages_emit_message_sent (object, |