Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

[RN] Fix calendar alerts when case sensitive URLs are used

Zoltan Bettenbukcc6e04ddf87f
diff --git a/react/features/base/connection/functions.js b/react/features/base/connection/functions.js
index 9315355240..8a7a06d2b3 100644
--- a/react/features/base/connection/functions.js
+++ b/react/features/base/connection/functions.js
@@ -52,6 +52,24 @@ export function getURLWithoutParams(url: URL): URL {
return url;
}
+/**
+ * Gets a URL string without hash and query/search params from a specific
+ * {@code URL}.
+ *
+ * @param {URL} url - The {@code URL} which may have hash and query/search
+ * params.
+ * @returns {string}
+ */
+export function getURLWithoutParamsNormalized(url: URL): string {
+ const urlWithoutParams = getURLWithoutParams(url).href;
+
+ if (urlWithoutParams) {
+ return urlWithoutParams.toLowerCase();
+ }
+
+ return '';
+}
+
/**
* Converts a specific id to jid if it's not jid yet.
*
diff --git a/react/features/calendar-sync/components/ConferenceNotification.native.js b/react/features/calendar-sync/components/ConferenceNotification.native.js
index ef5ba6df6c..730d027515 100644
--- a/react/features/calendar-sync/components/ConferenceNotification.native.js
+++ b/react/features/calendar-sync/components/ConferenceNotification.native.js
@@ -8,7 +8,7 @@ import {
import { connect } from 'react-redux';
import { appNavigate } from '../../app';
-import { getURLWithoutParams } from '../../base/connection';
+import { getURLWithoutParamsNormalized } from '../../base/connection';
import { getLocalizedDateFormatter, translate } from '../../base/i18n';
import { Icon } from '../../base/font-icons';
import { ASPECT_RATIO_NARROW } from '../../base/responsive-ui';
@@ -223,7 +223,11 @@ class ConferenceNotification extends Component<Props, State> {
const now = Date.now();
for (const event of _eventList) {
- if (event.url !== _currentConferenceURL) {
+ const eventUrl = getURLWithoutParamsNormalized(
+ new URL(event.url)
+ );
+
+ if (eventUrl !== _currentConferenceURL) {
if ((!eventToShow
&& event.startDate > now
&& event.startDate < now + ALERT_MILLISECONDS)
@@ -275,7 +279,8 @@ export function _mapStateToProps(state: Object) {
return {
_aspectRatio: state['features/base/responsive-ui'].aspectRatio,
_currentConferenceURL:
- locationURL ? getURLWithoutParams(locationURL)._url : '',
+ locationURL
+ ? getURLWithoutParamsNormalized(locationURL) : '',
_eventList: state['features/calendar-sync'].events
};
}