Skip to content

Commit

Permalink
chore: remove left streaming code
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego committed Aug 22, 2024
1 parent f6351e8 commit ee5bbbb
Show file tree
Hide file tree
Showing 12 changed files with 2 additions and 68 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { saveRoomReadOnly } from '../functions/saveRoomReadOnly';
import { saveRoomSystemMessages } from '../functions/saveRoomSystemMessages';
import { saveRoomTopic } from '../functions/saveRoomTopic';
import { saveRoomType } from '../functions/saveRoomType';
import { saveStreamingOptions } from '../functions/saveStreamingOptions';

type RoomSettings = {
roomAvatar: string;
Expand All @@ -37,7 +36,6 @@ type RoomSettings = {
systemMessages: MessageTypesValues[];
default: boolean;
joinCode: string;
streamingOptions: NonNullable<IRoom['streamingOptions']>;
retentionEnabled: boolean;
retentionMaxAge: number;
retentionExcludePinned: boolean;
Expand Down Expand Up @@ -272,9 +270,6 @@ const settingSavers: RoomSettingsSavers = {
void Team.update(user._id, room.teamId, { type, updateRoom: false });
}
},
async streamingOptions({ value, rid }) {
await saveStreamingOptions(rid, value);
},
async readOnly({ value, room, rid, user }) {
if (value !== room.ro) {
await saveRoomReadOnly(rid, value, user);
Expand Down Expand Up @@ -354,7 +349,6 @@ const fields: (keyof RoomSettings)[] = [
'systemMessages',
'default',
'joinCode',
'streamingOptions',
'retentionEnabled',
'retentionMaxAge',
'retentionExcludePinned',
Expand Down
1 change: 0 additions & 1 deletion apps/meteor/app/models/client/models/CachedChatRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class CachedChatRoom extends CachedCollection<IRoom> {
usernames: room.usernames,
usersCount: room.usersCount,
lastMessage: room.lastMessage,
streamingOptions: room.streamingOptions,
teamId: room.teamId,
teamMain: room.teamMain,
v: (room as IOmnichannelRoom | undefined)?.v,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class CachedChatSubscription extends CachedCollection<SubscriptionWithRoom, ISub
lm: 1,
lastMessage: 1,
uids: 1,
streamingOptions: 1,
usernames: 1,
usersCount: 1,
topic: 1,
Expand Down Expand Up @@ -96,7 +95,6 @@ class CachedChatSubscription extends CachedCollection<SubscriptionWithRoom, ISub
avatarETag: room?.avatarETag,
retention: (room as IRoomWithRetentionPolicy | undefined)?.retention,
lastMessage: room?.lastMessage,
streamingOptions: room?.streamingOptions,
teamId: room?.teamId,
teamMain: room?.teamMain,
uids: room?.uids,
Expand Down
1 change: 0 additions & 1 deletion apps/meteor/app/statistics/server/lib/statistics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,6 @@ export const statistics = {
statistics.totalOTRRooms = await Rooms.findByCreatedOTR().count();
statistics.totalOTR = settings.get('OTR_Count');
statistics.totalBroadcastRooms = await Rooms.findByBroadcast().count();
statistics.totalRoomsWithActiveLivestream = await Rooms.findByActiveLivestream().count();
statistics.totalTriggeredEmails = settings.get('Triggered_Emails_Count');
statistics.totalRoomsWithStarred = await Messages.countRoomsWithStarredMessages({ readPreference });
statistics.totalRoomsWithPinned = await Messages.countRoomsWithPinnedMessages({ readPreference });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export const useStartCallRoomAction = () => {
const federated = isRoomFederated(room);

const ownUser = room.uids?.length === 1 ?? false;
const live = room?.streamingOptions?.type === 'call' ?? false;

const permittedToPostReadonly = usePermission('post-readonly', room._id);
const permittedToCallManagement = usePermission('call-management', room._id);
Expand Down Expand Up @@ -81,8 +80,8 @@ export const useStartCallRoomAction = () => {
disabled: true,
}),
full: true,
order: live ? -1 : 4,
order: 4,
featured: true,
};
}, [allowed, disabled, groups, handleOpenVideoConf, live, t]);
}, [allowed, disabled, groups, handleOpenVideoConf, t]);
};
1 change: 0 additions & 1 deletion apps/meteor/lib/publishFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export const roomFields = {
reactWhenReadOnly: 1,
sysMes: 1,
sentiment: 1,
streamingOptions: 1,
broadcast: 1,
encrypted: 1,
e2eKeyId: 1,
Expand Down
18 changes: 0 additions & 18 deletions apps/meteor/server/models/raw/Rooms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -642,15 +642,6 @@ export class RoomsRaw extends BaseRaw<IRoom> implements IRoomsModel {
);
}

