X-Git-Url: http://git.maemo.org/git/?p=theonering;a=blobdiff_plain;f=src%2Fautogv.py;h=9a0f61ef42123a7f9b6a67b4e3233f65598c3a74;hp=9f4bafa627f7dd06818570c007c40764aa96a38a;hb=e31b65ea26b238366776d0f9d7d857a5a4775fae;hpb=4664dde6da5f0add2d5d3426bf8d4202bb9c67bc diff --git a/src/autogv.py b/src/autogv.py index 9f4bafa..9a0f61e 100644 --- a/src/autogv.py +++ b/src/autogv.py @@ -108,6 +108,7 @@ class RefreshVoicemail(object): self._isStarted = False + @misc_utils.log_exception(_moduleLogger) def _on_new_channel(self, bus, serviceName, connObjectPath, channelObjectPath, channelType): if channelType != telepathy.interfaces.CHANNEL_TYPE_STREAMED_MEDIA: return @@ -147,11 +148,12 @@ class TimedDisconnect(object): self.__delayedDisconnect = gobject_utils.Timeout(self._on_delayed_disconnect) def start(self): - self.__delayedDisconnect.start(seconds=10) + self.__delayedDisconnect.start(seconds=20) def stop(self): self.__delayedDisconnect.cancel() + @misc_utils.log_exception(_moduleLogger) def _on_delayed_disconnect(self): _moduleLogger.info("Timed disconnect occurred") self._connRef().disconnect(telepathy.CONNECTION_STATUS_REASON_NETWORK_ERROR) @@ -195,6 +197,7 @@ class AutoDisconnect(object): else: _moduleLogger.info("Other status: %r" % (status, )) + @misc_utils.log_exception(_moduleLogger) def _cancel_delayed_disconnect(self): _moduleLogger.info("Cancelling auto-log off") self.__delayedDisconnect.cancel() @@ -251,3 +254,22 @@ class DisconnectOnShutdown(object): self._connRef().disconnect(telepathy.CONNECTION_STATUS_REASON_REQUESTED) except Exception: _moduleLogger.exception("Error durring disconnect") + + +class DelayEnableContactIntegration(object): + + def __init__(self, protocolName): + self.__enableSystemContactSupport = telepathy_utils.EnableSystemContactIntegration( + protocolName + ) + self.__delayedEnable = gobject_utils.Async(self._on_delayed_enable) + + def start(self): + self.__delayedEnable.start() + + def stop(self): + self.__delayedEnable.cancel() + + @misc_utils.log_exception(_moduleLogger) + def _on_delayed_enable(self): + self.__enableSystemContactSupport.start()