|
|
|
@ -15,10 +15,10 @@ import { |
|
|
|
|
CONNECTION_DISCONNECTED, |
|
|
|
|
CONNECTION_FAILED, |
|
|
|
|
JITSI_CONNECTION_CONFERENCE_KEY, |
|
|
|
|
JITSI_CONNECTION_URL_KEY |
|
|
|
|
JITSI_CONNECTION_URL_KEY, |
|
|
|
|
getURLWithoutParams |
|
|
|
|
} from '../../base/connection'; |
|
|
|
|
import { MiddlewareRegistry } from '../../base/redux'; |
|
|
|
|
import { toURLString } from '../../base/util'; |
|
|
|
|
import { ENTER_PICTURE_IN_PICTURE } from '../picture-in-picture'; |
|
|
|
|
|
|
|
|
|
import { sendEvent } from './functions'; |
|
|
|
@ -82,7 +82,7 @@ MiddlewareRegistry.register(store => next => action => { |
|
|
|
|
store, |
|
|
|
|
CONFERENCE_TERMINATED, |
|
|
|
|
/* data */ { |
|
|
|
|
url: toURLString(locationURL) |
|
|
|
|
url: _normalizeUrl(locationURL) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -106,7 +106,7 @@ MiddlewareRegistry.register(store => next => action => { |
|
|
|
|
CONFERENCE_TERMINATED, |
|
|
|
|
/* data */ { |
|
|
|
|
error: _toErrorString(error), |
|
|
|
|
url: toURLString(locationURL) |
|
|
|
|
url: _normalizeUrl(locationURL) |
|
|
|
|
}); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
@ -161,10 +161,20 @@ function _maybeTriggerEarlyConferenceWillJoin(store, action) { |
|
|
|
|
store, |
|
|
|
|
CONFERENCE_WILL_JOIN, |
|
|
|
|
/* data */ { |
|
|
|
|
url: toURLString(locationURL) |
|
|
|
|
url: _normalizeUrl(locationURL) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Normalizes the given URL for presentation over the external API. |
|
|
|
|
* |
|
|
|
|
* @param {URL} url -The URL to normalize. |
|
|
|
|
* @returns {string} - The normalized URL as a string. |
|
|
|
|
*/ |
|
|
|
|
function _normalizeUrl(url: URL) { |
|
|
|
|
return getURLWithoutParams(url).href; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Sends an event to the native counterpart of the External API for a specific |
|
|
|
|
* conference-related redux action. |
|
|
|
@ -186,7 +196,7 @@ function _sendConferenceEvent( |
|
|
|
|
// instance. The external API cannot transport such an object so we have to
|
|
|
|
|
// transport an "equivalent".
|
|
|
|
|
if (conference) { |
|
|
|
|
data.url = toURLString(conference[JITSI_CONFERENCE_URL_KEY]); |
|
|
|
|
data.url = _normalizeUrl(conference[JITSI_CONFERENCE_URL_KEY]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (_swallowEvent(store, action, data)) { |
|
|
|
@ -233,7 +243,7 @@ function _sendConferenceFailedOnConnectionError(store, action) { |
|
|
|
|
store, |
|
|
|
|
CONFERENCE_TERMINATED, |
|
|
|
|
/* data */ { |
|
|
|
|
url: toURLString(locationURL), |
|
|
|
|
url: _normalizeUrl(locationURL), |
|
|
|
|
error: action.error.name |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|