findByActiveLivestream(options: FindOptions<IRoom> = {}): FindCursor<IRoom> {
return this.find(
{
'streamingOptions.type': 'livestream',
},
options,
);
}

setAsFederated(roomId: IRoom['_id']): Promise<UpdateResult> {
return this.updateOne({ _id: roomId }, { $set: { federated: true } });
}
Expand Down Expand Up @@ -1030,15 +1021,6 @@ export class RoomsRaw extends BaseRaw<IRoom> implements IRoomsModel {
return this.updateOne(query, update);
}

setStreamingOptionsById(_id: IRoom['_id'], streamingOptions: IRoom['streamingOptions']): Promise<UpdateResult> {
const update: UpdateFilter<IRoom> = {
$set: {
streamingOptions,
},
};
return this.updateOne({ _id }, update);
}

setReadOnlyById(_id: IRoom['_id'], readOnly: NonNullable<IRoom['ro']>): Promise<UpdateResult> {
const query: Filter<IRoom> = {
_id,
Expand Down
9 changes: 0 additions & 9 deletions packages/core-typings/src/IRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,6 @@ export interface IRoom extends IRocketChatRecord {
_id: string;
};

streamingOptions?: {
id?: string;
type?: string;
url?: string;
thumbnail?: string;
isAudioOnly?: boolean;
message?: string;
};

prid?: string;
avatarETag?: string;

Expand Down
1 change: 0 additions & 1 deletion packages/core-typings/src/IStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ export interface IStats {
dashboardCount: number;
joinJitsiButton: number;
totalBroadcastRooms: number;
totalRoomsWithActiveLivestream: number;
totalTriggeredEmails: number;
totalRoomsWithStarred: number;
totalRoomsWithPinned: number;
Expand Down
3 changes: 0 additions & 3 deletions packages/model-typings/src/models/IRoomsModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ export interface IRoomsModel extends IBaseModel<IRoom> {

findByBroadcast(options?: FindOptions<IRoom>): FindCursor<IRoom>;

findByActiveLivestream(options?: FindOptions<IRoom>): FindCursor<IRoom>;

setAsFederated(roomId: IRoom['_id']): Promise<UpdateResult>;

setRoomTypeById(roomId: IRoom['_id'], roomType: IRoom['t']): Promise<UpdateResult>;
Expand Down Expand Up @@ -176,7 +174,6 @@ export interface IRoomsModel extends IBaseModel<IRoom> {
setLastMessagePinned(roomId: string, pinnedBy: unknown, pinned?: boolean, pinnedAt?: Date): Promise<UpdateResult>;
setLastMessageAsRead(roomId: string): Promise<UpdateResult>;
setDescriptionById(roomId: string, description: string): Promise<UpdateResult>;
setStreamingOptionsById(roomId: string, streamingOptions: IRoom['streamingOptions']): Promise<UpdateResult>;
setReadOnlyById(roomId: string, readOnly: NonNullable<IRoom['ro']>): Promise<UpdateResult>;
setDmReadOnlyByUserId(
roomId: string,
Expand Down
1 change: 0 additions & 1 deletion packages/ui-contexts/src/types/SubscriptionWithRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export type SubscriptionWithRoom = ISubscription &
| 'announcement'
| 'avatarETag'
| 'lastMessage'
| 'streamingOptions'
| 'uids'
| 'usernames'
| 'usersCount'
Expand Down

0 comments on commit ee5bbbb

Please sign in to comment.