From there commit message
"""
Be explicit about data types in methods that produce contact attributes
Previously, the wrong type was returned for SimplePresence/presence.
Until telepathy-glib 0.11.3, this was masked by the fact that TpContact
would respond to missing or wrongly-typed information in the result of
GetContactAttributes by falling back to a slower path. This is no longer
done, meaning that all Butterfly contacts appear to have UNKNOWN presence.
"""
import telepathy
import tp
import telepathy
import tp
def GetAliases(self, contactHandleIds):
_moduleLogger.debug("Called GetAliases")
def GetAliases(self, contactHandleIds):
_moduleLogger.debug("Called GetAliases")
- idToAlias = dict(
- (handleId, self._get_alias(handleId))
- for handleId in contactHandleIds
+ idToAlias = dbus.Dictionary(
+ (
+ (handleId, self._get_alias(handleId))
+ for handleId in contactHandleIds
+ ),
+ signature="us",
)
handle_type = telepathy.HANDLE_TYPE_CONTACT
)
handle_type = telepathy.HANDLE_TYPE_CONTACT
+ ret = dbus.Dictionary(signature='ua{sv}')
+ ret[handle] = dbus.Dictionary(signature='sv')
functions = {
telepathy.CONNECTION:
functions = {
telepathy.CONNECTION:
import telepathy
import util.misc as misc_utils
import telepathy
import util.misc as misc_utils
OFFLINE = 'offline'
TO_PRESENCE_TYPE = {
OFFLINE = 'offline'
TO_PRESENCE_TYPE = {
- ONLINE: telepathy.constants.CONNECTION_PRESENCE_TYPE_AVAILABLE,
- AWAY: telepathy.constants.CONNECTION_PRESENCE_TYPE_AWAY,
- HIDDEN: telepathy.constants.CONNECTION_PRESENCE_TYPE_HIDDEN,
- OFFLINE: telepathy.constants.CONNECTION_PRESENCE_TYPE_OFFLINE,
+ ONLINE: dbus.UInt32(telepathy.constants.CONNECTION_PRESENCE_TYPE_AVAILABLE),
+ AWAY: dbus.UInt32(telepathy.constants.CONNECTION_PRESENCE_TYPE_AWAY),
+ HIDDEN: dbus.UInt32(telepathy.constants.CONNECTION_PRESENCE_TYPE_HIDDEN),
+ OFFLINE: dbus.UInt32(telepathy.constants.CONNECTION_PRESENCE_TYPE_OFFLINE),
@return {ContactHandle: (Status, Presence Type, Message)}
"""
personalMessage = u""
@return {ContactHandle: (Status, Presence Type, Message)}
"""
personalMessage = u""
- return dict(
- (h, (presenceType, presence, personalMessage))
- for (h, (presenceType, presence)) in self.get_presences(contacts).iteritems()
+ return dbus.Dictionary(
+ (
+ (h, dbus.Struct((presenceType, presence, personalMessage), signature="uss"))
+ for (h, (presenceType, presence)) in self.get_presences(contacts).iteritems()
+ ),
+ signature="u(uss)"
)
@misc_utils.log_exception(_moduleLogger)
)
@misc_utils.log_exception(_moduleLogger)