[ekiga/v4_0] Opal: Moved MessageSummary subscription to Opal::Account.
- From: Eugen Dedu <ededu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga/v4_0] Opal: Moved MessageSummary subscription to Opal::Account.
- Date: Mon, 18 Feb 2013 20:25:43 +0000 (UTC)
commit d3d7ef37a986810c1546f528f9a46efb9df36e71
Author: Damien Sandras <dsandras beip be>
Date: Sun Jan 20 17:58:59 2013 +0100
Opal: Moved MessageSummary subscription to Opal::Account.
This allows subscribing/unsubscribing when enabling and disabling SIP
accounts. It should fix the bug where OPTIONS requests keep being sent
after the account has been disabled.
lib/engine/components/opal/opal-account.cpp | 10 ++++++++--
lib/engine/components/opal/sip-endpoint.cpp | 4 ----
2 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-account.cpp b/lib/engine/components/opal/opal-account.cpp
index dac5f8e..c63a183 100644
--- a/lib/engine/components/opal/opal-account.cpp
+++ b/lib/engine/components/opal/opal-account.cpp
@@ -348,8 +348,10 @@ void Opal::Account::disable ()
h323_endpoint->unsubscribe (*this, presentity);
else
#endif
- sip_endpoint->unsubscribe (*this, presentity);
-
+ {
+ sip_endpoint->unsubscribe (*this, presentity);
+ sip_endpoint->Unsubscribe (SIPSubscribe::MessageSummary, get_aor ());
+ }
// Translators: this is a state, not an action, i.e. it should be read as
// "(you are) unregistered", and not as "(you have been) unregistered"
status = _("Unregistered");
@@ -646,9 +648,13 @@ Opal::Account::handle_registration_event (RegistrationState state_,
presentity->SubscribeToPresence (PString (*iter));
}
presentity->SetLocalPresence (personal_state, presence_status);
+ if (type != Account::H323) {
+ sip_endpoint->Subscribe (SIPSubscribe::MessageSummary, 3600, get_aor ());
+ }
}
if (presence_core && personal_details)
presence_core->publish (personal_details);
+
state = state_;
failed_registration_already_notified = false;
updated ();
diff --git a/lib/engine/components/opal/sip-endpoint.cpp b/lib/engine/components/opal/sip-endpoint.cpp
index d754044..ff7dca9 100644
--- a/lib/engine/components/opal/sip-endpoint.cpp
+++ b/lib/engine/components/opal/sip-endpoint.cpp
@@ -1007,10 +1007,6 @@ Opal::Sip::EndPoint::registration_event_in_main (const std::string aor,
Opal::Account::RegistrationState state,
const std::string msg)
{
- /* Subscribe for MWI */
- if (state == Opal::Account::Registered &&!IsSubscribed (SIPSubscribe::MessageSummary, aor))
- Subscribe (SIPSubscribe::MessageSummary, 3600, aor);
-
if (boost::shared_ptr<Opal::Bank> bk = bank.lock ()) {
AccountPtr account = bk->find_account (aor);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]