Saúl Ibarra Corretgé 774c5ecd18 rn: ensure the conference terminated event is always sent
Dear reader, I'm not proud at all of what you are about to read, but sometimes
life just gives you lemons, so enjoy some lemonade!

Joining a conference implies first creating the XMPP connection and then joining
the MUC. It's very possible the XMPP connection was made but there was no chance
for the conference to be created.

This patch fixes this case by artificially genrating a conference terminated
event in such case. In order to have all the necessary knowledge for this event
to be sent the connection now keeps track of the conference that runs it.

In addition, there is an even more obscure corner case: it's not impossible to
try to disconnect when there is not even a connection. This was fixed by
creating a fake disconnect event. Alas the location URL is lost at this point,
but it's better than nothing I guess.
2019-04-25 14:04:26 +02:00

20 lines
967 B
JavaScript

// @flow
/**
* The name of the {@code JitsiConnection} property which identifies the {@code JitsiConference} currently associated
* with it.
*
* FIXME: This is a hack. It was introduced to solve the following case: if a user presses hangup quickly, they may
* "leave the conference" before the actual conference was ever created. While we might have a connection in place,
* there is no conference which can be left, thus no CONFERENCE_LEFT action will ever be fired.
*
* This is problematic because the external API module used to send events to the native SDK won't know what to send.
* So, in order to detect this situation we are attaching the conference object to the connection which runs it.
*/
export const JITSI_CONNECTION_CONFERENCE_KEY = Symbol('conference');
/**
* The name of the {@code JitsiConnection} property which identifies the location URL where the connection will be made.
*/
export const JITSI_CONNECTION_URL_KEY = Symbol('url');