[Bug 26883] New: InterfaceFactory._valid_interfaces is not really valid before connection

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Mar 4 15:32:45 CET 2010


http://bugs.freedesktop.org/show_bug.cgi?id=26883

           Summary: InterfaceFactory._valid_interfaces is not really valid
                    before connection
           Product: Telepathy
           Version: unspecified
          Platform: Other
        OS/Version: Linux (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: tp-python
        AssignedTo: telepathy-bugs at lists.freedesktop.org
        ReportedBy: flouis at viotech.net


Created an attachment (id=33757)
 --> (http://bugs.freedesktop.org/attachment.cgi?id=33757)
Patch to fix _valid_interfaces attribute

Before the status of the connection was set to CONNECTION_STATUS_CONNECTED
(which calls self._get_interfaces()), the attribute _valid_interfaces
(InterfaceFactory.) isn't the copy of self[CONN_INTERFACE].GetInterfaces().

Indeed, once Connection is created (but not connected), the attribute
_valid_interfaces contains only
set(['org.freedesktop.Telepathy.Connection',
'org.freedesktop.DBus.Properties'])

In the other hand, self[CONN_INTERFACE].GetInterfaces() returns:
dbus.Array([dbus.String(u'org.freedesktop.Telepathy.Connection.Interface.Aliasing'),
dbus.String(u'org.freedesktop.Telepathy.Connection.Interface.Capabilities'),
dbus.String(u'org.freedesktop.Telepathy.Connection.Interface.SimplePresence'),
dbus.String(u'org.freedesktop.Telepathy.Connection.Interface.Presence'),
dbus.String(u'org.freedesktop.Telepathy.Connection.Interface.Avatars'),
dbus.String(u'org.freedesktop.Telepathy.Connection.Interface.Contacts'),
dbus.String(u'org.freedesktop.Telepathy.Connection.Interface.Requests'),
dbus.String(u'org.laptop.Telepathy.Gadget'),
dbus.String(u'org.freedesktop.Telepathy.Connection.Interface.ContactCapabilities.DRAFT'),
dbus.String(u'org.freedesktop.Telepathy.Connection.Interface.Location')],
signature=dbus.Signature('s'))

----

So I created a patche which calls self[CONN_INTERFACE].GetInterfaces() and
updates this attribute (_valid_interfaces) in the __init__ of Connection.

Of course, you are free to modify this patch :)

----

HS: I had need this changes because I want to call SetPresence before calling
Connect(), which wasn't possible before.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the telepathy-bugs mailing list