Channels should be able to tell features that needs to be prepared on its connection
@xclaesse
Submitted by Xavier Claessens Assigned to Telepathy bugs list
Description
Interesting Empathy bug: https://bugzilla.gnome.org/show_bug.cgi?id=691006
AFAIK what happens:
- have a chat window open
- get disconnected
- get reconnected
- empathy-chat prepare CORE for its TpConnection while still in CONNECTING state. So self-contact is still NULL.
- connection is now CONNECTED, so TpConnection start re-introspection. empathy-chat re-request a text channel.
- empathy-chat receive a text channel and start preparing it. Channel's TpConnection is still in the re-introspecting state, so CORE is ready but not CONNECTED, and self-contact is still NULL.
- while preparing EmpathyTpChat (the TpTextChannel subclass) it assume that its TpConnection already knows its self-contact, and then crash because it's not yet true.
TpChannel already has code that first prepare CORE on TpConnection before doing anything else, but in this scenario CORE is prepared but it does not mean the connection is CONNECTED already. We cannot make TpChannel always depend on CONNECTED feature on its TpConnection because of SASL channels.
So I suggest having a way for TpChannel subclasses to tell which features it depends on for its TpConnection. What about:
GArray *TpChannelClass::dup_required_connection_features(TpChannel *self);
TpChannel's default implementation would return a new array with only CORE, but subclasses could override, first chainup to parent, then add what they want it the array.