Skip to content

Commit

Permalink
[BREAK] Remove webRTC for channels/dm/groups (#26225)
Browse files Browse the repository at this point in the history
  • Loading branch information
dougfabris committed Jul 12, 2022
1 parent 6136e4c commit e1262a3
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 340 deletions.
13 changes: 1 addition & 12 deletions apps/meteor/app/ui/client/views/app/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { Template } from 'meteor/templating';
import { isRoomFederated } from '@rocket.chat/core-typings';

import { t, getUserPreference } from '../../../../utils/client';
import { WebRTC } from '../../../../webrtc/client';
import { ChatMessage, RoomRoles, Users, Subscriptions, Rooms } from '../../../../models/client';
import { RoomHistoryManager, RoomManager, readMessage } from '../../../../ui-utils/client';
import { messageContext } from '../../../../ui-utils/client/lib/messageContext';
Expand Down Expand Up @@ -999,19 +998,9 @@ Meteor.startup(() => {
readMessage.on(template.data._id, () => this.unreadCount.set(0));

wrapper.addEventListener('scroll', updateUnreadCount);
// salva a data da renderização para exibir alertas de novas mensagens
// save the render's date to display new messages alerts
$.data(this.firstNode, 'renderedAt', new Date());

const webrtc = WebRTC.getInstanceByRoomId(template.data._id);
if (webrtc) {
this.autorun(() => {
const remoteItems = webrtc.remoteItems.get();
if ((remoteItems && remoteItems.length > 0) || webrtc.localUrl.get()) {
return this.tabBar.openUserInfo();
}
});
}

callbacks.add(
'streamNewMessage',
(msg) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Box } from '@rocket.chat/fuselage';
import { useSession, useSetting, useRolesDescription, useTranslation } from '@rocket.chat/ui-contexts';
import { useSetting, useRolesDescription, useTranslation } from '@rocket.chat/ui-contexts';
import React, { useMemo } from 'react';

import { getUserEmailAddress } from '../../../../../lib/getUserEmailAddress';
Expand All @@ -10,17 +10,13 @@ import VerticalBar from '../../../../components/VerticalBar';
import { AsyncStatePhase } from '../../../../hooks/useAsyncState';
import { useEndpointData } from '../../../../hooks/useEndpointData';
import { getUserEmailVerified } from '../../../../lib/utils/getUserEmailVerified';
import { useWebRTC } from '../../hooks/useWebRTC';
import UserInfo from './UserInfo';
import UserWebRTCWithData from './UserWebRTC';
import UserActions from './actions/UserActions';

function UserInfoWithData({ uid, username, tabBar, rid, onClickClose, onClose = onClickClose, video, onClickBack, ...props }) {
const t = useTranslation();
const showRealNames = useSetting('UI_Use_Real_Name');
const getRoles = useRolesDescription();
const openedRoom = useSession('openedRoom');
const { showUserWebRTC } = useWebRTC(openedRoom);

const {
value,
Expand Down Expand Up @@ -79,9 +75,7 @@ function UserInfoWithData({ uid, username, tabBar, rid, onClickClose, onClose =
</VerticalBar.Content>
)}

{!isLoading && showUserWebRTC && <UserWebRTCWithData rid={openedRoom} peerName={user?.name} {...props} />}

{!isLoading && !error && !showUserWebRTC && (
{!isLoading && !error && (
<UserInfo {...user} data={user} actions={<UserActions user={user} rid={rid} backToList={onClickBack} />} {...props} p='x24' />
)}
</>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit e1262a3

Please sign in to comment.