Bumping to 0.7.6 and releasing the package
[theonering] / src / connection_manager.py
index 207f773..92a12ae 100644 (file)
@@ -1,11 +1,3 @@
-"""
-Empathy Experience:
-       Can't call
-       When first started, reports all read conversations when some might have been read
-       When first started, reports all of an SMS conversation even though some has been reported previously
-       Still leaking one of two contact lists
-"""
-
 import logging
 
 import gobject
@@ -14,6 +6,7 @@ import telepathy
 import constants
 import tp
 import gtk_toolbox
+import util.go_utils as gobject_utils
 import connection
 
 
@@ -45,34 +38,24 @@ class TheOneRingConnectionManager(tp.ConnectionManager):
                mandatoryParameters = ConnectionClass._mandatory_parameters
                optionalParameters = ConnectionClass._optional_parameters
                defaultParameters = ConnectionClass._parameter_defaults
+               secretParameters = ConnectionClass._secret_parameters
 
                for parameterName, parameterType in mandatoryParameters.iteritems():
                        flags = telepathy.CONN_MGR_PARAM_FLAG_REQUIRED
-                       if parameterName == "password":
+                       if parameterName in secretParameters:
                                flags |= telepathy.CONN_MGR_PARAM_FLAG_SECRET
-                       param = (
-                               parameterName,
-                               flags,
-                               parameterType,
-                               '',
-                       )
+                       param = (parameterName, flags, parameterType, "")
                        result.append(param)
 
                for parameterName, parameterType in optionalParameters.iteritems():
+                       flags = 0
+                       default = ""
+                       if parameterName in secretParameters:
+                               flags |= telepathy.CONN_MGR_PARAM_FLAG_SECRET
                        if parameterName in defaultParameters:
-                               flags = telepathy.CONN_MGR_PARAM_FLAG_HAS_DEFAULT
-                               if parameterName == "password":
-                                       flags |= telepathy.CONN_MGR_PARAM_FLAG_SECRET
+                               flags |= telepathy.CONN_MGR_PARAM_FLAG_HAS_DEFAULT
                                default = defaultParameters[parameterName]
-                       else:
-                               flags = 0
-                               default = ""
-                       param = (
-                               parameterName,
-                               flags,
-                               parameterName,
-                               default,
-                       )
+                       param = (parameterName, flags, parameterType, default)
                        result.append(param)
 
                return result
@@ -82,7 +65,7 @@ class TheOneRingConnectionManager(tp.ConnectionManager):
                Overrides tp.ConnectionManager
                """
                result = tp.ConnectionManager.disconnected(self, conn)
-               gobject.timeout_add(5000, self._shutdown)
+               gobject_utils.timeout_add_seconds(5, self._shutdown)
 
        def quit(self):
                """