From 017907974275e7fd9c8d61d0b87daa92e9506a67 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Wed, 29 Aug 2012 18:42:25 +0300 Subject: [PATCH] telepathy: only change to "connected" state once Core calls sipe_backend_connection_completed() on every successful re-registration response, but telepathy doesn't like it when we try to change the connection status from "connected" to "connected". --- src/telepathy/telepathy-connection.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/telepathy/telepathy-connection.c b/src/telepathy/telepathy-connection.c index 0d4fa46c..e2adf50e 100644 --- a/src/telepathy/telepathy-connection.c +++ b/src/telepathy/telepathy-connection.c @@ -451,10 +451,14 @@ TpBaseConnection *sipe_telepathy_connection_new(TpBaseProtocol *protocol, */ void sipe_backend_connection_completed(struct sipe_core_public *sipe_public) { - SipeConnection *self = SIPE_PUBLIC_TO_CONNECTION; - tp_base_connection_change_status(TP_BASE_CONNECTION(self), - TP_CONNECTION_STATUS_CONNECTED, - TP_CONNECTION_STATUS_REASON_REQUESTED); + SipeConnection *self = SIPE_PUBLIC_TO_CONNECTION; + TpBaseConnection *base = TP_BASE_CONNECTION(self); + + /* we are only allowed to do this once */ + if (base->status != TP_CONNECTION_STATUS_CONNECTED) + tp_base_connection_change_status(base, + TP_CONNECTION_STATUS_CONNECTED, + TP_CONNECTION_STATUS_REASON_REQUESTED); } void sipe_backend_connection_error(struct sipe_core_public *sipe_public, -- 2.11.4.GIT