forked from RocketChat/Rocket.Chat
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Service Account broadcast room callback added * Service Account Callback completed * CLI errors fixed * [NEW] Service Account one-tap login complete * Callbacks modified * Service Accounts directory tab added * [NEW] Service Accounts Login method * Typo fixed * CLI errors fixed * CLI errors fixed * [FIX] Anonymous chat read (RocketChat#14717) * Prevent errors when allowing anonymous read * getSingleMessage for anonymous users * Fix register user when allow read and write anonymous is enabled * Fix anonymous with sidebar extended as default Co-authored-by: ubergeekzone <ubergeekzone@gmail.com> * [New] Service Account directory feature * CLI errors fixed * UsernameExists meteor method fixed * Sync commit * [NEW] Add loading animation to webdav file picker (RocketChat#14759) * [NEW] Service Account subscription method added * [NEW] Service account subscription sidenav type * changed mongo version for snap from 3.2.7 to 3.4.20 (RocketChat#14838) * add _hidden for messages loaded by thread (RocketChat#14837) * Regression: thread loading parent msg if is not loaded (RocketChat#14839) * [IMPROVE] Layout of livechat manager pages to new style (RocketChat#13900) * [FIX] Removes E2E action button, icon and banner when E2E is disabled. (RocketChat#14810) * [IMPROVE] Adds link to download generated user data file (RocketChat#14175) * [FIX] Error when using Download My Data or Export My Data (RocketChat#14645) * [NEW] Custom User Status (RocketChat#13933) Co-Authored-By: Tasso Evangelista <tasso@tassoevan.me> Co-Authored-By: Guilherme Gazzo <guilhermegazzo@gmail.com> Co-Authored-By: wreiske <wreiske@mieweb.com> * Allow debugging of cached collections by name (RocketChat#14859) * Regression: Allow debugging of cached collections by name (RocketChat#14862) * Regression: Fix desktop notifications not being sent (RocketChat#14860) * Broadcast Room name change handled * Lint errors fixed * getLoginToken method refactored * Console statements removed * Sidebar header permission modified * Merge branch service-accounts * Added service account directory search translation key * Subscribers count added * [NEW] Service Account sidenav type * Synced with base branch
- Loading branch information
1 parent
ab1274f
commit ee44209
Showing
144 changed files
with
3,061 additions
and
769 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
import { Meteor } from 'meteor/meteor'; | ||
import { Session } from 'meteor/session'; | ||
import { Tracker } from 'meteor/tracker'; | ||
|
||
import { hasAllPermission } from '../../authorization'; | ||
import { call, TabBar } from '../../ui-utils'; | ||
import { ChatRoom } from '../../models'; | ||
import { settings } from '../../settings'; | ||
|
||
Meteor.startup(() => { | ||
TabBar.addButton({ | ||
groups: ['direct', 'group'], | ||
id: 'e2e', | ||
i18nTitle: 'E2E', | ||
icon: 'key', | ||
class: () => (ChatRoom.findOne(Session.get('openedRoom')) || {}).encrypted && 'enabled', | ||
action: () => { | ||
const room = ChatRoom.findOne(Session.get('openedRoom')); | ||
call('saveRoomSettings', room._id, 'encrypted', !room.encrypted); | ||
}, | ||
order: 10, | ||
condition: () => hasAllPermission('edit-room', Session.get('openedRoom')), | ||
Tracker.autorun(() => { | ||
if (settings.get('E2E_Enable')) { | ||
TabBar.addButton({ | ||
groups: ['direct', 'group'], | ||
id: 'e2e', | ||
i18nTitle: 'E2E', | ||
icon: 'key', | ||
class: () => (ChatRoom.findOne(Session.get('openedRoom')) || {}).encrypted && 'enabled', | ||
action: () => { | ||
const room = ChatRoom.findOne(Session.get('openedRoom')); | ||
call('saveRoomSettings', room._id, 'encrypted', !room.encrypted); | ||
}, | ||
order: 10, | ||
condition: () => hasAllPermission('edit-room', Session.get('openedRoom')), | ||
}); | ||
} else { | ||
TabBar.removeButton('e2e'); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ const defaultFields = { | |
type: 1, | ||
active: 1, | ||
reason: 1, | ||
statusText: 1, | ||
}; | ||
|
||
const fullFields = { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { Meteor } from 'meteor/meteor'; | ||
import s from 'underscore.string'; | ||
|
||
import { Users } from '../../../models'; | ||
import { Notifications } from '../../../notifications'; | ||
import { hasPermission } from '../../../authorization'; | ||
import { RateLimiter } from '../lib'; | ||
|
||
export const _setStatusMessage = function(userId, statusMessage) { | ||
statusMessage = s.trim(statusMessage); | ||
if (statusMessage.length > 120) { | ||
statusMessage = statusMessage.substr(0, 120); | ||
} | ||
|
||
if (!userId) { | ||
return false; | ||
} | ||
|
||
const user = Users.findOneById(userId); | ||
|
||
// User already has desired statusMessage, return | ||
if (user.statusText === statusMessage) { | ||
return user; | ||
} | ||
|
||
// Set new statusMessage | ||
Users.updateStatusText(user._id, statusMessage); | ||
user.statusText = statusMessage; | ||
|
||
Notifications.notifyLogged('Users:StatusMessageChanged', { | ||
_id: user._id, | ||
name: user.name, | ||
username: user.username, | ||
statusText: user.statusText, | ||
}); | ||
|
||
return true; | ||
}; | ||
|
||
export const setStatusMessage = RateLimiter.limitFunction(_setStatusMessage, 1, 60000, { | ||
0() { | ||
// Administrators have permission to change others status, so don't limit those | ||
return !Meteor.userId() || !hasPermission(Meteor.userId(), 'edit-other-user-info'); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.