InterfaceFactory._valid_interfaces is not really valid before connection
Submitted by Fabien LOUIS
Assigned to Telepathy bugs list
Description
Created attachment 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.
Patch 33757, "Patch to fix _valid_interfaces attribute":
fix_valid_interfaces.patch