diff options
author | Mikhail Zabaluev <mikhail.zabaluev@nokia.com> | 2008-02-05 15:43:25 +0000 |
---|---|---|
committer | Mikhail Zabaluev <mikhail.zabaluev@nokia.com> | 2008-02-05 15:43:25 +0000 |
commit | e5c3eb266a6cf796ef65bd9b8bf1c429c89a8a6b (patch) | |
tree | 59c8e1370c852b6c67aa029541eae7d7d80175a4 /src/sip-media-channel.c | |
parent | 99b4ff90ad0b4b484011b91bd11e1490318408c4 (diff) |
Removed the 'state' property on SIPMediaSession.
Use function sip_media_session_change_state() as the way to
change the session state.
Instead of using detailed signal 'notify:state', use the
newly introduced signal 'state-changed'; we get to control
the moment of its emission, and the handling, with more precision.
20080205154325-5b6ca-ef4cd28c8dad3860e1c471cde721d56b1d0fe2a3.gz
Diffstat (limited to 'src/sip-media-channel.c')
-rw-r--r-- | src/sip-media-channel.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/src/sip-media-channel.c b/src/sip-media-channel.c index 251abd3..b0a6beb 100644 --- a/src/sip-media-channel.c +++ b/src/sip-media-channel.c @@ -494,18 +494,13 @@ sip_media_channel_close (SIPMediaChannel *obj) void sip_media_channel_terminated (SIPMediaChannel *self) { - SIPMediaChannelPrivate *priv; + SIPMediaChannelPrivate *priv = SIP_MEDIA_CHANNEL_GET_PRIVATE (self); DEBUG("enter"); - priv = SIP_MEDIA_CHANNEL_GET_PRIVATE (self); - if (priv->session) - { - g_object_set (priv->session, - "state", SIP_MEDIA_SESSION_STATE_ENDED, - NULL); - } + sip_media_session_change_state (priv->session, + SIP_MEDIA_SESSION_STATE_ENDED); } /** @@ -998,22 +993,20 @@ sip_media_channel_peer_cancel (SIPMediaChannel *self, ***********************************************************************/ static void priv_session_state_changed_cb (SIPMediaSession *session, - GParamSpec *arg1, + guint old_state, + guint state, SIPMediaChannel *channel) { TpGroupMixin *mixin = TP_GROUP_MIXIN (channel); - SIPMediaSessionState state; TpHandle peer; TpIntSet *set; DEBUG("enter"); - g_object_get (session, - "state", &state, - "peer", &peer, - NULL); + peer = sip_media_session_get_peer (session); - if (state == SIP_MEDIA_SESSION_STATE_ACTIVE) { + if (state == SIP_MEDIA_SESSION_STATE_ACTIVE + && old_state != SIP_MEDIA_SESSION_STATE_REINVITE_SENT) { set = tp_intset_new (); /* add the peer to the member list */ @@ -1030,7 +1023,7 @@ static void priv_session_state_changed_cb (SIPMediaSession *session, TP_CHANNEL_GROUP_FLAG_CAN_ADD | TP_CHANNEL_GROUP_FLAG_CAN_RESCIND); } - else if (state == SIP_MEDIA_SESSION_STATE_ENDED) { + if (state == SIP_MEDIA_SESSION_STATE_ENDED) { set = tp_intset_new (); /* remove us and the peer from the member list */ @@ -1109,10 +1102,15 @@ priv_create_session (SIPMediaChannel *channel, g_free (local_ip_address); - g_signal_connect (session, "notify::state", - (GCallback) priv_session_state_changed_cb, channel); - g_signal_connect (session, "stream-added", - (GCallback) priv_session_stream_added_cb, channel); + g_signal_connect (session, + "stream-added", + G_CALLBACK(priv_session_stream_added_cb), + channel); + g_signal_connect_object (session, + "state-changed", + G_CALLBACK(priv_session_state_changed_cb), + channel, + 0); priv->session = session; |