aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorWill Thompson <will@willthompson.co.uk>2012-01-19 00:57:51 +0800
committerWill Thompson <will@willthompson.co.uk>2012-01-19 01:55:09 +0800
commit06c82312669b409db53928d6d5fbe21ad3f5569a (patch)
tree002b439fcb6f1ab42a151452553a7c26cb157b3e /libempathy
parent6d3a71637df970d2cf52d653399b66a213bae502 (diff)
downloadgsoc2013-empathy-06c82312669b409db53928d6d5fbe21ad3f5569a.tar
gsoc2013-empathy-06c82312669b409db53928d6d5fbe21ad3f5569a.tar.gz
gsoc2013-empathy-06c82312669b409db53928d6d5fbe21ad3f5569a.tar.bz2
gsoc2013-empathy-06c82312669b409db53928d6d5fbe21ad3f5569a.tar.lz
gsoc2013-empathy-06c82312669b409db53928d6d5fbe21ad3f5569a.tar.xz
gsoc2013-empathy-06c82312669b409db53928d6d5fbe21ad3f5569a.tar.zst
gsoc2013-empathy-06c82312669b409db53928d6d5fbe21ad3f5569a.zip
TpChat: add a :self-contact property.
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-tp-chat.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index 96eda77b8..fcef6e8a7 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -69,6 +69,7 @@ static void tp_chat_iface_init (EmpathyContactListIface *iface);
enum {
PROP_0,
PROP_ACCOUNT,
+ PROP_SELF_CONTACT,
PROP_REMOTE_CONTACT,
PROP_N_MESSAGES_SENDING,
PROP_TITLE,
@@ -948,6 +949,7 @@ tp_chat_got_renamed_contacts_cb (TpConnection *connection,
/* We change our nick */
tp_clear_object (&self->priv->user);
self->priv->user = g_object_ref (new);
+ g_object_notify (chat, "self-contact");
}
check_almost_ready (self);
@@ -1068,6 +1070,7 @@ tp_chat_got_self_contact_cb (TpConnection *connection,
self->priv->user = g_object_ref (contact);
empathy_contact_set_is_user (self->priv->user, TRUE);
+ g_object_notify (chat, "self-contact");
check_almost_ready (self);
}
@@ -1083,6 +1086,9 @@ tp_chat_get_property (GObject *object,
case PROP_ACCOUNT:
g_value_set_object (value, self->priv->account);
break;
+ case PROP_SELF_CONTACT:
+ g_value_set_object (value, self->priv->user);
+ break;
case PROP_REMOTE_CONTACT:
g_value_set_object (value, self->priv->remote_contact);
break;
@@ -1171,6 +1177,19 @@ empathy_tp_chat_class_init (EmpathyTpChatClass *klass)
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
+ /**
+ * EmpathyTpChat:self-contact:
+ *
+ * Not to be confused with TpChannel:group-self-contact.
+ */
+ g_object_class_install_property (object_class,
+ PROP_SELF_CONTACT,
+ g_param_spec_object ("self-contact",
+ "The local contact",
+ "The EmpathyContact for the local user on this channel",
+ EMPATHY_TYPE_CONTACT,
+ G_PARAM_READABLE));
+
g_object_class_install_property (object_class,
PROP_REMOTE_CONTACT,
g_param_spec_object ("remote-contact",