File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,18 +42,12 @@ class RoomCoordinatorClient extends RoomCoordinator {
4242 getUiText ( _context : ValueOf < typeof UiTextContext > ) : string {
4343 return '' ;
4444 } ,
45- condition ( ) : boolean {
46- return true ;
47- } ,
4845 getAvatarPath ( _room ) : string {
4946 return '' ;
5047 } ,
5148 findRoom ( _identifier : string ) : IRoom | undefined {
5249 return undefined ;
5350 } ,
54- showJoinLink ( _roomId : string ) : boolean {
55- return false ;
56- } ,
5751 isLivechatRoom ( ) : boolean {
5852 return false ;
5953 } ,
Original file line number Diff line number Diff line change 1- import { Meteor } from 'meteor/meteor' ;
2-
3- import { getUserPreference } from '../../../../app/utils/client' ;
41import { getConversationRoomType } from '../../../../lib/rooms/roomTypes/conversation' ;
52import { roomCoordinator } from '../roomCoordinator' ;
63
@@ -11,10 +8,5 @@ roomCoordinator.add(
118 ...ConversationRoomType ,
129 label : 'Conversations' ,
1310 } ,
14- {
15- condition ( ) : boolean {
16- // returns true only if sidebarGroupByType is not set
17- return ! getUserPreference ( Meteor . userId ( ) , 'sidebarGroupByType' ) ;
18- } ,
19- } ,
11+ { } ,
2012) ;
Original file line number Diff line number Diff line change 11import type { AtLeast , IRoom } from '@rocket.chat/core-typings' ;
22import { isRoomFederated } from '@rocket.chat/core-typings' ;
33import type { SubscriptionWithRoom } from '@rocket.chat/ui-contexts' ;
4- import { Meteor } from 'meteor/meteor' ;
54
6- import { hasAtLeastOnePermission } from '../../../../app/authorization/client' ;
75import { settings } from '../../../../app/settings/client' ;
8- import { getUserPreference } from '../../../../app/utils/client' ;
96import { getAvatarURL } from '../../../../app/utils/client/getAvatarURL' ;
107import { getUserAvatarURL } from '../../../../app/utils/client/getUserAvatarURL' ;
118import type { IRoomTypeClientDirectives } from '../../../../definition/IRoomTypeConfig' ;
@@ -98,11 +95,6 @@ roomCoordinator.add(
9895 }
9996 } ,
10097
101- condition ( ) {
102- const groupByType = getUserPreference ( Meteor . userId ( ) , 'sidebarGroupByType' ) ;
103- return groupByType && hasAtLeastOnePermission ( [ 'view-d-room' , 'view-joined-room' ] ) ;
104- } ,
105-
10698 getAvatarPath ( room ) {
10799 if ( ! room ) {
108100 return '' ;
Original file line number Diff line number Diff line change 1- import { Meteor } from 'meteor/meteor' ;
2-
3- import { settings } from '../../../../app/settings/client' ;
4- import { getUserPreference } from '../../../../app/utils/client' ;
51import { getFavoriteRoomType } from '../../../../lib/rooms/roomTypes/favorite' ;
62import { roomCoordinator } from '../roomCoordinator' ;
73
@@ -13,9 +9,6 @@ roomCoordinator.add(
139 label : 'Favorites' ,
1410 } ,
1511 {
16- condition ( ) : boolean {
17- return settings . get ( 'Favorite_Rooms' ) && getUserPreference ( Meteor . userId ( ) , 'sidebarShowFavorites' ) ;
18- } ,
1912 getIcon ( ) {
2013 return 'star' ;
2114 } ,
Original file line number Diff line number Diff line change 11import type { AtLeast , ValueOf } from '@rocket.chat/core-typings' ;
22
3- import { hasPermission } from '../../../../app/authorization/client' ;
4- import { settings } from '../../../../app/settings/client' ;
53import { getAvatarURL } from '../../../../app/utils/client/getAvatarURL' ;
64import type { IRoomTypeClientDirectives } from '../../../../definition/IRoomTypeConfig' ;
75import { RoomSettingsEnum , RoomMemberActions , UiTextContext } from '../../../../definition/IRoomTypeConfig' ;
@@ -45,10 +43,6 @@ roomCoordinator.add(
4543 }
4644 } ,
4745
48- condition ( ) {
49- return settings . get ( 'Livechat_enabled' ) && hasPermission ( 'view-l-room' ) ;
50- } ,
51-
5246 getAvatarPath ( room ) {
5347 return getAvatarURL ( { username : `@${ this . roomName ( room ) } ` } ) || '' ;
5448 } ,
Original file line number Diff line number Diff line change 11import type { AtLeast , IRoom } from '@rocket.chat/core-typings' ;
22import { isRoomFederated } from '@rocket.chat/core-typings' ;
3- import { Meteor } from 'meteor/meteor' ;
43
5- import { hasPermission } from '../../../../app/authorization/client' ;
64import { settings } from '../../../../app/settings/client' ;
7- import { getUserPreference } from '../../../../app/utils/client' ;
85import { getRoomAvatarURL } from '../../../../app/utils/client/getRoomAvatarURL' ;
96import type { IRoomTypeClientDirectives } from '../../../../definition/IRoomTypeConfig' ;
107import { RoomSettingsEnum , RoomMemberActions , UiTextContext } from '../../../../definition/IRoomTypeConfig' ;
@@ -80,11 +77,6 @@ roomCoordinator.add(
8077 }
8178 } ,
8279
83- condition ( ) {
84- const groupByType = getUserPreference ( Meteor . userId ( ) , 'sidebarGroupByType' ) ;
85- return groupByType && hasPermission ( 'view-p-room' ) ;
86- } ,
87-
8880 getAvatarPath ( room ) {
8981 return getRoomAvatarURL ( { roomId : room . _id , cache : room . avatarETag } ) ;
9082 } ,
Original file line number Diff line number Diff line change 11import type { AtLeast , IRoom } from '@rocket.chat/core-typings' ;
22import { isRoomFederated } from '@rocket.chat/core-typings' ;
3- import { Meteor } from 'meteor/meteor' ;
43
5- import { hasAtLeastOnePermission } from '../../../../app/authorization/client' ;
64import { settings } from '../../../../app/settings/client' ;
7- import { getUserPreference } from '../../../../app/utils/client' ;
85import { getRoomAvatarURL } from '../../../../app/utils/client/getRoomAvatarURL' ;
96import type { IRoomTypeClientDirectives } from '../../../../definition/IRoomTypeConfig' ;
107import { RoomSettingsEnum , RoomMemberActions , UiTextContext } from '../../../../definition/IRoomTypeConfig' ;
@@ -77,14 +74,6 @@ roomCoordinator.add(
7774 }
7875 } ,
7976
80- condition ( ) {
81- const groupByType = getUserPreference ( Meteor . userId ( ) , 'sidebarGroupByType' ) ;
82- return (
83- groupByType &&
84- ( hasAtLeastOnePermission ( [ 'view-c-room' , 'view-joined-room' ] ) || settings . get ( 'Accounts_AllowAnonymousRead' ) === true )
85- ) ;
86- } ,
87-
8877 getAvatarPath ( room ) {
8978 return getRoomAvatarURL ( { roomId : room . _id , cache : room . avatarETag } ) ;
9079 } ,
@@ -113,10 +102,5 @@ roomCoordinator.add(
113102 } ;
114103 return Rooms . state . find ( predicate ) ;
115104 } ,
116-
117- showJoinLink ( roomId ) {
118- const predicate = ( record : IRoom ) : boolean => record . t === 'c' && record . _id === roomId ;
119- return ! ! Rooms . state . find ( predicate ) ;
120- } ,
121105 } as AtLeast < IRoomTypeClientDirectives , 'isGroupChat' | 'roomName' > ,
122106) ;
Original file line number Diff line number Diff line change 1- import { Meteor } from 'meteor/meteor' ;
2-
3- import { getUserPreference } from '../../../../app/utils/client' ;
41import { getUnreadRoomType } from '../../../../lib/rooms/roomTypes/unread' ;
52import { roomCoordinator } from '../roomCoordinator' ;
63
@@ -11,9 +8,5 @@ roomCoordinator.add(
118 ...UnreadRoomType ,
129 label : 'Unread' ,
1310 } ,
14- {
15- condition ( ) : boolean {
16- return getUserPreference ( Meteor . userId ( ) , 'sidebarShowUnread' ) as boolean ;
17- } ,
18- } ,
11+ { } ,
1912) ;
Original file line number Diff line number Diff line change 11import type { AtLeast } from '@rocket.chat/core-typings' ;
22
3- import { hasPermission } from '../../../../app/authorization/client' ;
4- import { settings } from '../../../../app/settings/client' ;
53import { getAvatarURL } from '../../../../app/utils/client/getAvatarURL' ;
64import type { IRoomTypeClientDirectives } from '../../../../definition/IRoomTypeConfig' ;
75import { getVoipRoomType } from '../../../../lib/rooms/roomTypes/voip' ;
@@ -20,10 +18,6 @@ roomCoordinator.add(
2018 return room . name || room . fname || ( room as any ) . label ;
2119 } ,
2220
23- condition ( ) {
24- return settings . get ( 'Livechat_enabled' ) && hasPermission ( 'view-l-room' ) ;
25- } ,
26-
2721 getAvatarPath ( room ) {
2822 return getAvatarURL ( { username : `@${ this . roomName ( room ) } ` } ) || '' ;
2923 } ,
Original file line number Diff line number Diff line change @@ -76,14 +76,12 @@ export interface IRoomTypeClientDirectives {
7676 roomName : ( room : AtLeast < IRoom , '_id' | 'name' | 'fname' | 'prid' > ) => string | undefined ;
7777 isGroupChat : ( room : Partial < IRoom > ) => boolean ;
7878 getUiText : ( context : ValueOf < typeof UiTextContext > ) => string ;
79- condition : ( ) => boolean ;
8079 getAvatarPath : (
8180 room : Pick < IRoom , '_id' | 'name' | 'fname' | 'prid' | 'avatarETag' | 'uids' | 'usernames' > & { username ?: IRoom [ '_id' ] } ,
8281 ) => string ;
8382 getIcon ?: ( room : Partial < IRoom > ) => IconName ;
8483 extractOpenRoomParams ?: ( routeParams : Record < string , string | null | undefined > ) => { type : RoomType ; reference : string } ;
8584 findRoom : ( identifier : string ) => IRoom | undefined ;
86- showJoinLink : ( roomId : string ) => boolean ;
8785 isLivechatRoom : ( ) => boolean ;
8886 canSendMessage : ( room : IRoom ) => boolean ;
8987 readOnly ?: ( room ?: IRoom , user ?: AtLeast < IUser , 'username' > | null ) => boolean ;
You can’t perform that action at this time.
0 commit comments