|
@@ -4,7 +4,7 @@ import RNCalendarEvents from 'react-native-calendar-events';
|
4
|
4
|
|
5
|
5
|
import { SET_ROOM } from '../base/conference';
|
6
|
6
|
import { MiddlewareRegistry } from '../base/redux';
|
7
|
|
-import { parseURIString } from '../base/util';
|
|
7
|
+import { APP_LINK_SCHEME, parseURIString } from '../base/util';
|
8
|
8
|
|
9
|
9
|
import { APP_WILL_MOUNT } from '../app';
|
10
|
10
|
|
|
@@ -161,8 +161,13 @@ function _fetchCalendarEntries(store) {
|
161
|
161
|
*
|
162
|
162
|
*/
|
163
|
163
|
function _getURLFromEvent(event, knownDomains) {
|
|
164
|
+ const linkTerminatorPattern = '[^\\s<>$]';
|
|
165
|
+ /* eslint-disable max-len */
|
164
|
166
|
const urlRegExp
|
165
|
|
- = new RegExp(`http(s)?://(${knownDomains.join('|')})/[^\\s<>$]+`, 'gi');
|
|
167
|
+ = new RegExp(`http(s)?://(${knownDomains.join('|')})/${linkTerminatorPattern}+`, 'gi');
|
|
168
|
+ /* eslint-enable max-len */
|
|
169
|
+ const schemeRegExp
|
|
170
|
+ = new RegExp(`${APP_LINK_SCHEME}${linkTerminatorPattern}+`, 'gi');
|
166
|
171
|
const fieldsToSearch = [
|
167
|
172
|
event.title,
|
168
|
173
|
event.url,
|
|
@@ -175,7 +180,9 @@ function _getURLFromEvent(event, knownDomains) {
|
175
|
180
|
for (const field of fieldsToSearch) {
|
176
|
181
|
if (typeof field === 'string') {
|
177
|
182
|
if (
|
178
|
|
- (matchArray = urlRegExp.exec(field)) !== null
|
|
183
|
+ (matchArray
|
|
184
|
+ = urlRegExp.exec(field) || schemeRegExp.exec(field))
|
|
185
|
+ !== null
|
179
|
186
|
) {
|
180
|
187
|
return matchArray[0];
|
181
|
188
|
}
|