-
{{_ "Backup_codes"}}
-
-
{{codesRemaining}}
-
-
+
+
{{_ "Backup_codes"}}
+
+
{{codesRemaining}}
+
-
+
{{/if}}
{{/if}}
diff --git a/packages/rocketchat-2fa/client/accountSecurity.js b/packages/rocketchat-2fa/client/accountSecurity.js
index 76d1da0ca290..b99fb2fc3e49 100644
--- a/packages/rocketchat-2fa/client/accountSecurity.js
+++ b/packages/rocketchat-2fa/client/accountSecurity.js
@@ -1,8 +1,9 @@
import { Meteor } from 'meteor/meteor';
import { ReactiveVar } from 'meteor/reactive-var';
import { Template } from 'meteor/templating';
-import { t, modal } from 'meteor/rocketchat:ui';
+import { modal } from 'meteor/rocketchat:ui';
import { RocketChat } from 'meteor/rocketchat:lib';
+import { t } from 'meteor/rocketchat:utils';
import toastr from 'toastr';
import qrcode from 'yaqrcode';
diff --git a/packages/rocketchat-2fa/package.js b/packages/rocketchat-2fa/package.js
index 5f5d3e2dc013..71f3cf76599f 100644
--- a/packages/rocketchat-2fa/package.js
+++ b/packages/rocketchat-2fa/package.js
@@ -15,6 +15,7 @@ Package.onUse(function(api) {
'sha',
'random',
'rocketchat:ui',
+ 'rocketchat:utils',
]);
api.mainModule('client/index.js', 'client');
diff --git a/packages/rocketchat-action-links/client/index.js b/packages/rocketchat-action-links/client/index.js
index fa97e5534dc5..940c2db77dcc 100644
--- a/packages/rocketchat-action-links/client/index.js
+++ b/packages/rocketchat-action-links/client/index.js
@@ -1,4 +1,3 @@
import '../both/lib/actionLinks';
-import './stylesheets/actionLinks.css';
import './lib/actionLinks';
import './init';
diff --git a/packages/rocketchat-action-links/package.js b/packages/rocketchat-action-links/package.js
index 04a37d6dff19..87870adc7f60 100644
--- a/packages/rocketchat-action-links/package.js
+++ b/packages/rocketchat-action-links/package.js
@@ -13,6 +13,7 @@ Package.onUse(function(api) {
'rocketchat:theme',
'rocketchat:ui',
]);
+ api.addFiles('client/stylesheets/actionLinks.css', 'client');
api.mainModule('client/index.js', 'client');
api.mainModule('server/index.js', 'server');
});
diff --git a/packages/rocketchat-api/server/helpers/parseJsonQuery.js b/packages/rocketchat-api/server/helpers/parseJsonQuery.js
index 4de02de2fa0e..6b9caf541987 100644
--- a/packages/rocketchat-api/server/helpers/parseJsonQuery.js
+++ b/packages/rocketchat-api/server/helpers/parseJsonQuery.js
@@ -1,5 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
+import { EJSON } from 'meteor/ejson';
RocketChat.API.helperMethods.set('parseJsonQuery', function _parseJsonQuery() {
let sort;
@@ -50,7 +51,7 @@ RocketChat.API.helperMethods.set('parseJsonQuery', function _parseJsonQuery() {
let query = {};
if (this.queryParams.query) {
try {
- query = JSON.parse(this.queryParams.query);
+ query = EJSON.parse(this.queryParams.query);
} catch (e) {
this.logger.warn(`Invalid query parameter provided "${ this.queryParams.query }":`, e);
throw new Meteor.Error('error-invalid-query', `Invalid query parameter provided: "${ this.queryParams.query }"`, { helperMethod: 'parseJsonQuery' });
diff --git a/packages/rocketchat-api/server/v1/chat.js b/packages/rocketchat-api/server/v1/chat.js
index d6efe9b1af52..2787ec2620ef 100644
--- a/packages/rocketchat-api/server/v1/chat.js
+++ b/packages/rocketchat-api/server/v1/chat.js
@@ -342,3 +342,35 @@ RocketChat.API.v1.addRoute('chat.ignoreUser', { authRequired: true }, {
return RocketChat.API.v1.success();
},
});
+
+RocketChat.API.v1.addRoute('chat.getDeletedMessages', { authRequired: true }, {
+ get() {
+ const { roomId, since } = this.queryParams;
+ const { offset, count } = this.getPaginationItems();
+
+ if (!roomId) {
+ throw new Meteor.Error('The required "roomId" query param is missing.');
+ }
+
+ if (!since) {
+ throw new Meteor.Error('The required "since" query param is missing.');
+ } else if (isNaN(Date.parse(since))) {
+ throw new Meteor.Error('The "since" query parameter must be a valid date.');
+ }
+ const cursor = RocketChat.models.Messages.trashFindDeleted(new Date(since), { rid: roomId }, {
+ skip: offset,
+ limit: count,
+ });
+
+ const total = cursor.count();
+
+ const messages = cursor.fetch();
+
+ return RocketChat.API.v1.success({
+ messages,
+ count: messages.length,
+ offset,
+ total,
+ });
+ },
+});
diff --git a/packages/rocketchat-api/server/v1/emoji-custom.js b/packages/rocketchat-api/server/v1/emoji-custom.js
index e8041e0a6291..65b9ea6fc8fd 100644
--- a/packages/rocketchat-api/server/v1/emoji-custom.js
+++ b/packages/rocketchat-api/server/v1/emoji-custom.js
@@ -3,7 +3,8 @@ import { RocketChat } from 'meteor/rocketchat:lib';
RocketChat.API.v1.addRoute('emoji-custom', { authRequired: true }, {
get() {
- const emojis = Meteor.call('listEmojiCustom');
+ const { query } = this.parseJsonQuery();
+ const emojis = Meteor.call('listEmojiCustom', query);
return RocketChat.API.v1.success({ emojis });
},
diff --git a/packages/rocketchat-api/server/v1/users.js b/packages/rocketchat-api/server/v1/users.js
index d1e96b8c1f26..c5b791122e2e 100644
--- a/packages/rocketchat-api/server/v1/users.js
+++ b/packages/rocketchat-api/server/v1/users.js
@@ -130,7 +130,7 @@ RocketChat.API.v1.addRoute('users.info', { authRequired: true }, {
user = result[0];
if (fields.userRooms === 1 && RocketChat.authz.hasPermission(this.userId, 'view-other-user-channels')) {
- user.rooms = RocketChat.models.Subscriptions.findByUserId(this.userId, {
+ user.rooms = RocketChat.models.Subscriptions.findByUserId(user._id, {
fields: {
rid: 1,
name: 1,
diff --git a/packages/rocketchat-apps/client/admin/appManage.html b/packages/rocketchat-apps/client/admin/appManage.html
index 292a0d740d43..c4cd79c91e4f 100644
--- a/packages/rocketchat-apps/client/admin/appManage.html
+++ b/packages/rocketchat-apps/client/admin/appManage.html
@@ -275,8 +275,8 @@
{{_ "Settings"}}
{{> CodeMirror name=id options=getEditorOptions code=value }}