Reinstate per-status callbacks in TpChannelManager
@wjt
Submitted by Will Thompson Assigned to Telepathy bugs list
Description
TpChannelFactoryIface had callbacks for the different states a connection can move into (as discussed briefly on bug 17631). TpChannelManager doesn't, on the basis that you can use :status-changed. While that's true, it means that pretty much every single channel manager has code like this:
static void connection_status_changed_cb (GabbleConnection *conn, guint status, guint reason, GabbleFtManager *self) {
switch (status) { case TP_CONNECTION_STATUS_CONNECTING: g_signal_connect (self->priv->connection->jingle_factory, "new-session", G_CALLBACK (new_jingle_session_cb), self); break;
case TP_CONNECTION_STATUS_DISCONNECTED:
ft_manager_close_all (self);
if (self->priv->status_changed_id != 0)
{
g_signal_handler_disconnect (self->priv->connection,
self->priv->status_changed_id);
self->priv->status_changed_id = 0;
}
break;
}
}
It would be nice if we could use a signal detail to connect different callbacks to the different statuses. The signal's generated by dbus-glib, so I don't know how much this is going to fly.