diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2010-08-19 16:39:42 +0100 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2010-08-19 18:49:58 +0100 |
commit | 4e9f50f2a699bcba645446a3bd04831b0667597d (patch) | |
tree | 048f6c8d3a5f40ac8df7222c57265e2879280121 /telepathy-glib/base-channel.c | |
parent | b8b7c5f6b0fcbb8ccd2dfd8d5cf85151ecdb3ca3 (diff) | |
download | telepathy-glib-4e9f50f2a699bcba645446a3bd04831b0667597d.tar.gz |
Add accessors for TpBaseChannel's target and initiator
Diffstat (limited to 'telepathy-glib/base-channel.c')
-rw-r--r-- | telepathy-glib/base-channel.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/telepathy-glib/base-channel.c b/telepathy-glib/base-channel.c index 825ccf883..66c0d16ce 100644 --- a/telepathy-glib/base-channel.c +++ b/telepathy-glib/base-channel.c @@ -228,6 +228,42 @@ tp_base_channel_get_connection (TpBaseChannel *chan) return chan->priv->conn; } +/** + * tp_base_channel_get_target: + * @chan: a channel + * + * Returns the target handle of @chan, which will be 0 if + * #TpBaseChannelClass.target_type is #TP_HANDLE_TYPE_NONE for this class, and + * non-zero otherwise. This is a shortcut for retrieving the + * #TpChannelIface:handle property. + * + * Returns: (transfer none): the target handle of @chan + */ +TpHandle +tp_base_channel_get_target (TpBaseChannel *chan) +{ + g_return_val_if_fail (TP_IS_BASE_CHANNEL (chan), 0); + + return chan->priv->target; +} + +/** + * tp_base_channel_get_initiator: + * @chan: a channel + * + * Returns the initiator handle of @chan, as a shortcut for retrieving the + * #TpBaseChannel:initiator property. + * + * Returns: (transfer none): the initiator handle of @chan + */ +TpHandle +tp_base_channel_get_initiator (TpBaseChannel *chan) +{ + g_return_val_if_fail (TP_IS_BASE_CHANNEL (chan), 0); + + return chan->priv->initiator; +} + /* * tp_base_channel_add_properties: * |