chore: Remove unused Jitsi deep link (#5361)
This commit is contained in:
parent
698973fbe2
commit
911957ba66
|
@ -7,7 +7,6 @@ interface IParams {
|
|||
rid: string;
|
||||
messageId: string;
|
||||
host: string;
|
||||
isCall: boolean;
|
||||
fullURL: string;
|
||||
type: string;
|
||||
token: string;
|
||||
|
|
|
@ -65,15 +65,6 @@ const parseDeepLinking = (url: string) => {
|
|||
return parseQuery(url);
|
||||
}
|
||||
}
|
||||
const call = /^(https:\/\/)?jitsi.rocket.chat\//;
|
||||
const fullURL = url;
|
||||
|
||||
if (url.match(call)) {
|
||||
url = url.replace(call, '').trim();
|
||||
if (url) {
|
||||
return { path: url, isCall: true, fullURL };
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { ERoomTypes } from '../../definitions';
|
||||
import { store } from '../store/auxStore';
|
||||
import database from '../database';
|
||||
import sdk from '../services/sdk';
|
||||
import { Services } from '../services';
|
||||
|
@ -63,18 +62,11 @@ async function open({ type, rid, name }: { type: ERoomTypes; rid: string; name:
|
|||
}
|
||||
}
|
||||
|
||||
export async function canOpenRoom({ rid, path, isCall }: { rid: string; isCall: boolean; path: string }): Promise<any> {
|
||||
export async function canOpenRoom({ rid, path }: { rid: string; path: string }): Promise<any> {
|
||||
try {
|
||||
const db = database.active;
|
||||
const subsCollection = db.get('subscriptions');
|
||||
|
||||
if (isCall && !rid) {
|
||||
// Extract rid from a Jitsi URL
|
||||
// Eg.: [Jitsi_URL_Room_Prefix][uniqueID][rid][?jwt]
|
||||
const { Jitsi_URL_Room_Prefix, uniqueID } = store.getState().settings;
|
||||
rid = path.replace(`${Jitsi_URL_Room_Prefix}${uniqueID}`, '').replace(/\?(.*)/g, '');
|
||||
}
|
||||
|
||||
if (rid) {
|
||||
try {
|
||||
const room = await subsCollection.find(rid);
|
||||
|
|
|
@ -160,7 +160,8 @@ export async function getSettings(): Promise<void> {
|
|||
/* eslint-disable no-await-in-loop */
|
||||
const response = await fetch(
|
||||
`${sdk.current.client.host}/api/v1/settings.public?query={"_id":{"$in":${JSON.stringify(settingsParams)}}}
|
||||
&offset=${offset}`);
|
||||
&offset=${offset}`
|
||||
);
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
|
@ -172,7 +173,7 @@ export async function getSettings(): Promise<void> {
|
|||
settings = [...settings, ...result.settings];
|
||||
remaining = result.total - settings.length;
|
||||
/* eslint-enable no-await-in-loop */
|
||||
} while(remaining > 0);
|
||||
} while (remaining > 0);
|
||||
|
||||
const data: IData[] = settings;
|
||||
const filteredSettings: IPreparedSettings[] = _prepareSettings(data);
|
||||
|
|
|
@ -12,7 +12,6 @@ interface IEjson {
|
|||
sender: { username: string; name: string };
|
||||
type: string;
|
||||
host: string;
|
||||
messageType: string;
|
||||
messageId: string;
|
||||
}
|
||||
|
||||
|
@ -20,7 +19,7 @@ export const onNotification = (push: INotification): void => {
|
|||
if (push.payload) {
|
||||
try {
|
||||
const notification = push.payload;
|
||||
const { rid, name, sender, type, host, messageType, messageId }: IEjson = EJSON.parse(notification.ejson);
|
||||
const { rid, name, sender, type, host, messageId }: IEjson = EJSON.parse(notification.ejson);
|
||||
|
||||
const types: Record<string, string> = {
|
||||
c: 'channel',
|
||||
|
@ -37,8 +36,7 @@ export const onNotification = (push: INotification): void => {
|
|||
host,
|
||||
rid,
|
||||
messageId,
|
||||
path: `${types[type]}/${roomName}`,
|
||||
isCall: messageType === 'jitsi_call_started'
|
||||
path: `${types[type]}/${roomName}`
|
||||
};
|
||||
store.dispatch(deepLinkingOpen(params));
|
||||
} catch (e) {
|
||||
|
|
|
@ -14,7 +14,7 @@ import { loginRequest } from '../actions/login';
|
|||
import log from '../lib/methods/helpers/log';
|
||||
import { RootEnum } from '../definitions';
|
||||
import { CURRENT_SERVER, TOKEN_KEY } from '../lib/constants';
|
||||
import { callJitsi, callJitsiWithoutServer, canOpenRoom, getServerInfo } from '../lib/methods';
|
||||
import { canOpenRoom, getServerInfo } from '../lib/methods';
|
||||
import { Services } from '../lib/services';
|
||||
|
||||
const roomTypes = {
|
||||
|
@ -59,9 +59,6 @@ const navigate = function* navigate({ params }) {
|
|||
const jumpToMessageId = params.messageId;
|
||||
|
||||
yield goRoom({ item, isMasterDetail, jumpToMessageId, jumpToThreadId, popToRoot: true });
|
||||
if (params.isCall) {
|
||||
callJitsi(item);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
yield handleInviteLink({ params });
|
||||
|
@ -91,20 +88,6 @@ const handleOpen = function* handleOpen({ params }) {
|
|||
const serversCollection = serversDB.get('servers');
|
||||
|
||||
let { host } = params;
|
||||
if (params.isCall && !host) {
|
||||
const servers = yield serversCollection.query().fetch();
|
||||
// search from which server is that call
|
||||
servers.forEach(({ uniqueID, id }) => {
|
||||
if (params.path.includes(uniqueID)) {
|
||||
host = id;
|
||||
}
|
||||
});
|
||||
|
||||
if (!host && params.fullURL) {
|
||||
callJitsiWithoutServer(params.fullURL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (params.type === 'oauth') {
|
||||
yield handleOAuth({ params });
|
||||
|
|
|
@ -436,7 +436,9 @@ class ShareListView extends React.Component<IShareListViewProps, IState> {
|
|||
contentContainerStyle={[styles.container, styles.centered, { backgroundColor: themes[theme].backgroundColor }]}
|
||||
>
|
||||
<Text style={[styles.permissionTitle, { color: themes[theme].titleText }]}>{I18n.t('Read_External_Permission')}</Text>
|
||||
<Text style={[styles.permissionMessage, { color: themes[theme].bodyText }]}>{I18n.t('Read_External_Permission_Message')}</Text>
|
||||
<Text style={[styles.permissionMessage, { color: themes[theme].bodyText }]}>
|
||||
{I18n.t('Read_External_Permission_Message')}
|
||||
</Text>
|
||||
</ScrollView>
|
||||
</SafeAreaView>
|
||||
);
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
<key>com.apple.developer.associated-domains</key>
|
||||
<array>
|
||||
<string>applinks:go.rocket.chat</string>
|
||||
<string>applinks:jitsi.rocket.chat</string>
|
||||
</array>
|
||||
<key>com.apple.security.application-groups</key>
|
||||
<array>
|
||||
|
|
Loading…
Reference in New Issue