From ad2cd8c9833b3d9522332032a67819d191f6d116 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Fri, 19 Oct 2018 09:20:09 -0300 Subject: [PATCH 01/34] First wave of removal of Meteor global --- client/methods/deleteMessage.js | 1 + client/methods/hideRoom.js | 1 + client/methods/openRoom.js | 1 + client/methods/setUserActiveStatus.js | 1 + client/methods/toggleFavorite.js | 1 + client/methods/updateMessage.js | 1 + client/notifications/UsersNameChanged.js | 2 ++ client/notifications/notification.js | 1 + client/notifications/updateAvatar.js | 1 + client/notifications/updateUserState.js | 1 + client/routes/router.js | 1 + client/startup/emailVerification.js | 1 + client/startup/i18n.js | 1 + client/startup/loginViaQuery.js | 1 + client/startup/roomObserve.js | 1 + client/startup/startup.js | 2 +- client/startup/unread.js | 2 +- client/startup/userSetUtcOffset.js | 1 + client/startup/usersObserve.js | 1 + imports/message-read-receipt/client/readReceipts.js | 1 + imports/message-read-receipt/server/lib/ReadReceipt.js | 1 + imports/personal-access-tokens/client/personalAccessTokens.js | 1 + packages/chatpal-search/client/template/admin.js | 1 + packages/chatpal-search/server/provider/index.js | 1 + packages/chatpal-search/server/provider/provider.js | 1 + packages/chatpal-search/server/utils/utils.js | 1 + packages/meteor-accounts-saml/saml_client.js | 2 +- packages/meteor-accounts-saml/saml_rocketchat.js | 1 + packages/meteor-accounts-saml/saml_server.js | 1 + packages/meteor-accounts-saml/saml_utils.js | 1 + packages/meteor-autocomplete/client/autocomplete-client.js | 1 + packages/meteor-autocomplete/server/autocomplete-server.js | 1 + packages/rocketchat-2fa/client/TOTPPassword.js | 1 + packages/rocketchat-2fa/client/accountSecurity.js | 1 + packages/rocketchat-2fa/server/loginHandler.js | 1 + packages/rocketchat-2fa/server/methods/checkCodesRemaining.js | 1 + packages/rocketchat-2fa/server/methods/disable.js | 1 + packages/rocketchat-2fa/server/methods/enable.js | 1 + packages/rocketchat-2fa/server/methods/regenerateCodes.js | 1 + packages/rocketchat-2fa/server/methods/validateTempToken.js | 1 + packages/rocketchat-action-links/both/lib/actionLinks.js | 1 + packages/rocketchat-action-links/client/lib/actionLinks.js | 1 + packages/rocketchat-action-links/server/actionLinkHandler.js | 1 + packages/rocketchat-analytics/client/loadScript.js | 1 + packages/rocketchat-analytics/client/trackEvents.js | 1 + packages/rocketchat-api/server/api.js | 2 ++ packages/rocketchat-api/server/helpers/getUserFromParams.js | 2 ++ packages/rocketchat-api/server/helpers/parseJsonQuery.js | 2 ++ packages/rocketchat-api/server/v1/assets.js | 1 + packages/rocketchat-api/server/v1/channels.js | 1 + packages/rocketchat-api/server/v1/chat.js | 1 + packages/rocketchat-api/server/v1/commands.js | 2 ++ packages/rocketchat-api/server/v1/e2e.js | 2 ++ packages/rocketchat-api/server/v1/emoji-custom.js | 1 + packages/rocketchat-api/server/v1/groups.js | 1 + packages/rocketchat-api/server/v1/im.js | 2 ++ packages/rocketchat-api/server/v1/integrations.js | 2 ++ packages/rocketchat-api/server/v1/misc.js | 1 + packages/rocketchat-api/server/v1/permissions.js | 2 ++ packages/rocketchat-api/server/v1/push.js | 1 + packages/rocketchat-api/server/v1/roles.js | 2 ++ packages/rocketchat-api/server/v1/rooms.js | 1 + packages/rocketchat-api/server/v1/settings.js | 1 + packages/rocketchat-api/server/v1/stats.js | 2 ++ packages/rocketchat-api/server/v1/subscriptions.js | 2 ++ packages/rocketchat-api/server/v1/users.js | 1 + packages/rocketchat-apps/client/admin/appManage.js | 1 + packages/rocketchat-apps/client/admin/appWhatIsIt.js | 2 ++ packages/rocketchat-apps/client/communication/websockets.js | 2 ++ packages/rocketchat-apps/client/orchestrator.js | 1 + packages/rocketchat-apps/server/bridges/api.js | 1 + packages/rocketchat-apps/server/bridges/commands.js | 1 + packages/rocketchat-apps/server/bridges/messages.js | 2 ++ packages/rocketchat-apps/server/bridges/rooms.js | 1 + packages/rocketchat-apps/server/communication/methods.js | 2 ++ packages/rocketchat-apps/server/communication/rest.js | 1 + packages/rocketchat-apps/server/communication/websockets.js | 1 + packages/rocketchat-apps/server/orchestrator.js | 1 + packages/rocketchat-assets/server/assets.js | 1 + packages/rocketchat-authorization/client/hasPermission.js | 1 + packages/rocketchat-authorization/client/startup.js | 2 ++ packages/rocketchat-authorization/client/usersNameChanged.js | 2 ++ packages/rocketchat-authorization/client/views/permissions.js | 1 + .../rocketchat-authorization/client/views/permissionsRole.js | 1 + .../rocketchat-authorization/server/functions/addUserRoles.js | 1 + .../server/functions/removeUserFromRoles.js | 1 + .../server/methods/addPermissionToRole.js | 2 ++ .../rocketchat-authorization/server/methods/addUserToRole.js | 1 + packages/rocketchat-authorization/server/methods/deleteRole.js | 2 ++ .../server/methods/removeRoleFromPermission.js | 2 ++ .../server/methods/removeUserFromRole.js | 1 + packages/rocketchat-authorization/server/methods/saveRole.js | 2 ++ packages/rocketchat-authorization/server/models/Base.js | 1 + .../server/publications/permissions.js | 2 ++ packages/rocketchat-authorization/server/publications/roles.js | 2 ++ .../server/publications/usersInRole.js | 2 ++ packages/rocketchat-authorization/server/startup.js | 1 + packages/rocketchat-autolinker/client/client.js | 1 + packages/rocketchat-autolinker/server/settings.js | 2 ++ packages/rocketchat-autotranslate/client/lib/actionButton.js | 2 ++ packages/rocketchat-autotranslate/client/lib/autotranslate.js | 1 + packages/rocketchat-autotranslate/client/lib/tabBar.js | 2 ++ .../client/views/autoTranslateFlexTab.js | 1 + packages/rocketchat-autotranslate/server/autotranslate.js | 1 + .../server/methods/getSupportedLanguages.js | 2 ++ .../rocketchat-autotranslate/server/methods/saveSettings.js | 2 ++ .../server/methods/translateMessage.js | 2 ++ .../rocketchat-autotranslate/server/models/Subscriptions.js | 2 ++ packages/rocketchat-autotranslate/server/permissions.js | 2 ++ packages/rocketchat-bot-helpers/server/index.js | 1 + packages/rocketchat-cas/server/cas_server.js | 1 + .../server/methods/mailMessages.js | 1 + .../server/methods/saveRoomSettings.js | 2 ++ packages/rocketchat-crowd/server/crowd.js | 1 + .../rocketchat-file-upload/server/methods/sendFileMessage.js | 1 + packages/rocketchat-file/file.server.js | 1 + packages/rocketchat-importer-csv/server/importer.js | 1 + .../rocketchat-importer-hipchat-enterprise/server/importer.js | 1 + packages/rocketchat-importer-hipchat/server/importer.js | 1 + packages/rocketchat-importer-slack/server/importer.js | 1 + .../rocketchat-importer/client/admin/adminImportPrepare.js | 1 + packages/rocketchat-importer/server/methods/restartImport.js | 1 + packages/rocketchat-importer/server/methods/setupImporter.js | 1 + packages/rocketchat-importer/server/methods/startImport.js | 1 + .../client/views/integrationsOutgoing.js | 1 + packages/rocketchat-integrations/server/lib/validation.js | 1 + .../server/methods/incoming/addIncomingIntegration.js | 1 + .../server/methods/incoming/updateIncomingIntegration.js | 1 + packages/rocketchat-internal-hubot/hubot.js | 1 + packages/rocketchat-irc/server/methods/resetIrcConnection.js | 1 + packages/rocketchat-lazy-load/client/index.js | 1 + packages/rocketchat-ldap/server/sync.js | 1 + packages/rocketchat-ldap/server/testConnection.js | 1 + packages/rocketchat-lib/client/MessageAction.js | 1 + packages/rocketchat-lib/client/Notifications.js | 2 ++ packages/rocketchat-lib/client/lib/cachedCollection.js | 1 + packages/rocketchat-lib/lib/RoomTypeConfig.js | 2 ++ packages/rocketchat-lib/lib/settings.js | 1 + packages/rocketchat-lib/lib/slashCommand.js | 2 ++ packages/rocketchat-lib/server/functions/saveUser.js | 1 + .../rocketchat-lib/server/lib/interceptDirectReplyEmails.js | 1 + packages/rocketchat-lib/server/methods/addUsersToRoom.js | 2 ++ packages/rocketchat-lib/server/methods/archiveRoom.js | 2 ++ packages/rocketchat-lib/server/methods/deleteMessage.js | 1 + packages/rocketchat-lib/server/methods/deleteUserOwnAccount.js | 1 + packages/rocketchat-livechat/server/lib/Livechat.js | 1 + packages/rocketchat-message-pin/server/pinMessage.js | 2 ++ .../server/methods/saveNotificationSettings.js | 2 ++ packages/rocketchat-slackbridge/server/SlackAdapter.js | 1 + packages/rocketchat-ui-account/client/accountPreferences.js | 1 + packages/rocketchat-ui-account/client/accountProfile.js | 1 + packages/rocketchat-ui-admin/client/admin.js | 1 + packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js | 1 + packages/rocketchat-ui-flextab/client/tabs/userActions.js | 1 + packages/rocketchat-ui-login/client/login/form.js | 1 + packages/rocketchat-ui-master/client/main.js | 1 + packages/rocketchat-ui-message/client/message.js | 1 + packages/rocketchat-ui-message/client/messageBox.js | 1 + .../rocketchat-ui-message/client/popup/messagePopupConfig.js | 1 + packages/rocketchat-ui/client/lib/RoomManager.js | 1 + packages/rocketchat-ui/client/lib/chatMessages.js | 1 + packages/rocketchat-ui/client/lib/notification.js | 1 + packages/rocketchat-ui/client/views/app/room.js | 1 + packages/rocketchat-videobridge/client/views/videoFlexTab.js | 3 ++- packages/rocketchat-videobridge/server/methods/bbb.js | 1 + packages/rocketchat-webrtc/client/WebRTCClass.js | 1 + server/lib/accounts.js | 1 + server/methods/addRoomLeader.js | 2 ++ server/methods/addRoomModerator.js | 2 ++ server/methods/addRoomOwner.js | 2 ++ server/methods/createDirectMessage.js | 2 ++ server/methods/deleteUser.js | 2 ++ server/stream/messages.js | 2 ++ server/stream/streamBroadcast.js | 1 + tests/data/checks.js | 1 + tests/end-to-end/ui/00-login.js | 1 + tests/end-to-end/ui/14-message-popup.js | 1 + tests/pageobjects/setup-wizard.page.js | 1 + 178 files changed, 226 insertions(+), 4 deletions(-) diff --git a/client/methods/deleteMessage.js b/client/methods/deleteMessage.js index 2c63a58da76a..006b837c0206 100644 --- a/client/methods/deleteMessage.js +++ b/client/methods/deleteMessage.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import moment from 'moment'; diff --git a/client/methods/hideRoom.js b/client/methods/hideRoom.js index 210937dd62db..195235ce802b 100644 --- a/client/methods/hideRoom.js +++ b/client/methods/hideRoom.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; Meteor.methods({ hideRoom(rid) { if (!Meteor.userId()) { diff --git a/client/methods/openRoom.js b/client/methods/openRoom.js index 87c082ced863..ac7ce40c32f3 100644 --- a/client/methods/openRoom.js +++ b/client/methods/openRoom.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; Meteor.methods({ openRoom(rid) { if (!Meteor.userId()) { diff --git a/client/methods/setUserActiveStatus.js b/client/methods/setUserActiveStatus.js index 97cbe7c7dbbb..99121d34b710 100644 --- a/client/methods/setUserActiveStatus.js +++ b/client/methods/setUserActiveStatus.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; Meteor.methods({ setUserActiveStatus(userId, active) { Meteor.users.update(userId, { $set: { active } }); diff --git a/client/methods/toggleFavorite.js b/client/methods/toggleFavorite.js index e9c55b3440df..63309fe05e0b 100644 --- a/client/methods/toggleFavorite.js +++ b/client/methods/toggleFavorite.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; Meteor.methods({ toggleFavorite(rid, f) { if (!Meteor.userId()) { diff --git a/client/methods/updateMessage.js b/client/methods/updateMessage.js index 43552aa88f81..803505ff3aa2 100644 --- a/client/methods/updateMessage.js +++ b/client/methods/updateMessage.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import moment from 'moment'; import toastr from 'toastr'; diff --git a/client/notifications/UsersNameChanged.js b/client/notifications/UsersNameChanged.js index 88438545b678..eddaa5e4e052 100644 --- a/client/notifications/UsersNameChanged.js +++ b/client/notifications/UsersNameChanged.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.Notifications.onLogged('Users:NameChanged', function({ _id, name, username }) { RocketChat.models.Messages.update({ diff --git a/client/notifications/notification.js b/client/notifications/notification.js index 6aff57a1cf63..691fe24bfbd6 100644 --- a/client/notifications/notification.js +++ b/client/notifications/notification.js @@ -1,4 +1,5 @@ /* globals KonchatNotification, fireGlobalEvent, readMessage, CachedChatSubscription */ +import { Meteor } from 'meteor/meteor'; // Show notifications and play a sound for new messages. // We trust the server to only send notifications for interesting messages, e.g. direct messages or diff --git a/client/notifications/updateAvatar.js b/client/notifications/updateAvatar.js index dfa628e9df5f..28d7cb3dba74 100644 --- a/client/notifications/updateAvatar.js +++ b/client/notifications/updateAvatar.js @@ -1,4 +1,5 @@ /* globals updateAvatarOfUsername */ +import { Meteor } from 'meteor/meteor'; Meteor.startup(function() { RocketChat.Notifications.onLogged('updateAvatar', function(data) { diff --git a/client/notifications/updateUserState.js b/client/notifications/updateUserState.js index 367ded6c4975..9144bce0fdc7 100644 --- a/client/notifications/updateUserState.js +++ b/client/notifications/updateUserState.js @@ -1,4 +1,5 @@ /* globals fireGlobalEvent */ +import { Meteor } from 'meteor/meteor'; /* fire user state change globally, to listen on desktop electron client */ Meteor.startup(function() { diff --git a/client/routes/router.js b/client/routes/router.js index 69b69dac0b5a..45d241687e86 100644 --- a/client/routes/router.js +++ b/client/routes/router.js @@ -1,4 +1,5 @@ /* globals KonchatNotification */ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; Blaze.registerHelper('pathFor', function(path, kw) { diff --git a/client/startup/emailVerification.js b/client/startup/emailVerification.js index db0e4c368914..7c8c7587666f 100644 --- a/client/startup/emailVerification.js +++ b/client/startup/emailVerification.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; Meteor.startup(function() { Tracker.autorun(function() { diff --git a/client/startup/i18n.js b/client/startup/i18n.js index 5e426f4dd698..a6e78a273f43 100644 --- a/client/startup/i18n.js +++ b/client/startup/i18n.js @@ -1,5 +1,6 @@ /* globals isRtl */ +import { Meteor } from 'meteor/meteor'; import moment from 'moment'; const currentLanguage = new ReactiveVar(); diff --git a/client/startup/loginViaQuery.js b/client/startup/loginViaQuery.js index 5804be24b3bb..12d26001e458 100644 --- a/client/startup/loginViaQuery.js +++ b/client/startup/loginViaQuery.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; Meteor.startup(() => { if (FlowRouter.getQueryParam('resumeToken')) { Meteor.loginWithToken(FlowRouter.getQueryParam('resumeToken'), () => { diff --git a/client/startup/roomObserve.js b/client/startup/roomObserve.js index 6681b89f8f7a..60fbd750ef39 100644 --- a/client/startup/roomObserve.js +++ b/client/startup/roomObserve.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; Meteor.startup(function() { ChatRoom.find().observe({ added(data) { diff --git a/client/startup/startup.js b/client/startup/startup.js index d29aae306a91..72304967d342 100644 --- a/client/startup/startup.js +++ b/client/startup/startup.js @@ -1,5 +1,5 @@ /* globals UserPresence, fireGlobalEvent */ - +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; import hljs from 'highlight.js'; import 'highlight.js/styles/github.css'; diff --git a/client/startup/unread.js b/client/startup/unread.js index 82c123e495cb..4b51dab637b0 100644 --- a/client/startup/unread.js +++ b/client/startup/unread.js @@ -1,5 +1,5 @@ /* globals fireGlobalEvent, readMessage, Favico, favico, menu */ - +import { Meteor } from 'meteor/meteor'; Meteor.startup(function() { Tracker.autorun(function() { let unreadCount = 0; diff --git a/client/startup/userSetUtcOffset.js b/client/startup/userSetUtcOffset.js index 7916222214b3..cfe05fdc4a70 100644 --- a/client/startup/userSetUtcOffset.js +++ b/client/startup/userSetUtcOffset.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import moment from 'moment'; Meteor.startup(function() { diff --git a/client/startup/usersObserve.js b/client/startup/usersObserve.js index 3ed237430286..fa71c139b70d 100644 --- a/client/startup/usersObserve.js +++ b/client/startup/usersObserve.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; Meteor.startup(function() { Meteor.users.find({}, { fields: { name: 1, username: 1, pictures: 1, status: 1, emails: 1, phone: 1, services: 1, utcOffset: 1 } }).observe({ added(user) { diff --git a/imports/message-read-receipt/client/readReceipts.js b/imports/message-read-receipt/client/readReceipts.js index bfdac29a99e1..6a96df0e196b 100644 --- a/imports/message-read-receipt/client/readReceipts.js +++ b/imports/message-read-receipt/client/readReceipts.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import moment from 'moment'; diff --git a/imports/message-read-receipt/server/lib/ReadReceipt.js b/imports/message-read-receipt/server/lib/ReadReceipt.js index 04261faadee8..d1660f7474b7 100644 --- a/imports/message-read-receipt/server/lib/ReadReceipt.js +++ b/imports/message-read-receipt/server/lib/ReadReceipt.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { Random } from 'meteor/random'; import ModelReadReceipts from '../models/ReadReceipts'; diff --git a/imports/personal-access-tokens/client/personalAccessTokens.js b/imports/personal-access-tokens/client/personalAccessTokens.js index c28896968dfc..f16fec08470d 100644 --- a/imports/personal-access-tokens/client/personalAccessTokens.js +++ b/imports/personal-access-tokens/client/personalAccessTokens.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import toastr from 'toastr'; import moment from 'moment'; diff --git a/packages/chatpal-search/client/template/admin.js b/packages/chatpal-search/client/template/admin.js index 9c2a6d81c6e9..adf4589e705e 100644 --- a/packages/chatpal-search/client/template/admin.js +++ b/packages/chatpal-search/client/template/admin.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; Template.ChatpalAdmin.onCreated(function() { diff --git a/packages/chatpal-search/server/provider/index.js b/packages/chatpal-search/server/provider/index.js index e1a794176eb8..3a4e461b9a58 100644 --- a/packages/chatpal-search/server/provider/index.js +++ b/packages/chatpal-search/server/provider/index.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import ChatpalLogger from '../utils/logger'; import { Random } from 'meteor/random'; diff --git a/packages/chatpal-search/server/provider/provider.js b/packages/chatpal-search/server/provider/provider.js index efe4adf21751..cf400662a7fc 100644 --- a/packages/chatpal-search/server/provider/provider.js +++ b/packages/chatpal-search/server/provider/provider.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { searchProviderService, SearchProvider } from 'meteor/rocketchat:search'; import Index from './index'; import ChatpalLogger from '../utils/logger'; diff --git a/packages/chatpal-search/server/utils/utils.js b/packages/chatpal-search/server/utils/utils.js index 596b440fe0bf..ec76ba5aceb5 100644 --- a/packages/chatpal-search/server/utils/utils.js +++ b/packages/chatpal-search/server/utils/utils.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; Meteor.methods({ 'chatpalUtilsCreateKey'(email) { try { diff --git a/packages/meteor-accounts-saml/saml_client.js b/packages/meteor-accounts-saml/saml_client.js index 6a85fbdbbf6b..9d167572008c 100644 --- a/packages/meteor-accounts-saml/saml_client.js +++ b/packages/meteor-accounts-saml/saml_client.js @@ -1,5 +1,5 @@ /* globals cordova */ - +import { Meteor } from 'meteor/meteor'; if (!Accounts.saml) { Accounts.saml = {}; } diff --git a/packages/meteor-accounts-saml/saml_rocketchat.js b/packages/meteor-accounts-saml/saml_rocketchat.js index 20fc9ad8adb1..f7b5b6b354aa 100644 --- a/packages/meteor-accounts-saml/saml_rocketchat.js +++ b/packages/meteor-accounts-saml/saml_rocketchat.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; const logger = new Logger('steffo:meteor-accounts-saml', { methods: { updated: { diff --git a/packages/meteor-accounts-saml/saml_server.js b/packages/meteor-accounts-saml/saml_server.js index 56370dfe5204..d802d286dc5b 100644 --- a/packages/meteor-accounts-saml/saml_server.js +++ b/packages/meteor-accounts-saml/saml_server.js @@ -1,5 +1,6 @@ /* globals RoutePolicy, SAML */ /* jshint newcap: false */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; if (!Accounts.saml) { diff --git a/packages/meteor-accounts-saml/saml_utils.js b/packages/meteor-accounts-saml/saml_utils.js index 3fb1776a7a1c..97ea454c7292 100644 --- a/packages/meteor-accounts-saml/saml_utils.js +++ b/packages/meteor-accounts-saml/saml_utils.js @@ -1,5 +1,6 @@ /* globals SAML:true */ +import { Meteor } from 'meteor/meteor'; import zlib from 'zlib'; import xmlCrypto from 'xml-crypto'; import crypto from 'crypto'; diff --git a/packages/meteor-autocomplete/client/autocomplete-client.js b/packages/meteor-autocomplete/client/autocomplete-client.js index 4ff92bf9d1ac..2b325130d2b3 100755 --- a/packages/meteor-autocomplete/client/autocomplete-client.js +++ b/packages/meteor-autocomplete/client/autocomplete-client.js @@ -1,4 +1,5 @@ /* globals Deps, getCaretCoordinates*/ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import AutoCompleteRecords from './collection'; diff --git a/packages/meteor-autocomplete/server/autocomplete-server.js b/packages/meteor-autocomplete/server/autocomplete-server.js index 582daf40c1d1..75b18f10d153 100755 --- a/packages/meteor-autocomplete/server/autocomplete-server.js +++ b/packages/meteor-autocomplete/server/autocomplete-server.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; // This also attaches an onStop callback to sub, so we don't need to worry about that. // https://github.com/meteor/meteor/blob/devel/packages/mongo/collection.js const Autocomplete = class { diff --git a/packages/rocketchat-2fa/client/TOTPPassword.js b/packages/rocketchat-2fa/client/TOTPPassword.js index d8bf6b114bb7..4c087081bfb4 100644 --- a/packages/rocketchat-2fa/client/TOTPPassword.js +++ b/packages/rocketchat-2fa/client/TOTPPassword.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; function reportError(error, callback) { diff --git a/packages/rocketchat-2fa/client/accountSecurity.js b/packages/rocketchat-2fa/client/accountSecurity.js index 6b9c15d0ec9a..e2d00c3c061e 100644 --- a/packages/rocketchat-2fa/client/accountSecurity.js +++ b/packages/rocketchat-2fa/client/accountSecurity.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; import qrcode from 'yaqrcode'; diff --git a/packages/rocketchat-2fa/server/loginHandler.js b/packages/rocketchat-2fa/server/loginHandler.js index b0752ff46238..db4794391683 100644 --- a/packages/rocketchat-2fa/server/loginHandler.js +++ b/packages/rocketchat-2fa/server/loginHandler.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; Accounts.registerLoginHandler('totp', function(options) { if (!options.totp || !options.totp.code) { return; diff --git a/packages/rocketchat-2fa/server/methods/checkCodesRemaining.js b/packages/rocketchat-2fa/server/methods/checkCodesRemaining.js index 5deec43f7d19..d3c7dd4b5083 100644 --- a/packages/rocketchat-2fa/server/methods/checkCodesRemaining.js +++ b/packages/rocketchat-2fa/server/methods/checkCodesRemaining.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; Meteor.methods({ '2fa:checkCodesRemaining'() { if (!Meteor.userId()) { diff --git a/packages/rocketchat-2fa/server/methods/disable.js b/packages/rocketchat-2fa/server/methods/disable.js index a47005cddb4b..ebafcab8c387 100644 --- a/packages/rocketchat-2fa/server/methods/disable.js +++ b/packages/rocketchat-2fa/server/methods/disable.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; Meteor.methods({ '2fa:disable'(code) { if (!Meteor.userId()) { diff --git a/packages/rocketchat-2fa/server/methods/enable.js b/packages/rocketchat-2fa/server/methods/enable.js index c655fead80ba..08503de040ce 100644 --- a/packages/rocketchat-2fa/server/methods/enable.js +++ b/packages/rocketchat-2fa/server/methods/enable.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; Meteor.methods({ '2fa:enable'() { if (!Meteor.userId()) { diff --git a/packages/rocketchat-2fa/server/methods/regenerateCodes.js b/packages/rocketchat-2fa/server/methods/regenerateCodes.js index 379558db3cb1..38292354162f 100644 --- a/packages/rocketchat-2fa/server/methods/regenerateCodes.js +++ b/packages/rocketchat-2fa/server/methods/regenerateCodes.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; Meteor.methods({ '2fa:regenerateCodes'(userToken) { if (!Meteor.userId()) { diff --git a/packages/rocketchat-2fa/server/methods/validateTempToken.js b/packages/rocketchat-2fa/server/methods/validateTempToken.js index 69fdc0470f2f..57eb9deccc2c 100644 --- a/packages/rocketchat-2fa/server/methods/validateTempToken.js +++ b/packages/rocketchat-2fa/server/methods/validateTempToken.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; Meteor.methods({ '2fa:validateTempToken'(userToken) { if (!Meteor.userId()) { diff --git a/packages/rocketchat-action-links/both/lib/actionLinks.js b/packages/rocketchat-action-links/both/lib/actionLinks.js index 0927f319d24f..96c619a760e1 100644 --- a/packages/rocketchat-action-links/both/lib/actionLinks.js +++ b/packages/rocketchat-action-links/both/lib/actionLinks.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; // Action Links namespace creation. RocketChat.actionLinks = { actions: {}, diff --git a/packages/rocketchat-action-links/client/lib/actionLinks.js b/packages/rocketchat-action-links/client/lib/actionLinks.js index 4b32d9cd5d58..2dcee6384e16 100644 --- a/packages/rocketchat-action-links/client/lib/actionLinks.js +++ b/packages/rocketchat-action-links/client/lib/actionLinks.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; // Action Links Handler. This method will be called off the client. RocketChat.actionLinks.run = (name, messageId, instance) => { diff --git a/packages/rocketchat-action-links/server/actionLinkHandler.js b/packages/rocketchat-action-links/server/actionLinkHandler.js index 6e9dc818df71..93398625bddc 100644 --- a/packages/rocketchat-action-links/server/actionLinkHandler.js +++ b/packages/rocketchat-action-links/server/actionLinkHandler.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; // Action Links Handler. This method will be called off the client. Meteor.methods({ diff --git a/packages/rocketchat-analytics/client/loadScript.js b/packages/rocketchat-analytics/client/loadScript.js index 53573177267c..b70fd29fa62b 100644 --- a/packages/rocketchat-analytics/client/loadScript.js +++ b/packages/rocketchat-analytics/client/loadScript.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; Template.body.onRendered(() => { Tracker.autorun((c) => { const piwikUrl = RocketChat.settings.get('PiwikAnalytics_enabled') && RocketChat.settings.get('PiwikAnalytics_url'); diff --git a/packages/rocketchat-analytics/client/trackEvents.js b/packages/rocketchat-analytics/client/trackEvents.js index b3c2750e012a..8579dbcf900f 100644 --- a/packages/rocketchat-analytics/client/trackEvents.js +++ b/packages/rocketchat-analytics/client/trackEvents.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; function trackEvent(category, action, label) { if (window._paq) { window._paq.push(['trackEvent', category, action, label]); diff --git a/packages/rocketchat-api/server/api.js b/packages/rocketchat-api/server/api.js index 401099edcbf5..fda919bb7434 100644 --- a/packages/rocketchat-api/server/api.js +++ b/packages/rocketchat-api/server/api.js @@ -1,4 +1,6 @@ /* global Restivus, DDP, DDPCommon */ +import { Meteor } from 'meteor/meteor'; + import _ from 'underscore'; const logger = new Logger('API', {}); diff --git a/packages/rocketchat-api/server/helpers/getUserFromParams.js b/packages/rocketchat-api/server/helpers/getUserFromParams.js index b9e918b59439..2c526750ddd9 100644 --- a/packages/rocketchat-api/server/helpers/getUserFromParams.js +++ b/packages/rocketchat-api/server/helpers/getUserFromParams.js @@ -1,4 +1,6 @@ // Convenience method, almost need to turn it into a middleware of sorts +import { Meteor } from 'meteor/meteor'; + RocketChat.API.helperMethods.set('getUserFromParams', function _getUserFromParams() { const doesntExist = { _doesntExist: true }; let user; diff --git a/packages/rocketchat-api/server/helpers/parseJsonQuery.js b/packages/rocketchat-api/server/helpers/parseJsonQuery.js index 64b22724cdf8..f33877d95ed2 100644 --- a/packages/rocketchat-api/server/helpers/parseJsonQuery.js +++ b/packages/rocketchat-api/server/helpers/parseJsonQuery.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.API.helperMethods.set('parseJsonQuery', function _parseJsonQuery() { let sort; if (this.queryParams.sort) { diff --git a/packages/rocketchat-api/server/v1/assets.js b/packages/rocketchat-api/server/v1/assets.js index 9a475fbe6b1b..2035c603ee47 100644 --- a/packages/rocketchat-api/server/v1/assets.js +++ b/packages/rocketchat-api/server/v1/assets.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import Busboy from 'busboy'; RocketChat.API.v1.addRoute('assets.setAsset', { authRequired: true }, { diff --git a/packages/rocketchat-api/server/v1/channels.js b/packages/rocketchat-api/server/v1/channels.js index 784a763bfb3f..a961bea0a814 100644 --- a/packages/rocketchat-api/server/v1/channels.js +++ b/packages/rocketchat-api/server/v1/channels.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; // Returns the channel IF found otherwise it will return the failure of why it didn't. Check the `statusCode` property diff --git a/packages/rocketchat-api/server/v1/chat.js b/packages/rocketchat-api/server/v1/chat.js index 059d6058eca9..0d41305f9983 100644 --- a/packages/rocketchat-api/server/v1/chat.js +++ b/packages/rocketchat-api/server/v1/chat.js @@ -1,4 +1,5 @@ /* global processWebhookMessage */ +import { Meteor } from 'meteor/meteor'; RocketChat.API.v1.addRoute('chat.delete', { authRequired: true }, { post() { diff --git a/packages/rocketchat-api/server/v1/commands.js b/packages/rocketchat-api/server/v1/commands.js index 2d4b8a4e0479..28a18ab419bb 100644 --- a/packages/rocketchat-api/server/v1/commands.js +++ b/packages/rocketchat-api/server/v1/commands.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.API.v1.addRoute('commands.get', { authRequired: true }, { get() { const params = this.queryParams; diff --git a/packages/rocketchat-api/server/v1/e2e.js b/packages/rocketchat-api/server/v1/e2e.js index eb180cb1283a..4d0c5daae6ed 100644 --- a/packages/rocketchat-api/server/v1/e2e.js +++ b/packages/rocketchat-api/server/v1/e2e.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.API.v1.addRoute('e2e.fetchMyKeys', { authRequired: true }, { get() { let result; diff --git a/packages/rocketchat-api/server/v1/emoji-custom.js b/packages/rocketchat-api/server/v1/emoji-custom.js index de05c96412cd..9a5586881e3d 100644 --- a/packages/rocketchat-api/server/v1/emoji-custom.js +++ b/packages/rocketchat-api/server/v1/emoji-custom.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; RocketChat.API.v1.addRoute('emoji-custom', { authRequired: true }, { get() { const emojis = Meteor.call('listEmojiCustom'); diff --git a/packages/rocketchat-api/server/v1/groups.js b/packages/rocketchat-api/server/v1/groups.js index 2944e8f1c1f6..78c0b5a651f3 100644 --- a/packages/rocketchat-api/server/v1/groups.js +++ b/packages/rocketchat-api/server/v1/groups.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; // Returns the private group subscription IF found otherwise it will return the failure of why it didn't. Check the `statusCode` property diff --git a/packages/rocketchat-api/server/v1/im.js b/packages/rocketchat-api/server/v1/im.js index ff728e6e63dc..e70c270cc29c 100644 --- a/packages/rocketchat-api/server/v1/im.js +++ b/packages/rocketchat-api/server/v1/im.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + function findDirectMessageRoom(params, user) { if ((!params.roomId || !params.roomId.trim()) && (!params.username || !params.username.trim())) { throw new Meteor.Error('error-room-param-not-provided', 'Body param "roomId" or "username" is required'); diff --git a/packages/rocketchat-api/server/v1/integrations.js b/packages/rocketchat-api/server/v1/integrations.js index f0f6db93cfd7..d300552e0fea 100644 --- a/packages/rocketchat-api/server/v1/integrations.js +++ b/packages/rocketchat-api/server/v1/integrations.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.API.v1.addRoute('integrations.create', { authRequired: true }, { post() { check(this.bodyParams, Match.ObjectIncluding({ diff --git a/packages/rocketchat-api/server/v1/misc.js b/packages/rocketchat-api/server/v1/misc.js index d29c230b2d96..d9e3df836533 100644 --- a/packages/rocketchat-api/server/v1/misc.js +++ b/packages/rocketchat-api/server/v1/misc.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; RocketChat.API.v1.addRoute('info', { authRequired: false }, { get() { diff --git a/packages/rocketchat-api/server/v1/permissions.js b/packages/rocketchat-api/server/v1/permissions.js index 1517a86b7b55..ad75c37855ea 100644 --- a/packages/rocketchat-api/server/v1/permissions.js +++ b/packages/rocketchat-api/server/v1/permissions.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + /** This API returns all permissions that exists on the server, with respective roles. diff --git a/packages/rocketchat-api/server/v1/push.js b/packages/rocketchat-api/server/v1/push.js index c32be4663be2..a211c8df2d87 100644 --- a/packages/rocketchat-api/server/v1/push.js +++ b/packages/rocketchat-api/server/v1/push.js @@ -1,4 +1,5 @@ /* globals Push */ +import { Meteor } from 'meteor/meteor'; RocketChat.API.v1.addRoute('push.token', { authRequired: true }, { post() { diff --git a/packages/rocketchat-api/server/v1/roles.js b/packages/rocketchat-api/server/v1/roles.js index 1172ae7f1551..988c1523312c 100644 --- a/packages/rocketchat-api/server/v1/roles.js +++ b/packages/rocketchat-api/server/v1/roles.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.API.v1.addRoute('roles.list', { authRequired: true }, { get() { const roles = RocketChat.models.Roles.find({}, { fields: { _updatedAt: 0 } }).fetch(); diff --git a/packages/rocketchat-api/server/v1/rooms.js b/packages/rocketchat-api/server/v1/rooms.js index 0071953d414b..0f28923577d1 100644 --- a/packages/rocketchat-api/server/v1/rooms.js +++ b/packages/rocketchat-api/server/v1/rooms.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import Busboy from 'busboy'; function findRoomByIdOrName({ params, checkedArchived = true }) { diff --git a/packages/rocketchat-api/server/v1/settings.js b/packages/rocketchat-api/server/v1/settings.js index 270b396b4a9f..b67bfdfeb6de 100644 --- a/packages/rocketchat-api/server/v1/settings.js +++ b/packages/rocketchat-api/server/v1/settings.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; // settings endpoints diff --git a/packages/rocketchat-api/server/v1/stats.js b/packages/rocketchat-api/server/v1/stats.js index d9ec61b92e68..c8921276665b 100644 --- a/packages/rocketchat-api/server/v1/stats.js +++ b/packages/rocketchat-api/server/v1/stats.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.API.v1.addRoute('statistics', { authRequired: true }, { get() { let refresh = false; diff --git a/packages/rocketchat-api/server/v1/subscriptions.js b/packages/rocketchat-api/server/v1/subscriptions.js index 65d425168af7..7d1cf75507ff 100644 --- a/packages/rocketchat-api/server/v1/subscriptions.js +++ b/packages/rocketchat-api/server/v1/subscriptions.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.API.v1.addRoute('subscriptions.get', { authRequired: true }, { get() { const { updatedSince } = this.queryParams; diff --git a/packages/rocketchat-api/server/v1/users.js b/packages/rocketchat-api/server/v1/users.js index b797c84f8427..88642100e9d2 100644 --- a/packages/rocketchat-api/server/v1/users.js +++ b/packages/rocketchat-api/server/v1/users.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import Busboy from 'busboy'; diff --git a/packages/rocketchat-apps/client/admin/appManage.js b/packages/rocketchat-apps/client/admin/appManage.js index 70d984839576..4c2f127ab776 100644 --- a/packages/rocketchat-apps/client/admin/appManage.js +++ b/packages/rocketchat-apps/client/admin/appManage.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-apps/client/admin/appWhatIsIt.js b/packages/rocketchat-apps/client/admin/appWhatIsIt.js index 969f21b1f5ec..ce77b1c67248 100644 --- a/packages/rocketchat-apps/client/admin/appWhatIsIt.js +++ b/packages/rocketchat-apps/client/admin/appWhatIsIt.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Template.appWhatIsIt.onCreated(function() { this.isLoading = new ReactiveVar(false); this.hasError = new ReactiveVar(false); diff --git a/packages/rocketchat-apps/client/communication/websockets.js b/packages/rocketchat-apps/client/communication/websockets.js index 3152d0d5b261..a43c8312c62a 100644 --- a/packages/rocketchat-apps/client/communication/websockets.js +++ b/packages/rocketchat-apps/client/communication/websockets.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + export const AppEvents = Object.freeze({ APP_ADDED: 'app/added', APP_REMOVED: 'app/removed', diff --git a/packages/rocketchat-apps/client/orchestrator.js b/packages/rocketchat-apps/client/orchestrator.js index 07e01d02068f..07f79de35f6f 100644 --- a/packages/rocketchat-apps/client/orchestrator.js +++ b/packages/rocketchat-apps/client/orchestrator.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { AppWebsocketReceiver } from './communication'; import { Utilities } from '../lib/misc/Utilities'; diff --git a/packages/rocketchat-apps/server/bridges/api.js b/packages/rocketchat-apps/server/bridges/api.js index 55d5f1d6729b..43f2ed97aba1 100644 --- a/packages/rocketchat-apps/server/bridges/api.js +++ b/packages/rocketchat-apps/server/bridges/api.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import express from 'express'; import { WebApp } from 'meteor/webapp'; diff --git a/packages/rocketchat-apps/server/bridges/commands.js b/packages/rocketchat-apps/server/bridges/commands.js index 381179dfd6ec..cc59dea68346 100644 --- a/packages/rocketchat-apps/server/bridges/commands.js +++ b/packages/rocketchat-apps/server/bridges/commands.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { SlashCommandContext } from '@rocket.chat/apps-engine/definition/slashcommands'; import { Utilities } from '../../lib/misc/Utilities'; diff --git a/packages/rocketchat-apps/server/bridges/messages.js b/packages/rocketchat-apps/server/bridges/messages.js index 82ad9c58ae4b..debbff666499 100644 --- a/packages/rocketchat-apps/server/bridges/messages.js +++ b/packages/rocketchat-apps/server/bridges/messages.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + export class AppMessageBridge { constructor(orch) { this.orch = orch; diff --git a/packages/rocketchat-apps/server/bridges/rooms.js b/packages/rocketchat-apps/server/bridges/rooms.js index 699bb5daac11..a3f257f41e8a 100644 --- a/packages/rocketchat-apps/server/bridges/rooms.js +++ b/packages/rocketchat-apps/server/bridges/rooms.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { RoomType } from '@rocket.chat/apps-engine/definition/rooms'; export class AppRoomBridge { diff --git a/packages/rocketchat-apps/server/communication/methods.js b/packages/rocketchat-apps/server/communication/methods.js index ae32a126bb50..1f67d6e77d79 100644 --- a/packages/rocketchat-apps/server/communication/methods.js +++ b/packages/rocketchat-apps/server/communication/methods.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + const waitToLoad = function(orch) { return new Promise((resolve) => { let id = setInterval(() => { diff --git a/packages/rocketchat-apps/server/communication/rest.js b/packages/rocketchat-apps/server/communication/rest.js index 2c0d4deb1c51..cd99f018ab59 100644 --- a/packages/rocketchat-apps/server/communication/rest.js +++ b/packages/rocketchat-apps/server/communication/rest.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import Busboy from 'busboy'; export class AppsRestApi { diff --git a/packages/rocketchat-apps/server/communication/websockets.js b/packages/rocketchat-apps/server/communication/websockets.js index 436012d1e0fd..94b9c22765a7 100644 --- a/packages/rocketchat-apps/server/communication/websockets.js +++ b/packages/rocketchat-apps/server/communication/websockets.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { AppStatus, AppStatusUtils } from '@rocket.chat/apps-engine/definition/AppStatus'; export const AppEvents = Object.freeze({ diff --git a/packages/rocketchat-apps/server/orchestrator.js b/packages/rocketchat-apps/server/orchestrator.js index 840bc775bab9..b8dd4e494cf9 100644 --- a/packages/rocketchat-apps/server/orchestrator.js +++ b/packages/rocketchat-apps/server/orchestrator.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { RealAppBridges } from './bridges'; import { AppMethods, AppsRestApi, AppServerNotifier } from './communication'; import { AppMessagesConverter, AppRoomsConverter, AppSettingsConverter, AppUsersConverter } from './converters'; diff --git a/packages/rocketchat-assets/server/assets.js b/packages/rocketchat-assets/server/assets.js index 7d48f7b7ebe9..307e0001154e 100644 --- a/packages/rocketchat-assets/server/assets.js +++ b/packages/rocketchat-assets/server/assets.js @@ -1,4 +1,5 @@ /* global WebAppHashing, WebAppInternals */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import sizeOf from 'image-size'; diff --git a/packages/rocketchat-authorization/client/hasPermission.js b/packages/rocketchat-authorization/client/hasPermission.js index 134a014e34a4..e62928bc7eb4 100644 --- a/packages/rocketchat-authorization/client/hasPermission.js +++ b/packages/rocketchat-authorization/client/hasPermission.js @@ -1,4 +1,5 @@ /* globals ChatPermissions */ +import { Meteor } from 'meteor/meteor'; function atLeastOne(permissions = [], scope) { return permissions.some((permissionId) => { diff --git a/packages/rocketchat-authorization/client/startup.js b/packages/rocketchat-authorization/client/startup.js index 0b3fea3f86f4..419a97d2d28a 100644 --- a/packages/rocketchat-authorization/client/startup.js +++ b/packages/rocketchat-authorization/client/startup.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.CachedCollectionManager.onLogin(() => { Meteor.subscribe('roles'); }); diff --git a/packages/rocketchat-authorization/client/usersNameChanged.js b/packages/rocketchat-authorization/client/usersNameChanged.js index 720577e05d0b..a31514e2567a 100644 --- a/packages/rocketchat-authorization/client/usersNameChanged.js +++ b/packages/rocketchat-authorization/client/usersNameChanged.js @@ -1,4 +1,6 @@ /* globals RoomRoles */ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.Notifications.onLogged('Users:NameChanged', function({ _id, name }) { RoomRoles.update({ diff --git a/packages/rocketchat-authorization/client/views/permissions.js b/packages/rocketchat-authorization/client/views/permissions.js index 5bb5c204c20c..85fe41ffc5e8 100644 --- a/packages/rocketchat-authorization/client/views/permissions.js +++ b/packages/rocketchat-authorization/client/views/permissions.js @@ -1,4 +1,5 @@ /* globals ChatPermissions */ +import { Meteor } from 'meteor/meteor'; Template.permissions.helpers({ role() { diff --git a/packages/rocketchat-authorization/client/views/permissionsRole.js b/packages/rocketchat-authorization/client/views/permissionsRole.js index 9b3401861235..1bf1bb252f19 100644 --- a/packages/rocketchat-authorization/client/views/permissionsRole.js +++ b/packages/rocketchat-authorization/client/views/permissionsRole.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; Template.permissionsRole.helpers({ diff --git a/packages/rocketchat-authorization/server/functions/addUserRoles.js b/packages/rocketchat-authorization/server/functions/addUserRoles.js index 59870b8c8cff..2799c6cf0eb0 100644 --- a/packages/rocketchat-authorization/server/functions/addUserRoles.js +++ b/packages/rocketchat-authorization/server/functions/addUserRoles.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; RocketChat.authz.addUserRoles = function(userId, roleNames, scope) { diff --git a/packages/rocketchat-authorization/server/functions/removeUserFromRoles.js b/packages/rocketchat-authorization/server/functions/removeUserFromRoles.js index d761e60462a3..e5395651135c 100644 --- a/packages/rocketchat-authorization/server/functions/removeUserFromRoles.js +++ b/packages/rocketchat-authorization/server/functions/removeUserFromRoles.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; RocketChat.authz.removeUserFromRoles = function(userId, roleNames, scope) { diff --git a/packages/rocketchat-authorization/server/methods/addPermissionToRole.js b/packages/rocketchat-authorization/server/methods/addPermissionToRole.js index af23e0d0c753..d7ea3d2164b3 100644 --- a/packages/rocketchat-authorization/server/methods/addPermissionToRole.js +++ b/packages/rocketchat-authorization/server/methods/addPermissionToRole.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'authorization:addPermissionToRole'(permission, role) { if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'access-permissions')) { diff --git a/packages/rocketchat-authorization/server/methods/addUserToRole.js b/packages/rocketchat-authorization/server/methods/addUserToRole.js index 4efd345e9fa0..65e86aa11e00 100644 --- a/packages/rocketchat-authorization/server/methods/addUserToRole.js +++ b/packages/rocketchat-authorization/server/methods/addUserToRole.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.methods({ diff --git a/packages/rocketchat-authorization/server/methods/deleteRole.js b/packages/rocketchat-authorization/server/methods/deleteRole.js index 888a56952f52..e1686b6c40ff 100644 --- a/packages/rocketchat-authorization/server/methods/deleteRole.js +++ b/packages/rocketchat-authorization/server/methods/deleteRole.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'authorization:deleteRole'(roleName) { if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'access-permissions')) { diff --git a/packages/rocketchat-authorization/server/methods/removeRoleFromPermission.js b/packages/rocketchat-authorization/server/methods/removeRoleFromPermission.js index 5278efc7c302..c9d6a87b19b6 100644 --- a/packages/rocketchat-authorization/server/methods/removeRoleFromPermission.js +++ b/packages/rocketchat-authorization/server/methods/removeRoleFromPermission.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'authorization:removeRoleFromPermission'(permission, role) { if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'access-permissions')) { diff --git a/packages/rocketchat-authorization/server/methods/removeUserFromRole.js b/packages/rocketchat-authorization/server/methods/removeUserFromRole.js index 36b0e2153d1a..95508970e2c3 100644 --- a/packages/rocketchat-authorization/server/methods/removeUserFromRole.js +++ b/packages/rocketchat-authorization/server/methods/removeUserFromRole.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.methods({ diff --git a/packages/rocketchat-authorization/server/methods/saveRole.js b/packages/rocketchat-authorization/server/methods/saveRole.js index b828dabbef85..92bf83c55875 100644 --- a/packages/rocketchat-authorization/server/methods/saveRole.js +++ b/packages/rocketchat-authorization/server/methods/saveRole.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'authorization:saveRole'(roleData) { if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'access-permissions')) { diff --git a/packages/rocketchat-authorization/server/models/Base.js b/packages/rocketchat-authorization/server/models/Base.js index c625370304f7..6e7c95d025f1 100644 --- a/packages/rocketchat-authorization/server/models/Base.js +++ b/packages/rocketchat-authorization/server/models/Base.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; RocketChat.models._Base.prototype.roleBaseQuery = function(/* userId, scope*/) { diff --git a/packages/rocketchat-authorization/server/publications/permissions.js b/packages/rocketchat-authorization/server/publications/permissions.js index fce3917b6c37..85a620533505 100644 --- a/packages/rocketchat-authorization/server/publications/permissions.js +++ b/packages/rocketchat-authorization/server/publications/permissions.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'permissions/get'(updatedAt) { this.unblock(); diff --git a/packages/rocketchat-authorization/server/publications/roles.js b/packages/rocketchat-authorization/server/publications/roles.js index a7e8625c9f23..02ce78c15cf9 100644 --- a/packages/rocketchat-authorization/server/publications/roles.js +++ b/packages/rocketchat-authorization/server/publications/roles.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('roles', function() { if (!this.userId) { return this.ready(); diff --git a/packages/rocketchat-authorization/server/publications/usersInRole.js b/packages/rocketchat-authorization/server/publications/usersInRole.js index d0444ccc63a2..8a6fa19b426c 100644 --- a/packages/rocketchat-authorization/server/publications/usersInRole.js +++ b/packages/rocketchat-authorization/server/publications/usersInRole.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('usersInRole', function(roleName, scope, limit = 50) { if (!this.userId) { return this.ready(); diff --git a/packages/rocketchat-authorization/server/startup.js b/packages/rocketchat-authorization/server/startup.js index 1ddb15068bad..21a694163355 100644 --- a/packages/rocketchat-authorization/server/startup.js +++ b/packages/rocketchat-authorization/server/startup.js @@ -1,4 +1,5 @@ /* eslint no-multi-spaces: 0 */ +import { Meteor } from 'meteor/meteor'; Meteor.startup(function() { // Note: diff --git a/packages/rocketchat-autolinker/client/client.js b/packages/rocketchat-autolinker/client/client.js index 15acc510527b..2ed58e79439e 100644 --- a/packages/rocketchat-autolinker/client/client.js +++ b/packages/rocketchat-autolinker/client/client.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; // diff --git a/packages/rocketchat-autolinker/server/settings.js b/packages/rocketchat-autolinker/server/settings.js index 95ef08bc30a5..9b693d6fa01d 100644 --- a/packages/rocketchat-autolinker/server/settings.js +++ b/packages/rocketchat-autolinker/server/settings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { const enableQuery = { _id: 'AutoLinker', diff --git a/packages/rocketchat-autotranslate/client/lib/actionButton.js b/packages/rocketchat-autotranslate/client/lib/actionButton.js index bf6100f33820..506a7d99077f 100644 --- a/packages/rocketchat-autotranslate/client/lib/actionButton.js +++ b/packages/rocketchat-autotranslate/client/lib/actionButton.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { Tracker.autorun(function() { if (RocketChat.settings.get('AutoTranslate_Enabled') && RocketChat.authz.hasAtLeastOnePermission(['auto-translate'])) { diff --git a/packages/rocketchat-autotranslate/client/lib/autotranslate.js b/packages/rocketchat-autotranslate/client/lib/autotranslate.js index d4c7c47788ed..cdfb6f4a56d4 100644 --- a/packages/rocketchat-autotranslate/client/lib/autotranslate.js +++ b/packages/rocketchat-autotranslate/client/lib/autotranslate.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; RocketChat.AutoTranslate = { diff --git a/packages/rocketchat-autotranslate/client/lib/tabBar.js b/packages/rocketchat-autotranslate/client/lib/tabBar.js index 7007121097d9..a0b250731338 100644 --- a/packages/rocketchat-autotranslate/client/lib/tabBar.js +++ b/packages/rocketchat-autotranslate/client/lib/tabBar.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { Tracker.autorun(function() { if (RocketChat.settings.get('AutoTranslate_Enabled') && RocketChat.authz.hasAtLeastOnePermission(['auto-translate'])) { diff --git a/packages/rocketchat-autotranslate/client/views/autoTranslateFlexTab.js b/packages/rocketchat-autotranslate/client/views/autoTranslateFlexTab.js index 47f3feb7d8c0..0134944c13ee 100644 --- a/packages/rocketchat-autotranslate/client/views/autoTranslateFlexTab.js +++ b/packages/rocketchat-autotranslate/client/views/autoTranslateFlexTab.js @@ -1,4 +1,5 @@ /* globals ChatSubscription */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-autotranslate/server/autotranslate.js b/packages/rocketchat-autotranslate/server/autotranslate.js index 75a637fa0433..afbb6c5f0113 100644 --- a/packages/rocketchat-autotranslate/server/autotranslate.js +++ b/packages/rocketchat-autotranslate/server/autotranslate.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-autotranslate/server/methods/getSupportedLanguages.js b/packages/rocketchat-autotranslate/server/methods/getSupportedLanguages.js index 17e84b7230aa..eea0e5bb8072 100644 --- a/packages/rocketchat-autotranslate/server/methods/getSupportedLanguages.js +++ b/packages/rocketchat-autotranslate/server/methods/getSupportedLanguages.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'autoTranslate.getSupportedLanguages'(targetLanguage) { if (!RocketChat.authz.hasPermission(Meteor.userId(), 'auto-translate')) { diff --git a/packages/rocketchat-autotranslate/server/methods/saveSettings.js b/packages/rocketchat-autotranslate/server/methods/saveSettings.js index 5a948cd4f090..4a05412d297b 100644 --- a/packages/rocketchat-autotranslate/server/methods/saveSettings.js +++ b/packages/rocketchat-autotranslate/server/methods/saveSettings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'autoTranslate.saveSettings'(rid, field, value, options) { if (!Meteor.userId()) { diff --git a/packages/rocketchat-autotranslate/server/methods/translateMessage.js b/packages/rocketchat-autotranslate/server/methods/translateMessage.js index 9a5819b45bc8..cb84cf754c97 100644 --- a/packages/rocketchat-autotranslate/server/methods/translateMessage.js +++ b/packages/rocketchat-autotranslate/server/methods/translateMessage.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'autoTranslate.translateMessage'(message, targetLanguage) { const room = RocketChat.models.Rooms.findOneById(message && message.rid); diff --git a/packages/rocketchat-autotranslate/server/models/Subscriptions.js b/packages/rocketchat-autotranslate/server/models/Subscriptions.js index 703623ea6923..18e1e0025eeb 100644 --- a/packages/rocketchat-autotranslate/server/models/Subscriptions.js +++ b/packages/rocketchat-autotranslate/server/models/Subscriptions.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.models.Subscriptions.updateAutoTranslateById = function(_id, autoTranslate) { const query = { _id, diff --git a/packages/rocketchat-autotranslate/server/permissions.js b/packages/rocketchat-autotranslate/server/permissions.js index 03c306e2e2ec..24621ca42326 100644 --- a/packages/rocketchat-autotranslate/server/permissions.js +++ b/packages/rocketchat-autotranslate/server/permissions.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(() => { if (RocketChat.models && RocketChat.models.Permissions) { if (!RocketChat.models.Permissions.findOne({ _id: 'auto-translate' })) { diff --git a/packages/rocketchat-bot-helpers/server/index.js b/packages/rocketchat-bot-helpers/server/index.js index c43182a12a5c..44c1cdf1787a 100644 --- a/packages/rocketchat-bot-helpers/server/index.js +++ b/packages/rocketchat-bot-helpers/server/index.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; /** diff --git a/packages/rocketchat-cas/server/cas_server.js b/packages/rocketchat-cas/server/cas_server.js index ac7a7fbf37b0..726157db8264 100644 --- a/packages/rocketchat-cas/server/cas_server.js +++ b/packages/rocketchat-cas/server/cas_server.js @@ -1,5 +1,6 @@ /* globals RoutePolicy, logger */ /* jshint newcap: false */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import fiber from 'fibers'; diff --git a/packages/rocketchat-channel-settings-mail-messages/server/methods/mailMessages.js b/packages/rocketchat-channel-settings-mail-messages/server/methods/mailMessages.js index 930c946d08e1..9e404a03bbf5 100644 --- a/packages/rocketchat-channel-settings-mail-messages/server/methods/mailMessages.js +++ b/packages/rocketchat-channel-settings-mail-messages/server/methods/mailMessages.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import moment from 'moment'; import * as Mailer from 'meteor/rocketchat:mailer'; diff --git a/packages/rocketchat-channel-settings/server/methods/saveRoomSettings.js b/packages/rocketchat-channel-settings/server/methods/saveRoomSettings.js index adb44bcc21ef..77906a857c4e 100644 --- a/packages/rocketchat-channel-settings/server/methods/saveRoomSettings.js +++ b/packages/rocketchat-channel-settings/server/methods/saveRoomSettings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + const fields = ['roomName', 'roomTopic', 'roomAnnouncement', 'roomCustomFields', 'roomDescription', 'roomType', 'readOnly', 'reactWhenReadOnly', 'systemMessages', 'default', 'joinCode', 'tokenpass', 'streamingOptions', 'retentionEnabled', 'retentionMaxAge', 'retentionExcludePinned', 'retentionFilesOnly', 'retentionOverrideGlobal', 'encrypted']; Meteor.methods({ saveRoomSettings(rid, settings, value) { diff --git a/packages/rocketchat-crowd/server/crowd.js b/packages/rocketchat-crowd/server/crowd.js index a636878407e0..c430d78f8ac0 100644 --- a/packages/rocketchat-crowd/server/crowd.js +++ b/packages/rocketchat-crowd/server/crowd.js @@ -1,5 +1,6 @@ /* globals:CROWD:true */ /* eslint new-cap: [2, {"capIsNewExceptions": ["SHA256"]}] */ +import { Meteor } from 'meteor/meteor'; const logger = new Logger('CROWD', {}); function fallbackDefaultAccountSystem(bind, username, password) { diff --git a/packages/rocketchat-file-upload/server/methods/sendFileMessage.js b/packages/rocketchat-file-upload/server/methods/sendFileMessage.js index 6074f001817a..a5da741d7afa 100644 --- a/packages/rocketchat-file-upload/server/methods/sendFileMessage.js +++ b/packages/rocketchat-file-upload/server/methods/sendFileMessage.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.methods({ diff --git a/packages/rocketchat-file/file.server.js b/packages/rocketchat-file/file.server.js index bb36379426f8..223b086e6828 100644 --- a/packages/rocketchat-file/file.server.js +++ b/packages/rocketchat-file/file.server.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import Grid from 'gridfs-stream'; import stream from 'stream'; import fs from 'fs'; diff --git a/packages/rocketchat-importer-csv/server/importer.js b/packages/rocketchat-importer-csv/server/importer.js index 456fa24c33e6..c10a512041ca 100644 --- a/packages/rocketchat-importer-csv/server/importer.js +++ b/packages/rocketchat-importer-csv/server/importer.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { Base, ProgressStep, diff --git a/packages/rocketchat-importer-hipchat-enterprise/server/importer.js b/packages/rocketchat-importer-hipchat-enterprise/server/importer.js index f019f10fc3de..73c9f263d588 100644 --- a/packages/rocketchat-importer-hipchat-enterprise/server/importer.js +++ b/packages/rocketchat-importer-hipchat-enterprise/server/importer.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { Base, ProgressStep, diff --git a/packages/rocketchat-importer-hipchat/server/importer.js b/packages/rocketchat-importer-hipchat/server/importer.js index 6f11bd2b4998..7c9ec7789fa0 100644 --- a/packages/rocketchat-importer-hipchat/server/importer.js +++ b/packages/rocketchat-importer-hipchat/server/importer.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { Base, ProgressStep, diff --git a/packages/rocketchat-importer-slack/server/importer.js b/packages/rocketchat-importer-slack/server/importer.js index f76647eb00d5..f06f03e641ee 100644 --- a/packages/rocketchat-importer-slack/server/importer.js +++ b/packages/rocketchat-importer-slack/server/importer.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { Base, ProgressStep, diff --git a/packages/rocketchat-importer/client/admin/adminImportPrepare.js b/packages/rocketchat-importer/client/admin/adminImportPrepare.js index 164aa85eb81f..aa93a2cb2687 100644 --- a/packages/rocketchat-importer/client/admin/adminImportPrepare.js +++ b/packages/rocketchat-importer/client/admin/adminImportPrepare.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { Importers } from 'meteor/rocketchat:importer'; import toastr from 'toastr'; diff --git a/packages/rocketchat-importer/server/methods/restartImport.js b/packages/rocketchat-importer/server/methods/restartImport.js index d4a8fdc35bb7..896f12107e67 100644 --- a/packages/rocketchat-importer/server/methods/restartImport.js +++ b/packages/rocketchat-importer/server/methods/restartImport.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { Importers, ProgressStep, diff --git a/packages/rocketchat-importer/server/methods/setupImporter.js b/packages/rocketchat-importer/server/methods/setupImporter.js index c0530272393b..f1490e955330 100644 --- a/packages/rocketchat-importer/server/methods/setupImporter.js +++ b/packages/rocketchat-importer/server/methods/setupImporter.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { Importers } from 'meteor/rocketchat:importer'; Meteor.methods({ diff --git a/packages/rocketchat-importer/server/methods/startImport.js b/packages/rocketchat-importer/server/methods/startImport.js index bb17497df7ee..b47ed0a34dbf 100644 --- a/packages/rocketchat-importer/server/methods/startImport.js +++ b/packages/rocketchat-importer/server/methods/startImport.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { Importers, Selection, diff --git a/packages/rocketchat-integrations/client/views/integrationsOutgoing.js b/packages/rocketchat-integrations/client/views/integrationsOutgoing.js index b207085ff539..dd3fe136cbbf 100644 --- a/packages/rocketchat-integrations/client/views/integrationsOutgoing.js +++ b/packages/rocketchat-integrations/client/views/integrationsOutgoing.js @@ -1,5 +1,6 @@ /* global ChatIntegrations */ +import { Meteor } from 'meteor/meteor'; import hljs from 'highlight.js'; import toastr from 'toastr'; diff --git a/packages/rocketchat-integrations/server/lib/validation.js b/packages/rocketchat-integrations/server/lib/validation.js index efa7ac99f2e5..5b698104a984 100644 --- a/packages/rocketchat-integrations/server/lib/validation.js +++ b/packages/rocketchat-integrations/server/lib/validation.js @@ -1,4 +1,5 @@ /* global Babel */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; const scopedChannels = ['all_public_channels', 'all_private_groups', 'all_direct_messages']; diff --git a/packages/rocketchat-integrations/server/methods/incoming/addIncomingIntegration.js b/packages/rocketchat-integrations/server/methods/incoming/addIncomingIntegration.js index 63f16dd6112d..0fe8e9a63a01 100644 --- a/packages/rocketchat-integrations/server/methods/incoming/addIncomingIntegration.js +++ b/packages/rocketchat-integrations/server/methods/incoming/addIncomingIntegration.js @@ -1,4 +1,5 @@ /* global Babel */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; const validChannelChars = ['@', '#']; diff --git a/packages/rocketchat-integrations/server/methods/incoming/updateIncomingIntegration.js b/packages/rocketchat-integrations/server/methods/incoming/updateIncomingIntegration.js index 4e818c352375..36333decc93a 100644 --- a/packages/rocketchat-integrations/server/methods/incoming/updateIncomingIntegration.js +++ b/packages/rocketchat-integrations/server/methods/incoming/updateIncomingIntegration.js @@ -1,4 +1,5 @@ /* global Babel */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; const validChannelChars = ['@', '#']; diff --git a/packages/rocketchat-internal-hubot/hubot.js b/packages/rocketchat-internal-hubot/hubot.js index 757e5efa8fcb..54bb5ed6acdc 100644 --- a/packages/rocketchat-internal-hubot/hubot.js +++ b/packages/rocketchat-internal-hubot/hubot.js @@ -1,4 +1,5 @@ /* globals __meteor_bootstrap__ */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-irc/server/methods/resetIrcConnection.js b/packages/rocketchat-irc/server/methods/resetIrcConnection.js index c0618510fdf4..1cc372d13537 100644 --- a/packages/rocketchat-irc/server/methods/resetIrcConnection.js +++ b/packages/rocketchat-irc/server/methods/resetIrcConnection.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import Bridge from '../irc-bridge'; Meteor.methods({ diff --git a/packages/rocketchat-lazy-load/client/index.js b/packages/rocketchat-lazy-load/client/index.js index 648f0d21c5e0..46edfbc9f11f 100644 --- a/packages/rocketchat-lazy-load/client/index.js +++ b/packages/rocketchat-lazy-load/client/index.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import './lazyloadImage'; export const fixCordova = function(url) { diff --git a/packages/rocketchat-ldap/server/sync.js b/packages/rocketchat-ldap/server/sync.js index 000da3b5848b..1605d3c38a00 100644 --- a/packages/rocketchat-ldap/server/sync.js +++ b/packages/rocketchat-ldap/server/sync.js @@ -1,5 +1,6 @@ /* globals slugify, SyncedCron */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import LDAP from './ldap'; diff --git a/packages/rocketchat-ldap/server/testConnection.js b/packages/rocketchat-ldap/server/testConnection.js index fb1266f4999f..0e78ceffe2dd 100644 --- a/packages/rocketchat-ldap/server/testConnection.js +++ b/packages/rocketchat-ldap/server/testConnection.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import LDAP from './ldap'; Meteor.methods({ diff --git a/packages/rocketchat-lib/client/MessageAction.js b/packages/rocketchat-lib/client/MessageAction.js index d4f4f74695a7..cdf9bedb7a16 100644 --- a/packages/rocketchat-lib/client/MessageAction.js +++ b/packages/rocketchat-lib/client/MessageAction.js @@ -1,5 +1,6 @@ /* globals chatMessages cordova */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import moment from 'moment'; import toastr from 'toastr'; diff --git a/packages/rocketchat-lib/client/Notifications.js b/packages/rocketchat-lib/client/Notifications.js index 4b8a5470e6f0..86e0e2727dce 100644 --- a/packages/rocketchat-lib/client/Notifications.js +++ b/packages/rocketchat-lib/client/Notifications.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.Notifications = new class { constructor(...args) { this.logged = Meteor.userId() !== null; diff --git a/packages/rocketchat-lib/client/lib/cachedCollection.js b/packages/rocketchat-lib/client/lib/cachedCollection.js index aabc101b42aa..e91c0dccb3be 100644 --- a/packages/rocketchat-lib/client/lib/cachedCollection.js +++ b/packages/rocketchat-lib/client/lib/cachedCollection.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import localforage from 'localforage'; import _ from 'underscore'; diff --git a/packages/rocketchat-lib/lib/RoomTypeConfig.js b/packages/rocketchat-lib/lib/RoomTypeConfig.js index 068404195161..ec1794d688cf 100644 --- a/packages/rocketchat-lib/lib/RoomTypeConfig.js +++ b/packages/rocketchat-lib/lib/RoomTypeConfig.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + export const RoomSettingsEnum = { NAME: 'roomName', TOPIC: 'roomTopic', diff --git a/packages/rocketchat-lib/lib/settings.js b/packages/rocketchat-lib/lib/settings.js index a86d1f6d581e..f86ab11bcd25 100644 --- a/packages/rocketchat-lib/lib/settings.js +++ b/packages/rocketchat-lib/lib/settings.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; /* diff --git a/packages/rocketchat-lib/lib/slashCommand.js b/packages/rocketchat-lib/lib/slashCommand.js index 1fe21a7d18d7..c502ccc65d97 100644 --- a/packages/rocketchat-lib/lib/slashCommand.js +++ b/packages/rocketchat-lib/lib/slashCommand.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.slashCommands = { commands: {}, }; diff --git a/packages/rocketchat-lib/server/functions/saveUser.js b/packages/rocketchat-lib/server/functions/saveUser.js index 02dc6f02aea1..38dba4dfe96c 100644 --- a/packages/rocketchat-lib/server/functions/saveUser.js +++ b/packages/rocketchat-lib/server/functions/saveUser.js @@ -1,4 +1,5 @@ /* globals Gravatar */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; import * as Mailer from 'meteor/rocketchat:mailer'; diff --git a/packages/rocketchat-lib/server/lib/interceptDirectReplyEmails.js b/packages/rocketchat-lib/server/lib/interceptDirectReplyEmails.js index ef03456f492a..9b0bcb521c64 100644 --- a/packages/rocketchat-lib/server/lib/interceptDirectReplyEmails.js +++ b/packages/rocketchat-lib/server/lib/interceptDirectReplyEmails.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import IMAP from 'imap'; import POP3 from 'poplib'; import { simpleParser } from 'mailparser'; diff --git a/packages/rocketchat-lib/server/methods/addUsersToRoom.js b/packages/rocketchat-lib/server/methods/addUsersToRoom.js index 1995b47a7b0b..5dae0b5ada50 100644 --- a/packages/rocketchat-lib/server/methods/addUsersToRoom.js +++ b/packages/rocketchat-lib/server/methods/addUsersToRoom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ addUsersToRoom(data = {}) { // Validate user and room diff --git a/packages/rocketchat-lib/server/methods/archiveRoom.js b/packages/rocketchat-lib/server/methods/archiveRoom.js index da60a4270fb9..cc725c11611f 100644 --- a/packages/rocketchat-lib/server/methods/archiveRoom.js +++ b/packages/rocketchat-lib/server/methods/archiveRoom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ archiveRoom(rid) { diff --git a/packages/rocketchat-lib/server/methods/deleteMessage.js b/packages/rocketchat-lib/server/methods/deleteMessage.js index 1968dc4e6290..928c59505878 100644 --- a/packages/rocketchat-lib/server/methods/deleteMessage.js +++ b/packages/rocketchat-lib/server/methods/deleteMessage.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import moment from 'moment'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/methods/deleteUserOwnAccount.js b/packages/rocketchat-lib/server/methods/deleteUserOwnAccount.js index a4c255d7b95d..33128f5ab704 100644 --- a/packages/rocketchat-lib/server/methods/deleteUserOwnAccount.js +++ b/packages/rocketchat-lib/server/methods/deleteUserOwnAccount.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/lib/Livechat.js b/packages/rocketchat-livechat/server/lib/Livechat.js index e4291cd13df9..359e06dbac2f 100644 --- a/packages/rocketchat-livechat/server/lib/Livechat.js +++ b/packages/rocketchat-livechat/server/lib/Livechat.js @@ -1,4 +1,5 @@ /* globals HTTP */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-message-pin/server/pinMessage.js b/packages/rocketchat-message-pin/server/pinMessage.js index 497662b5f0cf..8e1823251c60 100644 --- a/packages/rocketchat-message-pin/server/pinMessage.js +++ b/packages/rocketchat-message-pin/server/pinMessage.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + const recursiveRemove = (msg, deep = 1) => { if (!msg) { return; diff --git a/packages/rocketchat-push-notifications/server/methods/saveNotificationSettings.js b/packages/rocketchat-push-notifications/server/methods/saveNotificationSettings.js index 1f674c49957f..9f445eb9fe33 100644 --- a/packages/rocketchat-push-notifications/server/methods/saveNotificationSettings.js +++ b/packages/rocketchat-push-notifications/server/methods/saveNotificationSettings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ saveNotificationSettings(roomId, field, value) { if (!Meteor.userId()) { diff --git a/packages/rocketchat-slackbridge/server/SlackAdapter.js b/packages/rocketchat-slackbridge/server/SlackAdapter.js index 60c650032814..2363f3d553d8 100644 --- a/packages/rocketchat-slackbridge/server/SlackAdapter.js +++ b/packages/rocketchat-slackbridge/server/SlackAdapter.js @@ -1,4 +1,5 @@ /* globals logger*/ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import url from 'url'; import http from 'http'; diff --git a/packages/rocketchat-ui-account/client/accountPreferences.js b/packages/rocketchat-ui-account/client/accountPreferences.js index 6778dae534c6..140dba69f79f 100644 --- a/packages/rocketchat-ui-account/client/accountPreferences.js +++ b/packages/rocketchat-ui-account/client/accountPreferences.js @@ -1,4 +1,5 @@ /* globals KonchatNotification */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-account/client/accountProfile.js b/packages/rocketchat-ui-account/client/accountProfile.js index 9a3f7acdb85d..74b530ee727e 100644 --- a/packages/rocketchat-ui-account/client/accountProfile.js +++ b/packages/rocketchat-ui-account/client/accountProfile.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-admin/client/admin.js b/packages/rocketchat-ui-admin/client/admin.js index e9ec12f91213..a190ace994ae 100644 --- a/packages/rocketchat-ui-admin/client/admin.js +++ b/packages/rocketchat-ui-admin/client/admin.js @@ -1,4 +1,5 @@ /* globals jscolor, i18nDefaultQuery */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js b/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js index 1ea3038ea49c..41121648ed4a 100644 --- a/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js +++ b/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js @@ -1,4 +1,5 @@ /* globals AdminChatRoom */ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; Template.adminRoomInfo.helpers({ selectedRoom() { diff --git a/packages/rocketchat-ui-flextab/client/tabs/userActions.js b/packages/rocketchat-ui-flextab/client/tabs/userActions.js index 24790cb1425b..8ea0bde799c1 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/userActions.js +++ b/packages/rocketchat-ui-flextab/client/tabs/userActions.js @@ -1,4 +1,5 @@ /* globals RoomRoles, WebRTC*/ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-login/client/login/form.js b/packages/rocketchat-ui-login/client/login/form.js index 3aebca3aca9d..eff33471aba4 100644 --- a/packages/rocketchat-ui-login/client/login/form.js +++ b/packages/rocketchat-ui-login/client/login/form.js @@ -1,4 +1,5 @@ /* globals OnePassword, device */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-master/client/main.js b/packages/rocketchat-ui-master/client/main.js index 1130ea1895d6..501d8c6ccfe5 100644 --- a/packages/rocketchat-ui-master/client/main.js +++ b/packages/rocketchat-ui-master/client/main.js @@ -1,4 +1,5 @@ /* globals toolbarSearch, menu, fireGlobalEvent, CachedChatSubscription, DynamicCss, popover */ +import { Meteor } from 'meteor/meteor'; import Clipboard from 'clipboard'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-message/client/message.js b/packages/rocketchat-ui-message/client/message.js index c1e54fbb2173..14a07fe472df 100644 --- a/packages/rocketchat-ui-message/client/message.js +++ b/packages/rocketchat-ui-message/client/message.js @@ -1,4 +1,5 @@ /* globals renderEmoji renderMessageBody */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import moment from 'moment'; import { DateFormat } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-ui-message/client/messageBox.js b/packages/rocketchat-ui-message/client/messageBox.js index 5c482873265e..089928306297 100644 --- a/packages/rocketchat-ui-message/client/messageBox.js +++ b/packages/rocketchat-ui-message/client/messageBox.js @@ -1,4 +1,5 @@ /* globals fileUpload KonchatNotification chatMessages popover AudioRecorder chatMessages fileUploadHandler*/ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; import moment from 'moment'; import _ from 'underscore'; diff --git a/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js b/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js index f6ee0d827e93..5b10f06f8b32 100644 --- a/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js +++ b/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; const usersFromRoomMessages = new Mongo.Collection(null); diff --git a/packages/rocketchat-ui/client/lib/RoomManager.js b/packages/rocketchat-ui/client/lib/RoomManager.js index 82904ec43bb5..0a1d6b8ae04c 100644 --- a/packages/rocketchat-ui/client/lib/RoomManager.js +++ b/packages/rocketchat-ui/client/lib/RoomManager.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import { upsertMessage } from './RoomHistoryManager'; diff --git a/packages/rocketchat-ui/client/lib/chatMessages.js b/packages/rocketchat-ui/client/lib/chatMessages.js index b930bfd08132..f248fce1f44e 100644 --- a/packages/rocketchat-ui/client/lib/chatMessages.js +++ b/packages/rocketchat-ui/client/lib/chatMessages.js @@ -1,4 +1,5 @@ /* globals MsgTyping */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-ui/client/lib/notification.js b/packages/rocketchat-ui/client/lib/notification.js index 3d92f6d5218d..58b64ed16ba7 100644 --- a/packages/rocketchat-ui/client/lib/notification.js +++ b/packages/rocketchat-ui/client/lib/notification.js @@ -1,4 +1,5 @@ // @TODO implementar 'clicar na notificacao' abre a janela do chat +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; import { e2e } from 'meteor/rocketchat:e2e'; diff --git a/packages/rocketchat-ui/client/views/app/room.js b/packages/rocketchat-ui/client/views/app/room.js index 895cb2758912..ce1aef410f9a 100644 --- a/packages/rocketchat-ui/client/views/app/room.js +++ b/packages/rocketchat-ui/client/views/app/room.js @@ -1,4 +1,5 @@ /* globals chatMessages, fileUpload , fireGlobalEvent , cordova , readMessage , RoomRoles, popover , device */ +import { Meteor } from 'meteor/meteor'; import { RocketChatTabBar } from 'meteor/rocketchat:lib'; import _ from 'underscore'; diff --git a/packages/rocketchat-videobridge/client/views/videoFlexTab.js b/packages/rocketchat-videobridge/client/views/videoFlexTab.js index 4896b7f3ad80..5e70ef627b16 100644 --- a/packages/rocketchat-videobridge/client/views/videoFlexTab.js +++ b/packages/rocketchat-videobridge/client/views/videoFlexTab.js @@ -1,5 +1,6 @@ /* globals JitsiMeetExternalAPI */ /* eslint new-cap: [2, {"capIsNewExceptions": ["MD5"]}] */ +import { Meteor } from 'meteor/meteor'; Template.videoFlexTab.helpers({ openInNewWindow() { @@ -104,7 +105,7 @@ Template.videoFlexTab.onRendered(function() { // Lets make sure its loaded before we try to show it. } else if (typeof JitsiMeetExternalAPI !== 'undefined') { - // Keep it from showing duplicates when re-evaluated on variable change. + // Keep it from showing duplicates when re-evaluated on variable change. if (!$('[id^=jitsiConference]').length) { this.api = new JitsiMeetExternalAPI(domain, jitsiRoom, width, height, this.$('.video-container').get(0), configOverwrite, interfaceConfigOverwrite, noSsl); diff --git a/packages/rocketchat-videobridge/server/methods/bbb.js b/packages/rocketchat-videobridge/server/methods/bbb.js index 762899995d1f..dc0fdad5d92a 100644 --- a/packages/rocketchat-videobridge/server/methods/bbb.js +++ b/packages/rocketchat-videobridge/server/methods/bbb.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import BigBlueButtonApi from 'meteor/rocketchat:bigbluebutton'; import { HTTP } from 'meteor/http'; import xml2js from 'xml2js'; diff --git a/packages/rocketchat-webrtc/client/WebRTCClass.js b/packages/rocketchat-webrtc/client/WebRTCClass.js index ca893919998a..5919330d468a 100644 --- a/packages/rocketchat-webrtc/client/WebRTCClass.js +++ b/packages/rocketchat-webrtc/client/WebRTCClass.js @@ -1,4 +1,5 @@ /* globals chrome, ChromeScreenShare */ +import { Meteor } from 'meteor/meteor'; class WebRTCTransportClass { constructor(webrtcInstance) { this.debug = false; diff --git a/server/lib/accounts.js b/server/lib/accounts.js index ab3b1b1e08d3..3d5670b2d692 100644 --- a/server/lib/accounts.js +++ b/server/lib/accounts.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; import * as Mailer from 'meteor/rocketchat:mailer'; diff --git a/server/methods/addRoomLeader.js b/server/methods/addRoomLeader.js index 18517defedac..9fc171e5c6e5 100644 --- a/server/methods/addRoomLeader.js +++ b/server/methods/addRoomLeader.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ addRoomLeader(rid, userId) { check(rid, String); diff --git a/server/methods/addRoomModerator.js b/server/methods/addRoomModerator.js index b7404cdc3dd1..9cd63c86c300 100644 --- a/server/methods/addRoomModerator.js +++ b/server/methods/addRoomModerator.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ addRoomModerator(rid, userId) { check(rid, String); diff --git a/server/methods/addRoomOwner.js b/server/methods/addRoomOwner.js index 1d14ee835ff6..b43e0442b746 100644 --- a/server/methods/addRoomOwner.js +++ b/server/methods/addRoomOwner.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ addRoomOwner(rid, userId) { check(rid, String); diff --git a/server/methods/createDirectMessage.js b/server/methods/createDirectMessage.js index 884bf5cf737e..2faa73d5fb34 100644 --- a/server/methods/createDirectMessage.js +++ b/server/methods/createDirectMessage.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ createDirectMessage(username) { check(username, String); diff --git a/server/methods/deleteUser.js b/server/methods/deleteUser.js index 8255c3da71a7..504e67e05f4e 100644 --- a/server/methods/deleteUser.js +++ b/server/methods/deleteUser.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ deleteUser(userId) { check(userId, String); diff --git a/server/stream/messages.js b/server/stream/messages.js index 49cf5b1c4d14..d81aa0c68d81 100644 --- a/server/stream/messages.js +++ b/server/stream/messages.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + const msgStream = new Meteor.Streamer('room-messages'); this.msgStream = msgStream; diff --git a/server/stream/streamBroadcast.js b/server/stream/streamBroadcast.js index 4a7dc876a5ef..9ef9df178941 100644 --- a/server/stream/streamBroadcast.js +++ b/server/stream/streamBroadcast.js @@ -1,5 +1,6 @@ /* global InstanceStatus, DDP, LoggerManager */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import { DDPCommon } from 'meteor/ddp-common'; diff --git a/tests/data/checks.js b/tests/data/checks.js index c3080d79eb7c..f546dca78a29 100644 --- a/tests/data/checks.js +++ b/tests/data/checks.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import loginPage from '../pageobjects/login.page'; import mainContent from '../pageobjects/main-content.page'; import sideNav from '../pageobjects/side-nav.page'; diff --git a/tests/end-to-end/ui/00-login.js b/tests/end-to-end/ui/00-login.js index 77484dcc6e16..588a9a2f948c 100644 --- a/tests/end-to-end/ui/00-login.js +++ b/tests/end-to-end/ui/00-login.js @@ -1,5 +1,6 @@ /* eslint-env mocha */ +import { Meteor } from 'meteor/meteor'; import loginPage from '../../pageobjects/login.page'; import setupWizard from '../../pageobjects/setup-wizard.page'; diff --git a/tests/end-to-end/ui/14-message-popup.js b/tests/end-to-end/ui/14-message-popup.js index f56d893dd078..53ba21a2d7ee 100644 --- a/tests/end-to-end/ui/14-message-popup.js +++ b/tests/end-to-end/ui/14-message-popup.js @@ -1,5 +1,6 @@ /* eslint-env mocha */ +import { Meteor } from 'meteor/meteor'; import { adminEmail, adminPassword } from '../../data/user.js'; import { diff --git a/tests/pageobjects/setup-wizard.page.js b/tests/pageobjects/setup-wizard.page.js index d037d138a45e..05fe8377eedd 100644 --- a/tests/pageobjects/setup-wizard.page.js +++ b/tests/pageobjects/setup-wizard.page.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import Page from './Page'; import { adminEmail, adminPassword } from '../data/user'; From 51095cb2da5f5aad12d57bd0a36e6b136c78efb3 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Fri, 19 Oct 2018 09:35:04 -0300 Subject: [PATCH 02/34] Second wave of removal of Meteor global --- packages/rocketchat-autotranslate/server/settings.js | 2 ++ packages/rocketchat-bot-helpers/server/settings.js | 2 ++ packages/rocketchat-cas/client/cas_client.js | 2 ++ packages/rocketchat-cas/server/cas_rocketchat.js | 2 ++ .../client/lib/startup.js | 2 ++ .../client/views/mailMessagesInstructions.js | 1 + .../server/lib/startup.js | 2 ++ .../client/startup/messageTypes.js | 1 + .../rocketchat-channel-settings/client/startup/tabBar.js | 2 ++ .../client/startup/trackSettingsChange.js | 2 ++ .../client/views/channelSettings.js | 1 + .../server/functions/saveReactWhenReadOnly.js | 2 ++ .../server/functions/saveRoomAnnouncement.js | 2 ++ .../server/functions/saveRoomCustomFields.js | 2 ++ .../server/functions/saveRoomDescription.js | 2 ++ .../server/functions/saveRoomName.js | 1 + .../server/functions/saveRoomReadOnly.js | 2 ++ .../server/functions/saveRoomSystemMessages.js | 2 ++ .../server/functions/saveRoomTopic.js | 2 ++ .../server/functions/saveRoomType.js | 1 + packages/rocketchat-channel-settings/server/startup.js | 2 ++ packages/rocketchat-cors/common.js | 2 ++ packages/rocketchat-cors/cors.js | 1 + packages/rocketchat-crowd/client/loginHelper.js | 2 ++ packages/rocketchat-crowd/server/settings.js | 2 ++ .../client/custom_oauth_client.js | 1 + .../server/custom_oauth_server.js | 1 + packages/rocketchat-custom-sounds/client/admin/route.js | 2 ++ .../rocketchat-custom-sounds/client/admin/soundEdit.js | 1 + .../rocketchat-custom-sounds/client/admin/soundInfo.js | 2 ++ .../rocketchat-custom-sounds/client/lib/CustomSounds.js | 1 + .../client/notifications/deleteCustomSound.js | 2 ++ .../client/notifications/updateCustomSound.js | 2 ++ .../server/methods/deleteCustomSound.js | 2 ++ .../server/methods/insertOrUpdateSound.js | 1 + .../server/methods/listCustomSounds.js | 2 ++ .../server/methods/uploadCustomSound.js | 2 ++ .../server/publications/customSounds.js | 1 + .../server/startup/custom-sounds.js | 1 + .../server/startup/permissions.js | 2 ++ packages/rocketchat-dolphin/common.js | 1 + packages/rocketchat-drupal/common.js | 1 + packages/rocketchat-emoji-custom/admin/emojiEdit.js | 1 + packages/rocketchat-emoji-custom/admin/emojiInfo.js | 2 ++ packages/rocketchat-emoji-custom/admin/route.js | 2 ++ .../client/notifications/deleteEmojiCustom.js | 2 ++ .../server/methods/deleteEmojiCustom.js | 2 ++ .../server/methods/insertOrUpdateEmoji.js | 1 + .../server/methods/listEmojiCustom.js | 2 ++ .../server/methods/uploadEmojiCustom.js | 2 ++ .../server/publications/fullEmojiData.js | 1 + .../server/startup/emoji-custom.js | 1 + packages/rocketchat-emoji-emojione/rocketchat.js | 2 ++ packages/rocketchat-emoji-emojione/server/callbacks.js | 2 ++ packages/rocketchat-emoji/client/emojiButton.js | 2 ++ packages/rocketchat-emoji/client/emojiParser.js | 1 + packages/rocketchat-emoji/client/keyboardFix.js | 1 + .../server/lib/RocketChat.ErrorHandler.js | 2 ++ .../client/lib/fileUploadHandler.js | 1 + .../rocketchat-file-upload/globalFileRestrictions.js | 1 + packages/rocketchat-file-upload/lib/FileUpload.js | 1 + packages/rocketchat-file-upload/lib/FileUploadBase.js | 1 + .../rocketchat-file-upload/server/config/FileSystem.js | 1 + packages/rocketchat-file-upload/server/lib/FileUpload.js | 1 + packages/rocketchat-file-upload/server/lib/proxy.js | 1 + packages/rocketchat-file-upload/server/lib/requests.js | 2 ++ .../server/methods/getS3FileUrl.js | 1 + packages/rocketchat-github-enterprise/common.js | 1 + packages/rocketchat-gitlab/common.js | 2 ++ .../rocketchat-google-natural-language/server/index.js | 1 + .../server/settings.js | 2 ++ packages/rocketchat-google-vision/client/googlevision.js | 2 ++ packages/rocketchat-google-vision/server/googlevision.js | 2 ++ packages/rocketchat-google-vision/server/settings.js | 2 ++ packages/rocketchat-grant/server/index.js | 1 + .../server/resolvers/users/User-type.js | 1 + packages/rocketchat-highlight-words/client/client.js | 1 + packages/rocketchat-iframe-login/iframe_rocketchat.js | 2 ++ packages/rocketchat-iframe-login/iframe_server.js | 1 + .../rocketchat-importer-slack-users/server/importer.js | 1 + .../client/ImporterWebsocketReceiver.js | 2 ++ packages/rocketchat-importer/client/admin/adminImport.js | 1 + .../client/admin/adminImportProgress.js | 1 + .../rocketchat-importer/server/classes/ImporterBase.js | 1 + .../server/classes/ImporterWebsocket.js | 2 ++ .../server/methods/getImportProgress.js | 1 + .../server/methods/getSelectionData.js | 1 + .../rocketchat-importer/server/methods/prepareImport.js | 1 + .../server/startup/setImportsToInvalid.js | 1 + packages/rocketchat-integrations/client/route.js | 2 ++ .../client/views/integrationsIncoming.js | 1 + .../client/views/integrationsOutgoingHistory.js | 1 + .../rocketchat-integrations/server/lib/triggerHandler.js | 1 + .../server/methods/clearIntegrationHistory.js | 2 ++ .../server/methods/incoming/deleteIncomingIntegration.js | 2 ++ .../server/methods/outgoing/addOutgoingIntegration.js | 2 ++ .../server/methods/outgoing/deleteOutgoingIntegration.js | 2 ++ .../server/methods/outgoing/replayOutgoingIntegration.js | 2 ++ .../server/methods/outgoing/updateOutgoingIntegration.js | 2 ++ .../server/models/IntegrationHistory.js | 2 ++ .../server/models/Integrations.js | 2 ++ .../server/processWebhookMessage.js | 1 + .../server/publications/integrationHistory.js | 2 ++ .../server/publications/integrations.js | 2 ++ .../server/irc-bridge/localHandlers/onCreateUser.js | 2 ++ .../server/irc-bridge/localHandlers/onLogin.js | 2 ++ .../server/irc-bridge/peerHandlers/disconnected.js | 2 ++ .../server/irc-bridge/peerHandlers/userRegistered.js | 2 ++ packages/rocketchat-irc/server/irc-settings.js | 2 ++ packages/rocketchat-irc/server/irc.js | 1 + packages/rocketchat-katex/katex.js | 1 + packages/rocketchat-katex/settings.js | 2 ++ packages/rocketchat-ldap/client/loginHelper.js | 2 ++ packages/rocketchat-ldap/server/ldap.js | 1 + packages/rocketchat-ldap/server/loginHandler.js | 1 + packages/rocketchat-ldap/server/syncUsers.js | 1 + packages/rocketchat-lib/client/CustomTranslations.js | 2 ++ packages/rocketchat-lib/client/lib/ChannelActions.js | 1 + packages/rocketchat-lib/client/lib/LoginPresence.js | 2 ++ packages/rocketchat-lib/client/lib/callMethod.js | 2 ++ packages/rocketchat-lib/client/lib/formatDate.js | 1 + packages/rocketchat-lib/client/lib/openRoom.js | 1 + packages/rocketchat-lib/client/lib/settings.js | 1 + packages/rocketchat-lib/client/lib/startup/commands.js | 2 ++ packages/rocketchat-lib/client/lib/userRoles.js | 1 + packages/rocketchat-lib/client/methods/sendMessage.js | 1 + packages/rocketchat-lib/lib/MessageTypes.js | 2 ++ packages/rocketchat-lib/lib/RoomTypesCommon.js | 1 + packages/rocketchat-lib/lib/callbacks.js | 1 + packages/rocketchat-lib/lib/getURL.js | 1 + packages/rocketchat-lib/lib/getValidRoomName.js | 1 + packages/rocketchat-lib/lib/promises.js | 1 + packages/rocketchat-lib/lib/roomTypes/conversation.js | 1 + packages/rocketchat-lib/lib/roomTypes/direct.js | 1 + packages/rocketchat-lib/lib/roomTypes/favorite.js | 1 + packages/rocketchat-lib/lib/roomTypes/private.js | 1 + packages/rocketchat-lib/lib/roomTypes/public.js | 1 + packages/rocketchat-lib/lib/roomTypes/unread.js | 1 + .../rocketchat-lib/lib/startup/settingsOnLoadSiteUrl.js | 2 ++ packages/rocketchat-lib/lib/templateVarHandler.js | 2 ++ .../rocketchat-lib/server/functions/Notifications.js | 2 ++ .../rocketchat-lib/server/functions/addUserToRoom.js | 2 ++ packages/rocketchat-lib/server/functions/archiveRoom.js | 2 ++ .../server/functions/checkEmailAvailability.js | 1 + .../server/functions/checkUsernameAvailability.js | 1 + packages/rocketchat-lib/server/functions/createRoom.js | 1 + .../rocketchat-lib/server/functions/deleteMessage.js | 2 ++ packages/rocketchat-lib/server/functions/deleteUser.js | 2 ++ .../functions/getRoomByNameOrIdWithOptionToJoin.js | 1 + .../server/functions/notifications/email.js | 1 + .../server/functions/notifications/index.js | 1 + .../server/functions/notifications/mobile.js | 2 ++ .../server/functions/removeUserFromRoom.js | 2 ++ .../functions/saveCustomFieldsWithoutValidation.js | 1 + packages/rocketchat-lib/server/functions/sendMessage.js | 2 ++ packages/rocketchat-lib/server/functions/setEmail.js | 1 + packages/rocketchat-lib/server/functions/setRealName.js | 1 + .../rocketchat-lib/server/functions/setUserAvatar.js | 2 ++ packages/rocketchat-lib/server/functions/settings.js | 1 + .../rocketchat-lib/server/functions/updateMessage.js | 2 ++ .../server/functions/validateCustomFields.js | 1 + .../rocketchat-lib/server/lib/PasswordPolicyClass.js | 2 ++ packages/rocketchat-lib/server/lib/RateLimiter.js | 1 + packages/rocketchat-lib/server/lib/bugsnag.js | 1 + packages/rocketchat-lib/server/lib/configLogger.js | 2 ++ packages/rocketchat-lib/server/lib/debug.js | 1 + .../server/lib/loginErrorMessageOverride.js | 2 ++ packages/rocketchat-lib/server/lib/metrics.js | 1 + packages/rocketchat-lib/server/lib/processDirectEmail.js | 1 + .../rocketchat-lib/server/methods/addOAuthService.js | 1 + packages/rocketchat-lib/server/methods/blockUser.js | 2 ++ packages/rocketchat-lib/tests/server.mocks.js | 9 +++++++++ packages/rocketchat-lib/tests/server.tests.js | 1 + 173 files changed, 266 insertions(+) create mode 100644 packages/rocketchat-lib/tests/server.mocks.js diff --git a/packages/rocketchat-autotranslate/server/settings.js b/packages/rocketchat-autotranslate/server/settings.js index 4eccb5f825a7..9df71181d992 100644 --- a/packages/rocketchat-autotranslate/server/settings.js +++ b/packages/rocketchat-autotranslate/server/settings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.settings.add('AutoTranslate_Enabled', false, { type: 'boolean', group: 'Message', section: 'AutoTranslate', public: true }); RocketChat.settings.add('AutoTranslate_GoogleAPIKey', '', { type: 'string', group: 'Message', section: 'AutoTranslate', enableQuery: { _id: 'AutoTranslate_Enabled', value: true } }); diff --git a/packages/rocketchat-bot-helpers/server/settings.js b/packages/rocketchat-bot-helpers/server/settings.js index c14f62286233..6a0da897bea6 100644 --- a/packages/rocketchat-bot-helpers/server/settings.js +++ b/packages/rocketchat-bot-helpers/server/settings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.settings.addGroup('Bots', function() { this.add('BotHelpers_userFields', '_id, name, username, emails, language, utcOffset', { diff --git a/packages/rocketchat-cas/client/cas_client.js b/packages/rocketchat-cas/client/cas_client.js index b56d594e806a..280e89380d8c 100644 --- a/packages/rocketchat-cas/client/cas_client.js +++ b/packages/rocketchat-cas/client/cas_client.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + const openCenteredPopup = function(url, width, height) { const screenX = typeof window.screenX !== 'undefined' ? window.screenX : window.screenLeft; diff --git a/packages/rocketchat-cas/server/cas_rocketchat.js b/packages/rocketchat-cas/server/cas_rocketchat.js index f8f6e4b0520f..a91d89b6bdc9 100644 --- a/packages/rocketchat-cas/server/cas_rocketchat.js +++ b/packages/rocketchat-cas/server/cas_rocketchat.js @@ -1,5 +1,7 @@ /* globals logger:true */ +import { Meteor } from 'meteor/meteor'; + logger = new Logger('CAS', {}); Meteor.startup(function() { diff --git a/packages/rocketchat-channel-settings-mail-messages/client/lib/startup.js b/packages/rocketchat-channel-settings-mail-messages/client/lib/startup.js index 7f83b2a6de9c..a1308a4aefe1 100644 --- a/packages/rocketchat-channel-settings-mail-messages/client/lib/startup.js +++ b/packages/rocketchat-channel-settings-mail-messages/client/lib/startup.js @@ -1,4 +1,6 @@ // import resetSelection from '../resetSelection'; +import { Meteor } from 'meteor/meteor'; + Meteor.startup(() => { RocketChat.TabBar.addButton({ groups: ['channel', 'group', 'direct'], diff --git a/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js b/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js index 3fd4e2a39ded..18c5e5d45b6b 100644 --- a/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js +++ b/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js @@ -1,4 +1,5 @@ /* global AutoComplete Deps */ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; import resetSelection from '../resetSelection'; diff --git a/packages/rocketchat-channel-settings-mail-messages/server/lib/startup.js b/packages/rocketchat-channel-settings-mail-messages/server/lib/startup.js index ae2edc7c6ee1..cd30fd18c0d1 100644 --- a/packages/rocketchat-channel-settings-mail-messages/server/lib/startup.js +++ b/packages/rocketchat-channel-settings-mail-messages/server/lib/startup.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { const permission = { _id: 'mail-messages', diff --git a/packages/rocketchat-channel-settings/client/startup/messageTypes.js b/packages/rocketchat-channel-settings/client/startup/messageTypes.js index 357adb2abc85..89705ce0f2f9 100644 --- a/packages/rocketchat-channel-settings/client/startup/messageTypes.js +++ b/packages/rocketchat-channel-settings/client/startup/messageTypes.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; Meteor.startup(function() { diff --git a/packages/rocketchat-channel-settings/client/startup/tabBar.js b/packages/rocketchat-channel-settings/client/startup/tabBar.js index ba3038584f52..1066d10b06e2 100644 --- a/packages/rocketchat-channel-settings/client/startup/tabBar.js +++ b/packages/rocketchat-channel-settings/client/startup/tabBar.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(() => { RocketChat.TabBar.addButton({ groups: ['channel', 'group', 'direct'], diff --git a/packages/rocketchat-channel-settings/client/startup/trackSettingsChange.js b/packages/rocketchat-channel-settings/client/startup/trackSettingsChange.js index 8df8addd789f..ad493f1f3867 100644 --- a/packages/rocketchat-channel-settings/client/startup/trackSettingsChange.js +++ b/packages/rocketchat-channel-settings/client/startup/trackSettingsChange.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { const roomSettingsChangedCallback = (msg) => { Tracker.nonreactive(() => { diff --git a/packages/rocketchat-channel-settings/client/views/channelSettings.js b/packages/rocketchat-channel-settings/client/views/channelSettings.js index b12fb98e067d..2ad8e92be0c5 100644 --- a/packages/rocketchat-channel-settings/client/views/channelSettings.js +++ b/packages/rocketchat-channel-settings/client/views/channelSettings.js @@ -1,4 +1,5 @@ /* globals popover */ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; import moment from 'moment'; import s from 'underscore.string'; diff --git a/packages/rocketchat-channel-settings/server/functions/saveReactWhenReadOnly.js b/packages/rocketchat-channel-settings/server/functions/saveReactWhenReadOnly.js index 61cf8128df04..9ca9cea84cae 100644 --- a/packages/rocketchat-channel-settings/server/functions/saveReactWhenReadOnly.js +++ b/packages/rocketchat-channel-settings/server/functions/saveReactWhenReadOnly.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.saveReactWhenReadOnly = function(rid, allowReact) { if (!Match.test(rid, String)) { throw new Meteor.Error('invalid-room', 'Invalid room', { function: 'RocketChat.saveReactWhenReadOnly' }); diff --git a/packages/rocketchat-channel-settings/server/functions/saveRoomAnnouncement.js b/packages/rocketchat-channel-settings/server/functions/saveRoomAnnouncement.js index eb48b2f680b5..6335d845a0de 100644 --- a/packages/rocketchat-channel-settings/server/functions/saveRoomAnnouncement.js +++ b/packages/rocketchat-channel-settings/server/functions/saveRoomAnnouncement.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.saveRoomAnnouncement = function(rid, roomAnnouncement, user, sendMessage = true) { if (!Match.test(rid, String)) { throw new Meteor.Error('invalid-room', 'Invalid room', { function: 'RocketChat.saveRoomAnnouncement' }); diff --git a/packages/rocketchat-channel-settings/server/functions/saveRoomCustomFields.js b/packages/rocketchat-channel-settings/server/functions/saveRoomCustomFields.js index f5d20696c0ff..a29474ad1e7d 100644 --- a/packages/rocketchat-channel-settings/server/functions/saveRoomCustomFields.js +++ b/packages/rocketchat-channel-settings/server/functions/saveRoomCustomFields.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.saveRoomCustomFields = function(rid, roomCustomFields) { if (!Match.test(rid, String)) { throw new Meteor.Error('invalid-room', 'Invalid room', { diff --git a/packages/rocketchat-channel-settings/server/functions/saveRoomDescription.js b/packages/rocketchat-channel-settings/server/functions/saveRoomDescription.js index f266ea90a34b..8ae6a4776505 100644 --- a/packages/rocketchat-channel-settings/server/functions/saveRoomDescription.js +++ b/packages/rocketchat-channel-settings/server/functions/saveRoomDescription.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.saveRoomDescription = function(rid, roomDescription, user) { if (!Match.test(rid, String)) { throw new Meteor.Error('invalid-room', 'Invalid room', { diff --git a/packages/rocketchat-channel-settings/server/functions/saveRoomName.js b/packages/rocketchat-channel-settings/server/functions/saveRoomName.js index 925354cbe2e4..bae9ba5637fe 100644 --- a/packages/rocketchat-channel-settings/server/functions/saveRoomName.js +++ b/packages/rocketchat-channel-settings/server/functions/saveRoomName.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; RocketChat.saveRoomName = function(rid, displayName, user, sendMessage = true) { const room = RocketChat.models.Rooms.findOneById(rid); diff --git a/packages/rocketchat-channel-settings/server/functions/saveRoomReadOnly.js b/packages/rocketchat-channel-settings/server/functions/saveRoomReadOnly.js index 7c377e9b5865..ccecee598ddf 100644 --- a/packages/rocketchat-channel-settings/server/functions/saveRoomReadOnly.js +++ b/packages/rocketchat-channel-settings/server/functions/saveRoomReadOnly.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.saveRoomReadOnly = function(rid, readOnly) { if (!Match.test(rid, String)) { throw new Meteor.Error('invalid-room', 'Invalid room', { diff --git a/packages/rocketchat-channel-settings/server/functions/saveRoomSystemMessages.js b/packages/rocketchat-channel-settings/server/functions/saveRoomSystemMessages.js index 74ebe7b46e56..aa0b5597c405 100644 --- a/packages/rocketchat-channel-settings/server/functions/saveRoomSystemMessages.js +++ b/packages/rocketchat-channel-settings/server/functions/saveRoomSystemMessages.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.saveRoomSystemMessages = function(rid, systemMessages) { if (!Match.test(rid, String)) { throw new Meteor.Error('invalid-room', 'Invalid room', { diff --git a/packages/rocketchat-channel-settings/server/functions/saveRoomTopic.js b/packages/rocketchat-channel-settings/server/functions/saveRoomTopic.js index 39e61c6c4063..431156a10fa8 100644 --- a/packages/rocketchat-channel-settings/server/functions/saveRoomTopic.js +++ b/packages/rocketchat-channel-settings/server/functions/saveRoomTopic.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.saveRoomTopic = function(rid, roomTopic, user, sendMessage = true) { if (!Match.test(rid, String)) { throw new Meteor.Error('invalid-room', 'Invalid room', { diff --git a/packages/rocketchat-channel-settings/server/functions/saveRoomType.js b/packages/rocketchat-channel-settings/server/functions/saveRoomType.js index a4319609dbd6..6a35ba6b2d81 100644 --- a/packages/rocketchat-channel-settings/server/functions/saveRoomType.js +++ b/packages/rocketchat-channel-settings/server/functions/saveRoomType.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; RocketChat.saveRoomType = function(rid, roomType, user, sendMessage = true) { if (!Match.test(rid, String)) { diff --git a/packages/rocketchat-channel-settings/server/startup.js b/packages/rocketchat-channel-settings/server/startup.js index 39a5ccc15933..36493ac35ef6 100644 --- a/packages/rocketchat-channel-settings/server/startup.js +++ b/packages/rocketchat-channel-settings/server/startup.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.models.Permissions.upsert('post-readonly', { $setOnInsert: { roles: ['admin', 'owner', 'moderator'] } }); RocketChat.models.Permissions.upsert('set-readonly', { $setOnInsert: { roles: ['admin', 'owner'] } }); diff --git a/packages/rocketchat-cors/common.js b/packages/rocketchat-cors/common.js index 3c90f3d1896c..8a14708cbf92 100644 --- a/packages/rocketchat-cors/common.js +++ b/packages/rocketchat-cors/common.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.settings.onload('Force_SSL', function(key, value) { Meteor.absoluteUrl.defaultOptions.secure = value; diff --git a/packages/rocketchat-cors/cors.js b/packages/rocketchat-cors/cors.js index 33bfeaed1060..fb9c25d5e8ee 100644 --- a/packages/rocketchat-cors/cors.js +++ b/packages/rocketchat-cors/cors.js @@ -1,4 +1,5 @@ /* globals WebAppInternals */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import url from 'url'; diff --git a/packages/rocketchat-crowd/client/loginHelper.js b/packages/rocketchat-crowd/client/loginHelper.js index 3767f50ccd4f..e8a87e38aec3 100644 --- a/packages/rocketchat-crowd/client/loginHelper.js +++ b/packages/rocketchat-crowd/client/loginHelper.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.loginWithCrowd = function(...args) { // Pull username and password const username = args.shift(); diff --git a/packages/rocketchat-crowd/server/settings.js b/packages/rocketchat-crowd/server/settings.js index 7cf9aaa33904..14330f806575 100644 --- a/packages/rocketchat-crowd/server/settings.js +++ b/packages/rocketchat-crowd/server/settings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.settings.addGroup('AtlassianCrowd', function() { const enableQuery = { _id: 'CROWD_Enable', value: true }; diff --git a/packages/rocketchat-custom-oauth/client/custom_oauth_client.js b/packages/rocketchat-custom-oauth/client/custom_oauth_client.js index 2f2a506b8f25..2338ae86e7d7 100644 --- a/packages/rocketchat-custom-oauth/client/custom_oauth_client.js +++ b/packages/rocketchat-custom-oauth/client/custom_oauth_client.js @@ -1,4 +1,5 @@ /* globals OAuth*/ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; // Request custom OAuth credentials for the user diff --git a/packages/rocketchat-custom-oauth/server/custom_oauth_server.js b/packages/rocketchat-custom-oauth/server/custom_oauth_server.js index 416f87128adc..0c96ca95be68 100644 --- a/packages/rocketchat-custom-oauth/server/custom_oauth_server.js +++ b/packages/rocketchat-custom-oauth/server/custom_oauth_server.js @@ -1,4 +1,5 @@ /* globals OAuth*/ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; const logger = new Logger('CustomOAuth'); diff --git a/packages/rocketchat-custom-sounds/client/admin/route.js b/packages/rocketchat-custom-sounds/client/admin/route.js index da8f9214515c..1ddd3fbee27f 100644 --- a/packages/rocketchat-custom-sounds/client/admin/route.js +++ b/packages/rocketchat-custom-sounds/client/admin/route.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + FlowRouter.route('/admin/custom-sounds', { name: 'custom-sounds', subscriptions(/* params, queryParams*/) { diff --git a/packages/rocketchat-custom-sounds/client/admin/soundEdit.js b/packages/rocketchat-custom-sounds/client/admin/soundEdit.js index adfad401baf8..db8306f9b4ae 100644 --- a/packages/rocketchat-custom-sounds/client/admin/soundEdit.js +++ b/packages/rocketchat-custom-sounds/client/admin/soundEdit.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; import s from 'underscore.string'; diff --git a/packages/rocketchat-custom-sounds/client/admin/soundInfo.js b/packages/rocketchat-custom-sounds/client/admin/soundInfo.js index ca40311d815b..30dbf18f4588 100644 --- a/packages/rocketchat-custom-sounds/client/admin/soundInfo.js +++ b/packages/rocketchat-custom-sounds/client/admin/soundInfo.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Template.soundInfo.helpers({ name() { const sound = Template.instance().sound.get(); diff --git a/packages/rocketchat-custom-sounds/client/lib/CustomSounds.js b/packages/rocketchat-custom-sounds/client/lib/CustomSounds.js index 4bce88b54dc9..eb2ba40fe74d 100644 --- a/packages/rocketchat-custom-sounds/client/lib/CustomSounds.js +++ b/packages/rocketchat-custom-sounds/client/lib/CustomSounds.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; class CustomSounds { diff --git a/packages/rocketchat-custom-sounds/client/notifications/deleteCustomSound.js b/packages/rocketchat-custom-sounds/client/notifications/deleteCustomSound.js index 2ba76233e4f4..7ddde5d45c1b 100644 --- a/packages/rocketchat-custom-sounds/client/notifications/deleteCustomSound.js +++ b/packages/rocketchat-custom-sounds/client/notifications/deleteCustomSound.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(() => RocketChat.CachedCollectionManager.onLogin(() => RocketChat.Notifications.onAll('deleteCustomSound', (data) => RocketChat.CustomSounds.remove(data.soundData)) diff --git a/packages/rocketchat-custom-sounds/client/notifications/updateCustomSound.js b/packages/rocketchat-custom-sounds/client/notifications/updateCustomSound.js index ef1252b658e6..75a65b6cbdeb 100644 --- a/packages/rocketchat-custom-sounds/client/notifications/updateCustomSound.js +++ b/packages/rocketchat-custom-sounds/client/notifications/updateCustomSound.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(() => RocketChat.CachedCollectionManager.onLogin(() => RocketChat.Notifications.onAll('updateCustomSound', (data) => RocketChat.CustomSounds.update(data.soundData)) diff --git a/packages/rocketchat-custom-sounds/server/methods/deleteCustomSound.js b/packages/rocketchat-custom-sounds/server/methods/deleteCustomSound.js index f9fca4fcafca..b6aba7a7b17f 100644 --- a/packages/rocketchat-custom-sounds/server/methods/deleteCustomSound.js +++ b/packages/rocketchat-custom-sounds/server/methods/deleteCustomSound.js @@ -1,4 +1,6 @@ /* globals RocketChatFileCustomSoundsInstance */ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ deleteCustomSound(_id) { let sound = null; diff --git a/packages/rocketchat-custom-sounds/server/methods/insertOrUpdateSound.js b/packages/rocketchat-custom-sounds/server/methods/insertOrUpdateSound.js index 1bd3e4c618af..e5b91e95d6e2 100644 --- a/packages/rocketchat-custom-sounds/server/methods/insertOrUpdateSound.js +++ b/packages/rocketchat-custom-sounds/server/methods/insertOrUpdateSound.js @@ -1,4 +1,5 @@ /* globals RocketChatFileCustomSoundsInstance */ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; Meteor.methods({ diff --git a/packages/rocketchat-custom-sounds/server/methods/listCustomSounds.js b/packages/rocketchat-custom-sounds/server/methods/listCustomSounds.js index f1b721301b65..9aeb28d8b45f 100644 --- a/packages/rocketchat-custom-sounds/server/methods/listCustomSounds.js +++ b/packages/rocketchat-custom-sounds/server/methods/listCustomSounds.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ listCustomSounds() { return RocketChat.models.CustomSounds.find({}).fetch(); diff --git a/packages/rocketchat-custom-sounds/server/methods/uploadCustomSound.js b/packages/rocketchat-custom-sounds/server/methods/uploadCustomSound.js index 4e265740821a..2c530c383f8c 100644 --- a/packages/rocketchat-custom-sounds/server/methods/uploadCustomSound.js +++ b/packages/rocketchat-custom-sounds/server/methods/uploadCustomSound.js @@ -1,4 +1,6 @@ /* globals RocketChatFileCustomSoundsInstance */ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ uploadCustomSound(binaryContent, contentType, soundData) { if (!RocketChat.authz.hasPermission(this.userId, 'manage-sounds')) { diff --git a/packages/rocketchat-custom-sounds/server/publications/customSounds.js b/packages/rocketchat-custom-sounds/server/publications/customSounds.js index 6ab9afaedfdd..b474e416ebb9 100644 --- a/packages/rocketchat-custom-sounds/server/publications/customSounds.js +++ b/packages/rocketchat-custom-sounds/server/publications/customSounds.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; Meteor.publish('customSounds', function(filter, limit) { diff --git a/packages/rocketchat-custom-sounds/server/startup/custom-sounds.js b/packages/rocketchat-custom-sounds/server/startup/custom-sounds.js index 33cbc7d3b84c..308f1536e636 100644 --- a/packages/rocketchat-custom-sounds/server/startup/custom-sounds.js +++ b/packages/rocketchat-custom-sounds/server/startup/custom-sounds.js @@ -1,4 +1,5 @@ /* globals RocketChatFileCustomSoundsInstance */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.startup(function() { diff --git a/packages/rocketchat-custom-sounds/server/startup/permissions.js b/packages/rocketchat-custom-sounds/server/startup/permissions.js index c86644103c97..0b947797c09c 100644 --- a/packages/rocketchat-custom-sounds/server/startup/permissions.js +++ b/packages/rocketchat-custom-sounds/server/startup/permissions.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(() => { if (RocketChat.models && RocketChat.models.Permissions) { RocketChat.models.Permissions.createOrUpdate('manage-sounds', ['admin']); diff --git a/packages/rocketchat-dolphin/common.js b/packages/rocketchat-dolphin/common.js index 28426895cfbe..2500b703937c 100644 --- a/packages/rocketchat-dolphin/common.js +++ b/packages/rocketchat-dolphin/common.js @@ -1,5 +1,6 @@ // Dolphin OAuth2 /* globals CustomOAuth */ +import { Meteor } from 'meteor/meteor'; const config = { serverURL: '', diff --git a/packages/rocketchat-drupal/common.js b/packages/rocketchat-drupal/common.js index 338854cd2a32..1aac96edf577 100644 --- a/packages/rocketchat-drupal/common.js +++ b/packages/rocketchat-drupal/common.js @@ -1,4 +1,5 @@ /* global CustomOAuth */ +import { Meteor } from 'meteor/meteor'; // Drupal Server CallBack URL needs to be http(s)://{rocketchat.server}[:port]/_oauth/drupal // In RocketChat -> Administration the URL needs to be http(s)://{drupal.server}/ diff --git a/packages/rocketchat-emoji-custom/admin/emojiEdit.js b/packages/rocketchat-emoji-custom/admin/emojiEdit.js index b6b12d5701fe..aab3c6847a07 100644 --- a/packages/rocketchat-emoji-custom/admin/emojiEdit.js +++ b/packages/rocketchat-emoji-custom/admin/emojiEdit.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; import s from 'underscore.string'; diff --git a/packages/rocketchat-emoji-custom/admin/emojiInfo.js b/packages/rocketchat-emoji-custom/admin/emojiInfo.js index 17ca686acfb1..0e19c436fea6 100644 --- a/packages/rocketchat-emoji-custom/admin/emojiInfo.js +++ b/packages/rocketchat-emoji-custom/admin/emojiInfo.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Template.emojiInfo.helpers({ name() { const emoji = Template.instance().emoji.get(); diff --git a/packages/rocketchat-emoji-custom/admin/route.js b/packages/rocketchat-emoji-custom/admin/route.js index b84f0afaec0e..15a89cc609b1 100644 --- a/packages/rocketchat-emoji-custom/admin/route.js +++ b/packages/rocketchat-emoji-custom/admin/route.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + FlowRouter.route('/admin/emoji-custom', { name: 'emoji-custom', subscriptions(/* params, queryParams*/) { diff --git a/packages/rocketchat-emoji-custom/client/notifications/deleteEmojiCustom.js b/packages/rocketchat-emoji-custom/client/notifications/deleteEmojiCustom.js index 7be855ba884f..d41d54ef7dee 100644 --- a/packages/rocketchat-emoji-custom/client/notifications/deleteEmojiCustom.js +++ b/packages/rocketchat-emoji-custom/client/notifications/deleteEmojiCustom.js @@ -1,4 +1,6 @@ /* globals deleteEmojiCustom */ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(() => RocketChat.Notifications.onLogged('deleteEmojiCustom', (data) => deleteEmojiCustom(data.emojiData)) ); diff --git a/packages/rocketchat-emoji-custom/server/methods/deleteEmojiCustom.js b/packages/rocketchat-emoji-custom/server/methods/deleteEmojiCustom.js index fa06e0a5e514..5c8d2c2d9298 100644 --- a/packages/rocketchat-emoji-custom/server/methods/deleteEmojiCustom.js +++ b/packages/rocketchat-emoji-custom/server/methods/deleteEmojiCustom.js @@ -1,4 +1,6 @@ /* globals RocketChatFileEmojiCustomInstance */ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ deleteEmojiCustom(emojiID) { let emoji = null; diff --git a/packages/rocketchat-emoji-custom/server/methods/insertOrUpdateEmoji.js b/packages/rocketchat-emoji-custom/server/methods/insertOrUpdateEmoji.js index aea09ed452df..64814530a593 100644 --- a/packages/rocketchat-emoji-custom/server/methods/insertOrUpdateEmoji.js +++ b/packages/rocketchat-emoji-custom/server/methods/insertOrUpdateEmoji.js @@ -1,4 +1,5 @@ /* globals RocketChatFileEmojiCustomInstance */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-emoji-custom/server/methods/listEmojiCustom.js b/packages/rocketchat-emoji-custom/server/methods/listEmojiCustom.js index 8eb0f7d61062..4217fe8adc29 100644 --- a/packages/rocketchat-emoji-custom/server/methods/listEmojiCustom.js +++ b/packages/rocketchat-emoji-custom/server/methods/listEmojiCustom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ listEmojiCustom() { return RocketChat.models.EmojiCustom.find({}).fetch(); diff --git a/packages/rocketchat-emoji-custom/server/methods/uploadEmojiCustom.js b/packages/rocketchat-emoji-custom/server/methods/uploadEmojiCustom.js index 84e8022a873f..dbdbecf7363c 100644 --- a/packages/rocketchat-emoji-custom/server/methods/uploadEmojiCustom.js +++ b/packages/rocketchat-emoji-custom/server/methods/uploadEmojiCustom.js @@ -1,4 +1,6 @@ /* globals RocketChatFileEmojiCustomInstance */ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ uploadEmojiCustom(binaryContent, contentType, emojiData) { if (!RocketChat.authz.hasPermission(this.userId, 'manage-emoji')) { diff --git a/packages/rocketchat-emoji-custom/server/publications/fullEmojiData.js b/packages/rocketchat-emoji-custom/server/publications/fullEmojiData.js index 4e8c658708cf..76b260ec5db8 100644 --- a/packages/rocketchat-emoji-custom/server/publications/fullEmojiData.js +++ b/packages/rocketchat-emoji-custom/server/publications/fullEmojiData.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; Meteor.publish('fullEmojiData', function(filter, limit) { diff --git a/packages/rocketchat-emoji-custom/server/startup/emoji-custom.js b/packages/rocketchat-emoji-custom/server/startup/emoji-custom.js index 96e46c5b0beb..ecff8cbc0da9 100644 --- a/packages/rocketchat-emoji-custom/server/startup/emoji-custom.js +++ b/packages/rocketchat-emoji-custom/server/startup/emoji-custom.js @@ -1,4 +1,5 @@ /* globals RocketChatFileEmojiCustomInstance */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.startup(function() { diff --git a/packages/rocketchat-emoji-emojione/rocketchat.js b/packages/rocketchat-emoji-emojione/rocketchat.js index caaf654b2495..6bc8b22fb634 100644 --- a/packages/rocketchat-emoji-emojione/rocketchat.js +++ b/packages/rocketchat-emoji-emojione/rocketchat.js @@ -1,4 +1,6 @@ /* globals emojione, emojisByCategory, emojiCategories, toneList */ +import { Meteor } from 'meteor/meteor'; + RocketChat.emoji.packages.emojione = emojione; RocketChat.emoji.packages.emojione.imageType = 'png'; RocketChat.emoji.packages.emojione.sprites = true; diff --git a/packages/rocketchat-emoji-emojione/server/callbacks.js b/packages/rocketchat-emoji-emojione/server/callbacks.js index f1da979ce068..fb9de727e019 100644 --- a/packages/rocketchat-emoji-emojione/server/callbacks.js +++ b/packages/rocketchat-emoji-emojione/server/callbacks.js @@ -1,4 +1,6 @@ /* globals emojione */ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.callbacks.add('beforeSendMessageNotifications', (message) => emojione.shortnameToUnicode(message)); }); diff --git a/packages/rocketchat-emoji/client/emojiButton.js b/packages/rocketchat-emoji/client/emojiButton.js index 7114155ea456..7b80b6263a95 100644 --- a/packages/rocketchat-emoji/client/emojiButton.js +++ b/packages/rocketchat-emoji/client/emojiButton.js @@ -1,4 +1,6 @@ /* globals Template chatMessages*/ +import { Meteor } from 'meteor/meteor'; + Template.messageBox.events({ 'click .emoji-picker-icon'(event) { event.stopPropagation(); diff --git a/packages/rocketchat-emoji/client/emojiParser.js b/packages/rocketchat-emoji/client/emojiParser.js index f3271ab14825..bf490d1219d2 100644 --- a/packages/rocketchat-emoji/client/emojiParser.js +++ b/packages/rocketchat-emoji/client/emojiParser.js @@ -1,4 +1,5 @@ /* globals isSetNotNull */ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; /* diff --git a/packages/rocketchat-emoji/client/keyboardFix.js b/packages/rocketchat-emoji/client/keyboardFix.js index 297887458074..a08e8bd61ac3 100644 --- a/packages/rocketchat-emoji/client/keyboardFix.js +++ b/packages/rocketchat-emoji/client/keyboardFix.js @@ -1,4 +1,5 @@ /* global device */ +import { Meteor } from 'meteor/meteor'; if (Meteor.isCordova) { window.addEventListener('native.keyboardshow', function() { diff --git a/packages/rocketchat-error-handler/server/lib/RocketChat.ErrorHandler.js b/packages/rocketchat-error-handler/server/lib/RocketChat.ErrorHandler.js index 4a8b611259e2..d6d5b5fb24c4 100644 --- a/packages/rocketchat-error-handler/server/lib/RocketChat.ErrorHandler.js +++ b/packages/rocketchat-error-handler/server/lib/RocketChat.ErrorHandler.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + class ErrorHandler { constructor() { this.reporting = false; diff --git a/packages/rocketchat-file-upload/client/lib/fileUploadHandler.js b/packages/rocketchat-file-upload/client/lib/fileUploadHandler.js index ef486e98ecc5..030f74731f98 100644 --- a/packages/rocketchat-file-upload/client/lib/fileUploadHandler.js +++ b/packages/rocketchat-file-upload/client/lib/fileUploadHandler.js @@ -1,5 +1,6 @@ /* globals FileUploadBase, UploadFS, fileUploadHandler:true */ /* exported fileUploadHandler */ +import { Meteor } from 'meteor/meteor'; new UploadFS.Store({ collection: RocketChat.models.Uploads.model, diff --git a/packages/rocketchat-file-upload/globalFileRestrictions.js b/packages/rocketchat-file-upload/globalFileRestrictions.js index 7eb6251d5b9d..8ecbe26e95ea 100644 --- a/packages/rocketchat-file-upload/globalFileRestrictions.js +++ b/packages/rocketchat-file-upload/globalFileRestrictions.js @@ -1,4 +1,5 @@ /* globals Slingshot */ +import { Meteor } from 'meteor/meteor'; import filesize from 'filesize'; diff --git a/packages/rocketchat-file-upload/lib/FileUpload.js b/packages/rocketchat-file-upload/lib/FileUpload.js index 3e504ef10afa..d2e03b1264a9 100644 --- a/packages/rocketchat-file-upload/lib/FileUpload.js +++ b/packages/rocketchat-file-upload/lib/FileUpload.js @@ -1,6 +1,7 @@ /* globals FileUpload:true */ /* exported FileUpload */ +import { Meteor } from 'meteor/meteor'; import filesize from 'filesize'; let maxFileSize = 0; diff --git a/packages/rocketchat-file-upload/lib/FileUploadBase.js b/packages/rocketchat-file-upload/lib/FileUploadBase.js index 0cce2656e884..b32747154e90 100644 --- a/packages/rocketchat-file-upload/lib/FileUploadBase.js +++ b/packages/rocketchat-file-upload/lib/FileUploadBase.js @@ -1,5 +1,6 @@ /* globals FileUploadBase:true, UploadFS */ /* exported FileUploadBase */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; UploadFS.config.defaultStorePermissions = new UploadFS.StorePermissions({ diff --git a/packages/rocketchat-file-upload/server/config/FileSystem.js b/packages/rocketchat-file-upload/server/config/FileSystem.js index 2fd7b21a62cf..d0e74e5f29d1 100644 --- a/packages/rocketchat-file-upload/server/config/FileSystem.js +++ b/packages/rocketchat-file-upload/server/config/FileSystem.js @@ -1,5 +1,6 @@ /* globals FileUpload, UploadFS */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import fs from 'fs'; import { FileUploadClass } from '../lib/FileUpload'; diff --git a/packages/rocketchat-file-upload/server/lib/FileUpload.js b/packages/rocketchat-file-upload/server/lib/FileUpload.js index a5e0ce2d3609..aa4f5ed1db16 100644 --- a/packages/rocketchat-file-upload/server/lib/FileUpload.js +++ b/packages/rocketchat-file-upload/server/lib/FileUpload.js @@ -1,5 +1,6 @@ /* globals UploadFS */ +import { Meteor } from 'meteor/meteor'; import fs from 'fs'; import stream from 'stream'; import mime from 'mime-type/with-db'; diff --git a/packages/rocketchat-file-upload/server/lib/proxy.js b/packages/rocketchat-file-upload/server/lib/proxy.js index b1f44b6a60c1..5f5090947132 100644 --- a/packages/rocketchat-file-upload/server/lib/proxy.js +++ b/packages/rocketchat-file-upload/server/lib/proxy.js @@ -1,5 +1,6 @@ /* globals UploadFS, InstanceStatus */ +import { Meteor } from 'meteor/meteor'; import http from 'http'; import URL from 'url'; diff --git a/packages/rocketchat-file-upload/server/lib/requests.js b/packages/rocketchat-file-upload/server/lib/requests.js index 7962e095351f..1324891569b6 100644 --- a/packages/rocketchat-file-upload/server/lib/requests.js +++ b/packages/rocketchat-file-upload/server/lib/requests.js @@ -1,5 +1,7 @@ /* globals FileUpload, WebApp */ +import { Meteor } from 'meteor/meteor'; + WebApp.connectHandlers.use('/file-upload/', function(req, res, next) { const match = /^\/([^\/]+)\/(.*)/.exec(req.url); diff --git a/packages/rocketchat-file-upload/server/methods/getS3FileUrl.js b/packages/rocketchat-file-upload/server/methods/getS3FileUrl.js index c4a1ca29a43f..86bd8b7fbc1f 100644 --- a/packages/rocketchat-file-upload/server/methods/getS3FileUrl.js +++ b/packages/rocketchat-file-upload/server/methods/getS3FileUrl.js @@ -1,4 +1,5 @@ /* globals UploadFS */ +import { Meteor } from 'meteor/meteor'; let protectedFiles; diff --git a/packages/rocketchat-github-enterprise/common.js b/packages/rocketchat-github-enterprise/common.js index 5a6d76d57514..3bdcf9977a85 100644 --- a/packages/rocketchat-github-enterprise/common.js +++ b/packages/rocketchat-github-enterprise/common.js @@ -1,4 +1,5 @@ /* global CustomOAuth */ +import { Meteor } from 'meteor/meteor'; // GitHub Enterprise Server CallBack URL needs to be http(s)://{rocketchat.server}[:port]/_oauth/github_enterprise // In RocketChat -> Administration the URL needs to be http(s)://{github.enterprise.server}/ diff --git a/packages/rocketchat-gitlab/common.js b/packages/rocketchat-gitlab/common.js index 880f0d534422..96a920952e6b 100644 --- a/packages/rocketchat-gitlab/common.js +++ b/packages/rocketchat-gitlab/common.js @@ -1,4 +1,6 @@ /* global CustomOAuth */ +import { Meteor } from 'meteor/meteor'; + const config = { serverURL: 'https://gitlab.com', identityPath: '/api/v3/user', diff --git a/packages/rocketchat-google-natural-language/server/index.js b/packages/rocketchat-google-natural-language/server/index.js index c02ec077f050..0a0d87275954 100644 --- a/packages/rocketchat-google-natural-language/server/index.js +++ b/packages/rocketchat-google-natural-language/server/index.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import './settings.js'; import './models/Rooms.js'; import googleLanguage from '@google-cloud/language'; diff --git a/packages/rocketchat-google-natural-language/server/settings.js b/packages/rocketchat-google-natural-language/server/settings.js index f68b07d6bbba..4412807890ad 100644 --- a/packages/rocketchat-google-natural-language/server/settings.js +++ b/packages/rocketchat-google-natural-language/server/settings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.settings.add('GoogleNaturalLanguage_Enabled', false, { type: 'boolean', diff --git a/packages/rocketchat-google-vision/client/googlevision.js b/packages/rocketchat-google-vision/client/googlevision.js index fb6793025379..16de6ceedc15 100644 --- a/packages/rocketchat-google-vision/client/googlevision.js +++ b/packages/rocketchat-google-vision/client/googlevision.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.GoogleVision = { getVisionAttributes(attachment) { const attributes = {}; diff --git a/packages/rocketchat-google-vision/server/googlevision.js b/packages/rocketchat-google-vision/server/googlevision.js index f2d32f989a1f..ec05eac45737 100644 --- a/packages/rocketchat-google-vision/server/googlevision.js +++ b/packages/rocketchat-google-vision/server/googlevision.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + class GoogleVision { constructor() { this.storage = require('@google-cloud/storage'); diff --git a/packages/rocketchat-google-vision/server/settings.js b/packages/rocketchat-google-vision/server/settings.js index bd99a39600a3..242ed9037773 100644 --- a/packages/rocketchat-google-vision/server/settings.js +++ b/packages/rocketchat-google-vision/server/settings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.settings.add('GoogleVision_Enable', false, { type: 'boolean', diff --git a/packages/rocketchat-grant/server/index.js b/packages/rocketchat-grant/server/index.js index c9143ede7595..8b07f8ece918 100644 --- a/packages/rocketchat-grant/server/index.js +++ b/packages/rocketchat-grant/server/index.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { WebApp } from 'meteor/webapp'; import session from 'express-session'; import Grant from 'grant-express'; diff --git a/packages/rocketchat-graphql/server/resolvers/users/User-type.js b/packages/rocketchat-graphql/server/resolvers/users/User-type.js index 2b56911e0dc3..ed35be4b3b31 100644 --- a/packages/rocketchat-graphql/server/resolvers/users/User-type.js +++ b/packages/rocketchat-graphql/server/resolvers/users/User-type.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { RocketChat } from 'meteor/rocketchat:lib'; import property from 'lodash.property'; diff --git a/packages/rocketchat-highlight-words/client/client.js b/packages/rocketchat-highlight-words/client/client.js index 6afd8938c453..16a466c8c8c0 100644 --- a/packages/rocketchat-highlight-words/client/client.js +++ b/packages/rocketchat-highlight-words/client/client.js @@ -2,6 +2,7 @@ * Highlights is a named function that will process Highlights * @param {Object} message - The message object */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-iframe-login/iframe_rocketchat.js b/packages/rocketchat-iframe-login/iframe_rocketchat.js index c11db9da0c32..f3012c29c32f 100644 --- a/packages/rocketchat-iframe-login/iframe_rocketchat.js +++ b/packages/rocketchat-iframe-login/iframe_rocketchat.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.settings.addGroup('Accounts', function() { this.section('Iframe', function() { diff --git a/packages/rocketchat-iframe-login/iframe_server.js b/packages/rocketchat-iframe-login/iframe_server.js index 1b1c49008ff6..683adb8f8585 100644 --- a/packages/rocketchat-iframe-login/iframe_server.js +++ b/packages/rocketchat-iframe-login/iframe_server.js @@ -1,4 +1,5 @@ /* globals Accounts, OAuth */ +import { Meteor } from 'meteor/meteor'; Accounts.registerLoginHandler('iframe', function(result) { if (!result.iframe) { diff --git a/packages/rocketchat-importer-slack-users/server/importer.js b/packages/rocketchat-importer-slack-users/server/importer.js index 1851792b7395..f6d0b7d5321f 100644 --- a/packages/rocketchat-importer-slack-users/server/importer.js +++ b/packages/rocketchat-importer-slack-users/server/importer.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { Base, ProgressStep, diff --git a/packages/rocketchat-importer/client/ImporterWebsocketReceiver.js b/packages/rocketchat-importer/client/ImporterWebsocketReceiver.js index 1e434902e9bd..97fb1d605b20 100644 --- a/packages/rocketchat-importer/client/ImporterWebsocketReceiver.js +++ b/packages/rocketchat-importer/client/ImporterWebsocketReceiver.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + class ImporterWebsocketReceiverDef { constructor() { this.streamer = new Meteor.Streamer('importers'); diff --git a/packages/rocketchat-importer/client/admin/adminImport.js b/packages/rocketchat-importer/client/admin/adminImport.js index 2ff7cdd26ccb..f019dfb90105 100644 --- a/packages/rocketchat-importer/client/admin/adminImport.js +++ b/packages/rocketchat-importer/client/admin/adminImport.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { Importers } from 'meteor/rocketchat:importer'; Template.adminImport.helpers({ diff --git a/packages/rocketchat-importer/client/admin/adminImportProgress.js b/packages/rocketchat-importer/client/admin/adminImportProgress.js index 1f8e579ac4a0..e30a6a4aa667 100644 --- a/packages/rocketchat-importer/client/admin/adminImportProgress.js +++ b/packages/rocketchat-importer/client/admin/adminImportProgress.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { Importers, ImporterWebsocketReceiver, ProgressStep } from 'meteor/rocketchat:importer'; import toastr from 'toastr'; diff --git a/packages/rocketchat-importer/server/classes/ImporterBase.js b/packages/rocketchat-importer/server/classes/ImporterBase.js index bdd83c48ff18..d75775432e02 100644 --- a/packages/rocketchat-importer/server/classes/ImporterBase.js +++ b/packages/rocketchat-importer/server/classes/ImporterBase.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { Progress } from './ImporterProgress'; import { ProgressStep } from '../../lib/ImporterProgressStep'; import { Selection } from './ImporterSelection'; diff --git a/packages/rocketchat-importer/server/classes/ImporterWebsocket.js b/packages/rocketchat-importer/server/classes/ImporterWebsocket.js index 48fa126d8277..07e23cb77e59 100644 --- a/packages/rocketchat-importer/server/classes/ImporterWebsocket.js +++ b/packages/rocketchat-importer/server/classes/ImporterWebsocket.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + class ImporterWebsocketDef { constructor() { this.streamer = new Meteor.Streamer('importers', { retransmit: false }); diff --git a/packages/rocketchat-importer/server/methods/getImportProgress.js b/packages/rocketchat-importer/server/methods/getImportProgress.js index 864e47d62791..f99bcf57d394 100644 --- a/packages/rocketchat-importer/server/methods/getImportProgress.js +++ b/packages/rocketchat-importer/server/methods/getImportProgress.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { Importers } from 'meteor/rocketchat:importer'; Meteor.methods({ diff --git a/packages/rocketchat-importer/server/methods/getSelectionData.js b/packages/rocketchat-importer/server/methods/getSelectionData.js index 7778a30bba91..b62a3e3bd9ae 100644 --- a/packages/rocketchat-importer/server/methods/getSelectionData.js +++ b/packages/rocketchat-importer/server/methods/getSelectionData.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { Importers, ProgressStep, diff --git a/packages/rocketchat-importer/server/methods/prepareImport.js b/packages/rocketchat-importer/server/methods/prepareImport.js index 426f5a70ddfa..23dc03174876 100644 --- a/packages/rocketchat-importer/server/methods/prepareImport.js +++ b/packages/rocketchat-importer/server/methods/prepareImport.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { Importers } from 'meteor/rocketchat:importer'; Meteor.methods({ diff --git a/packages/rocketchat-importer/server/startup/setImportsToInvalid.js b/packages/rocketchat-importer/server/startup/setImportsToInvalid.js index 108c75da30a0..4c03a8c816da 100644 --- a/packages/rocketchat-importer/server/startup/setImportsToInvalid.js +++ b/packages/rocketchat-importer/server/startup/setImportsToInvalid.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { Imports } from '../models/Imports'; import { RawImports } from '../models/RawImports'; diff --git a/packages/rocketchat-integrations/client/route.js b/packages/rocketchat-integrations/client/route.js index f39c2cdc9016..3801ae5b1dd5 100644 --- a/packages/rocketchat-integrations/client/route.js +++ b/packages/rocketchat-integrations/client/route.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + FlowRouter.route('/admin/integrations', { name: 'admin-integrations', subscriptions() { diff --git a/packages/rocketchat-integrations/client/views/integrationsIncoming.js b/packages/rocketchat-integrations/client/views/integrationsIncoming.js index fd2e82ab004d..fbfb27c98dfe 100644 --- a/packages/rocketchat-integrations/client/views/integrationsIncoming.js +++ b/packages/rocketchat-integrations/client/views/integrationsIncoming.js @@ -1,5 +1,6 @@ /* global ChatIntegrations */ +import { Meteor } from 'meteor/meteor'; import hljs from 'highlight.js'; import toastr from 'toastr'; diff --git a/packages/rocketchat-integrations/client/views/integrationsOutgoingHistory.js b/packages/rocketchat-integrations/client/views/integrationsOutgoingHistory.js index f9eda8f76dff..722e7aa94bcf 100644 --- a/packages/rocketchat-integrations/client/views/integrationsOutgoingHistory.js +++ b/packages/rocketchat-integrations/client/views/integrationsOutgoingHistory.js @@ -1,5 +1,6 @@ /* global ChatIntegrations, ChatIntegrationHistory */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import hljs from 'highlight.js'; import moment from 'moment'; diff --git a/packages/rocketchat-integrations/server/lib/triggerHandler.js b/packages/rocketchat-integrations/server/lib/triggerHandler.js index 03037c94877c..a97fedb80e58 100644 --- a/packages/rocketchat-integrations/server/lib/triggerHandler.js +++ b/packages/rocketchat-integrations/server/lib/triggerHandler.js @@ -1,4 +1,5 @@ /* global logger, processWebhookMessage */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-integrations/server/methods/clearIntegrationHistory.js b/packages/rocketchat-integrations/server/methods/clearIntegrationHistory.js index 5c1aadece5b6..a5b3aa531f0a 100644 --- a/packages/rocketchat-integrations/server/methods/clearIntegrationHistory.js +++ b/packages/rocketchat-integrations/server/methods/clearIntegrationHistory.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ clearIntegrationHistory(integrationId) { let integration; diff --git a/packages/rocketchat-integrations/server/methods/incoming/deleteIncomingIntegration.js b/packages/rocketchat-integrations/server/methods/incoming/deleteIncomingIntegration.js index 6be9a6d2811a..22b02c68cdf2 100644 --- a/packages/rocketchat-integrations/server/methods/incoming/deleteIncomingIntegration.js +++ b/packages/rocketchat-integrations/server/methods/incoming/deleteIncomingIntegration.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ deleteIncomingIntegration(integrationId) { let integration; diff --git a/packages/rocketchat-integrations/server/methods/outgoing/addOutgoingIntegration.js b/packages/rocketchat-integrations/server/methods/outgoing/addOutgoingIntegration.js index 16a2d9f4e4cf..deaf1f441397 100644 --- a/packages/rocketchat-integrations/server/methods/outgoing/addOutgoingIntegration.js +++ b/packages/rocketchat-integrations/server/methods/outgoing/addOutgoingIntegration.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ addOutgoingIntegration(integration) { if (!RocketChat.authz.hasPermission(this.userId, 'manage-integrations') diff --git a/packages/rocketchat-integrations/server/methods/outgoing/deleteOutgoingIntegration.js b/packages/rocketchat-integrations/server/methods/outgoing/deleteOutgoingIntegration.js index d82ddc1b8fda..a7d2629e6061 100644 --- a/packages/rocketchat-integrations/server/methods/outgoing/deleteOutgoingIntegration.js +++ b/packages/rocketchat-integrations/server/methods/outgoing/deleteOutgoingIntegration.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ deleteOutgoingIntegration(integrationId) { let integration; diff --git a/packages/rocketchat-integrations/server/methods/outgoing/replayOutgoingIntegration.js b/packages/rocketchat-integrations/server/methods/outgoing/replayOutgoingIntegration.js index a5280f546058..573c28d430b4 100644 --- a/packages/rocketchat-integrations/server/methods/outgoing/replayOutgoingIntegration.js +++ b/packages/rocketchat-integrations/server/methods/outgoing/replayOutgoingIntegration.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ replayOutgoingIntegration({ integrationId, historyId }) { let integration; diff --git a/packages/rocketchat-integrations/server/methods/outgoing/updateOutgoingIntegration.js b/packages/rocketchat-integrations/server/methods/outgoing/updateOutgoingIntegration.js index 9a24d7cf7409..4ff5ced234d1 100644 --- a/packages/rocketchat-integrations/server/methods/outgoing/updateOutgoingIntegration.js +++ b/packages/rocketchat-integrations/server/methods/outgoing/updateOutgoingIntegration.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ updateOutgoingIntegration(integrationId, integration) { integration = RocketChat.integrations.validateOutgoing(integration, this.userId); diff --git a/packages/rocketchat-integrations/server/models/IntegrationHistory.js b/packages/rocketchat-integrations/server/models/IntegrationHistory.js index 004d2cc9edb7..7b4c02457ac8 100644 --- a/packages/rocketchat-integrations/server/models/IntegrationHistory.js +++ b/packages/rocketchat-integrations/server/models/IntegrationHistory.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.models.IntegrationHistory = new class IntegrationHistory extends RocketChat.models._Base { constructor() { super('integration_history'); diff --git a/packages/rocketchat-integrations/server/models/Integrations.js b/packages/rocketchat-integrations/server/models/Integrations.js index af3e4b2040c0..53b08fac9dc2 100644 --- a/packages/rocketchat-integrations/server/models/Integrations.js +++ b/packages/rocketchat-integrations/server/models/Integrations.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.models.Integrations = new class Integrations extends RocketChat.models._Base { constructor() { super('integrations'); diff --git a/packages/rocketchat-integrations/server/processWebhookMessage.js b/packages/rocketchat-integrations/server/processWebhookMessage.js index dc0880d2a96c..f8b10ddbb34b 100644 --- a/packages/rocketchat-integrations/server/processWebhookMessage.js +++ b/packages/rocketchat-integrations/server/processWebhookMessage.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-integrations/server/publications/integrationHistory.js b/packages/rocketchat-integrations/server/publications/integrationHistory.js index 22d8f68e4278..456043a4d37a 100644 --- a/packages/rocketchat-integrations/server/publications/integrationHistory.js +++ b/packages/rocketchat-integrations/server/publications/integrationHistory.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('integrationHistory', function _integrationHistoryPublication(integrationId, limit = 25) { if (!this.userId) { return this.ready(); diff --git a/packages/rocketchat-integrations/server/publications/integrations.js b/packages/rocketchat-integrations/server/publications/integrations.js index 065081dbabea..de637151a566 100644 --- a/packages/rocketchat-integrations/server/publications/integrations.js +++ b/packages/rocketchat-integrations/server/publications/integrations.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('integrations', function _integrationPublication() { if (!this.userId) { return this.ready(); diff --git a/packages/rocketchat-irc/server/irc-bridge/localHandlers/onCreateUser.js b/packages/rocketchat-irc/server/irc-bridge/localHandlers/onCreateUser.js index bca92046d38a..7710295a3c27 100644 --- a/packages/rocketchat-irc/server/irc-bridge/localHandlers/onCreateUser.js +++ b/packages/rocketchat-irc/server/irc-bridge/localHandlers/onCreateUser.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + export default function handleOnCreateUser(newUser) { if (!newUser) { return this.log('Invalid handleOnCreateUser call'); diff --git a/packages/rocketchat-irc/server/irc-bridge/localHandlers/onLogin.js b/packages/rocketchat-irc/server/irc-bridge/localHandlers/onLogin.js index 9736cc622f6f..876adef62ba8 100644 --- a/packages/rocketchat-irc/server/irc-bridge/localHandlers/onLogin.js +++ b/packages/rocketchat-irc/server/irc-bridge/localHandlers/onLogin.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + export default function handleOnLogin(login) { if (login.user === null) { return this.log('Invalid handleOnLogin call'); diff --git a/packages/rocketchat-irc/server/irc-bridge/peerHandlers/disconnected.js b/packages/rocketchat-irc/server/irc-bridge/peerHandlers/disconnected.js index 570c2766ec65..6f7c480f6261 100644 --- a/packages/rocketchat-irc/server/irc-bridge/peerHandlers/disconnected.js +++ b/packages/rocketchat-irc/server/irc-bridge/peerHandlers/disconnected.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + export default function handleQUIT(args) { const user = RocketChat.models.Users.findOne({ 'profile.irc.nick': args.nick, diff --git a/packages/rocketchat-irc/server/irc-bridge/peerHandlers/userRegistered.js b/packages/rocketchat-irc/server/irc-bridge/peerHandlers/userRegistered.js index 9289aa52b6e3..e91a194606b9 100644 --- a/packages/rocketchat-irc/server/irc-bridge/peerHandlers/userRegistered.js +++ b/packages/rocketchat-irc/server/irc-bridge/peerHandlers/userRegistered.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + export default async function handleUserRegistered(args) { // Check if there is an user with the given username let user = RocketChat.models.Users.findOne({ diff --git a/packages/rocketchat-irc/server/irc-settings.js b/packages/rocketchat-irc/server/irc-settings.js index 836629fa8c5a..4a53d899609d 100644 --- a/packages/rocketchat-irc/server/irc-settings.js +++ b/packages/rocketchat-irc/server/irc-settings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.settings.addGroup('IRC_Federation', function() { this.add('IRC_Enabled', false, { diff --git a/packages/rocketchat-irc/server/irc.js b/packages/rocketchat-irc/server/irc.js index ad02df6a9b3d..2dc4ac493095 100644 --- a/packages/rocketchat-irc/server/irc.js +++ b/packages/rocketchat-irc/server/irc.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import Bridge from './irc-bridge'; if (!!RocketChat.settings.get('IRC_Enabled') === true) { diff --git a/packages/rocketchat-katex/katex.js b/packages/rocketchat-katex/katex.js index de1cad4c8730..1a5c5033cd15 100644 --- a/packages/rocketchat-katex/katex.js +++ b/packages/rocketchat-katex/katex.js @@ -2,6 +2,7 @@ * KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web. * https://github.com/Khan/KaTeX */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-katex/settings.js b/packages/rocketchat-katex/settings.js index b558b25f58c2..81545c241c38 100644 --- a/packages/rocketchat-katex/settings.js +++ b/packages/rocketchat-katex/settings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { const enableQuery = { _id: 'Katex_Enabled', diff --git a/packages/rocketchat-ldap/client/loginHelper.js b/packages/rocketchat-ldap/client/loginHelper.js index 3fe0d15a9dad..f5b8e9dc58bf 100644 --- a/packages/rocketchat-ldap/client/loginHelper.js +++ b/packages/rocketchat-ldap/client/loginHelper.js @@ -2,6 +2,8 @@ // customLdapOptions should be passed in if you want to override LDAP_DEFAULTS // on any particular call (if you have multiple ldap servers you'd like to connect to) // You'll likely want to set the dn value here {dn: "..."} +import { Meteor } from 'meteor/meteor'; + Meteor.loginWithLDAP = function(...args) { // Pull username and password const username = args.shift(); diff --git a/packages/rocketchat-ldap/server/ldap.js b/packages/rocketchat-ldap/server/ldap.js index d63dd3adc160..8ff89be6a4f0 100644 --- a/packages/rocketchat-ldap/server/ldap.js +++ b/packages/rocketchat-ldap/server/ldap.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import ldapjs from 'ldapjs'; import Bunyan from 'bunyan'; diff --git a/packages/rocketchat-ldap/server/loginHandler.js b/packages/rocketchat-ldap/server/loginHandler.js index e05d23a55841..a81691a99c12 100644 --- a/packages/rocketchat-ldap/server/loginHandler.js +++ b/packages/rocketchat-ldap/server/loginHandler.js @@ -1,5 +1,6 @@ /* eslint new-cap: [2, {"capIsNewExceptions": ["SHA256"]}] */ +import { Meteor } from 'meteor/meteor'; import { slug, getLdapUsername, getLdapUserUniqueID, syncUserData, addLdapUser } from './sync'; import LDAP from './ldap'; diff --git a/packages/rocketchat-ldap/server/syncUsers.js b/packages/rocketchat-ldap/server/syncUsers.js index 0932fedcbdd6..8243aab95e62 100644 --- a/packages/rocketchat-ldap/server/syncUsers.js +++ b/packages/rocketchat-ldap/server/syncUsers.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { importNewUsers } from './sync'; Meteor.methods({ diff --git a/packages/rocketchat-lib/client/CustomTranslations.js b/packages/rocketchat-lib/client/CustomTranslations.js index 463541a351ca..46d6cc9c3597 100644 --- a/packages/rocketchat-lib/client/CustomTranslations.js +++ b/packages/rocketchat-lib/client/CustomTranslations.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.applyCustomTranslations = function applyCustomTranslations() { let CustomTranslations = RocketChat.settings.get('Custom_Translations'); if (typeof CustomTranslations === 'string' && CustomTranslations.trim() !== '') { diff --git a/packages/rocketchat-lib/client/lib/ChannelActions.js b/packages/rocketchat-lib/client/lib/ChannelActions.js index 9dbcc0fde93f..6818d9dc150e 100644 --- a/packages/rocketchat-lib/client/lib/ChannelActions.js +++ b/packages/rocketchat-lib/client/lib/ChannelActions.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { call, UiTextContext } from 'meteor/rocketchat:lib'; export function hide(type, rid, name) { diff --git a/packages/rocketchat-lib/client/lib/LoginPresence.js b/packages/rocketchat-lib/client/lib/LoginPresence.js index 9d2ece8fae99..1f621d333c24 100644 --- a/packages/rocketchat-lib/client/lib/LoginPresence.js +++ b/packages/rocketchat-lib/client/lib/LoginPresence.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + export const LoginPresence = { awayTime: 600000, // 10 minutes started: false, diff --git a/packages/rocketchat-lib/client/lib/callMethod.js b/packages/rocketchat-lib/client/lib/callMethod.js index aa6d6337f879..88af0fcc6539 100644 --- a/packages/rocketchat-lib/client/lib/callMethod.js +++ b/packages/rocketchat-lib/client/lib/callMethod.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + /** * Wraps a Meteor method into a Promise. * This is particularly useful for creating information dialogs after execution of a Meteor method diff --git a/packages/rocketchat-lib/client/lib/formatDate.js b/packages/rocketchat-lib/client/lib/formatDate.js index 94f6afa4a62c..c6b34aef96a5 100644 --- a/packages/rocketchat-lib/client/lib/formatDate.js +++ b/packages/rocketchat-lib/client/lib/formatDate.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import moment from 'moment'; export const formatTime = (time) => { switch (RocketChat.getUserPreference(Meteor.userId(), 'clockMode', false)) { diff --git a/packages/rocketchat-lib/client/lib/openRoom.js b/packages/rocketchat-lib/client/lib/openRoom.js index 66859b9e0290..abaa75cb12e4 100644 --- a/packages/rocketchat-lib/client/lib/openRoom.js +++ b/packages/rocketchat-lib/client/lib/openRoom.js @@ -1,4 +1,5 @@ /* globals fireGlobalEvent readMessage currentTracker*/ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; currentTracker = undefined; diff --git a/packages/rocketchat-lib/client/lib/settings.js b/packages/rocketchat-lib/client/lib/settings.js index c734961e9bee..4d4bd241b3d8 100644 --- a/packages/rocketchat-lib/client/lib/settings.js +++ b/packages/rocketchat-lib/client/lib/settings.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; /* * RocketChat.settings holds all packages settings diff --git a/packages/rocketchat-lib/client/lib/startup/commands.js b/packages/rocketchat-lib/client/lib/startup/commands.js index 46664d2fb812..9447a5931745 100644 --- a/packages/rocketchat-lib/client/lib/startup/commands.js +++ b/packages/rocketchat-lib/client/lib/startup/commands.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + // Track logins and when they login, get the commands (() => { let oldUserId = null; diff --git a/packages/rocketchat-lib/client/lib/userRoles.js b/packages/rocketchat-lib/client/lib/userRoles.js index a2dbd4cbe79c..585acdb0f322 100644 --- a/packages/rocketchat-lib/client/lib/userRoles.js +++ b/packages/rocketchat-lib/client/lib/userRoles.js @@ -1,4 +1,5 @@ /* globals UserRoles, RoomRoles */ +import { Meteor } from 'meteor/meteor'; Meteor.startup(function() { Tracker.autorun(function() { diff --git a/packages/rocketchat-lib/client/methods/sendMessage.js b/packages/rocketchat-lib/client/methods/sendMessage.js index 06f1663cbdc3..a6147fbc54a7 100644 --- a/packages/rocketchat-lib/client/methods/sendMessage.js +++ b/packages/rocketchat-lib/client/methods/sendMessage.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; Meteor.methods({ diff --git a/packages/rocketchat-lib/lib/MessageTypes.js b/packages/rocketchat-lib/lib/MessageTypes.js index b42d8214373f..14902dc6b720 100644 --- a/packages/rocketchat-lib/lib/MessageTypes.js +++ b/packages/rocketchat-lib/lib/MessageTypes.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.MessageTypes = new class { constructor() { this.types = {}; diff --git a/packages/rocketchat-lib/lib/RoomTypesCommon.js b/packages/rocketchat-lib/lib/RoomTypesCommon.js index 6ada5c29a12e..e5fcfbd33169 100644 --- a/packages/rocketchat-lib/lib/RoomTypesCommon.js +++ b/packages/rocketchat-lib/lib/RoomTypesCommon.js @@ -1,4 +1,5 @@ /* globals roomExit */ +import { Meteor } from 'meteor/meteor'; import { RoomTypeConfig } from './RoomTypeConfig'; export class RoomTypesCommon { diff --git a/packages/rocketchat-lib/lib/callbacks.js b/packages/rocketchat-lib/lib/callbacks.js index c45850dfa087..73c800a022d0 100644 --- a/packages/rocketchat-lib/lib/callbacks.js +++ b/packages/rocketchat-lib/lib/callbacks.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; /* diff --git a/packages/rocketchat-lib/lib/getURL.js b/packages/rocketchat-lib/lib/getURL.js index 6802a153b713..13b7da454a1c 100644 --- a/packages/rocketchat-lib/lib/getURL.js +++ b/packages/rocketchat-lib/lib/getURL.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; RocketChat.getURL = (path, { cdn = true, full = false } = {}) => { diff --git a/packages/rocketchat-lib/lib/getValidRoomName.js b/packages/rocketchat-lib/lib/getValidRoomName.js index dbbd610d36bc..e48a30e25b76 100644 --- a/packages/rocketchat-lib/lib/getValidRoomName.js +++ b/packages/rocketchat-lib/lib/getValidRoomName.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; RocketChat.getValidRoomName = function getValidRoomName(displayName, rid = '') { diff --git a/packages/rocketchat-lib/lib/promises.js b/packages/rocketchat-lib/lib/promises.js index 45873a5d4d6d..bf201d0e2029 100644 --- a/packages/rocketchat-lib/lib/promises.js +++ b/packages/rocketchat-lib/lib/promises.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; /* diff --git a/packages/rocketchat-lib/lib/roomTypes/conversation.js b/packages/rocketchat-lib/lib/roomTypes/conversation.js index cf36699f0a44..8f18930c5c68 100644 --- a/packages/rocketchat-lib/lib/roomTypes/conversation.js +++ b/packages/rocketchat-lib/lib/roomTypes/conversation.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { RoomTypeConfig } from '../RoomTypeConfig'; export class ConversationRoomType extends RoomTypeConfig { diff --git a/packages/rocketchat-lib/lib/roomTypes/direct.js b/packages/rocketchat-lib/lib/roomTypes/direct.js index dac14d8bfc99..896674fd4326 100644 --- a/packages/rocketchat-lib/lib/roomTypes/direct.js +++ b/packages/rocketchat-lib/lib/roomTypes/direct.js @@ -1,4 +1,5 @@ /* globals openRoom */ +import { Meteor } from 'meteor/meteor'; import { RoomTypeConfig, RoomTypeRouteConfig, RoomSettingsEnum, UiTextContext } from '../RoomTypeConfig'; export class DirectMessageRoomRoute extends RoomTypeRouteConfig { diff --git a/packages/rocketchat-lib/lib/roomTypes/favorite.js b/packages/rocketchat-lib/lib/roomTypes/favorite.js index 989efae65a24..af598aca06c6 100644 --- a/packages/rocketchat-lib/lib/roomTypes/favorite.js +++ b/packages/rocketchat-lib/lib/roomTypes/favorite.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { RoomTypeConfig } from '../RoomTypeConfig'; export class FavoriteRoomType extends RoomTypeConfig { diff --git a/packages/rocketchat-lib/lib/roomTypes/private.js b/packages/rocketchat-lib/lib/roomTypes/private.js index b407a111c1db..4cef8c129126 100644 --- a/packages/rocketchat-lib/lib/roomTypes/private.js +++ b/packages/rocketchat-lib/lib/roomTypes/private.js @@ -1,4 +1,5 @@ /* globals openRoom */ +import { Meteor } from 'meteor/meteor'; import { RoomSettingsEnum, RoomTypeConfig, RoomTypeRouteConfig, UiTextContext } from '../RoomTypeConfig'; export class PrivateRoomRoute extends RoomTypeRouteConfig { diff --git a/packages/rocketchat-lib/lib/roomTypes/public.js b/packages/rocketchat-lib/lib/roomTypes/public.js index 6b079d4df592..5168415c1b39 100644 --- a/packages/rocketchat-lib/lib/roomTypes/public.js +++ b/packages/rocketchat-lib/lib/roomTypes/public.js @@ -1,4 +1,5 @@ /* globals openRoom */ +import { Meteor } from 'meteor/meteor'; import { RoomTypeConfig, RoomTypeRouteConfig, RoomSettingsEnum, UiTextContext } from '../RoomTypeConfig'; export class PublicRoomRoute extends RoomTypeRouteConfig { diff --git a/packages/rocketchat-lib/lib/roomTypes/unread.js b/packages/rocketchat-lib/lib/roomTypes/unread.js index 7bfd2f5b89af..64926533670f 100644 --- a/packages/rocketchat-lib/lib/roomTypes/unread.js +++ b/packages/rocketchat-lib/lib/roomTypes/unread.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { RoomTypeConfig } from '../RoomTypeConfig'; export class UnreadRoomType extends RoomTypeConfig { diff --git a/packages/rocketchat-lib/lib/startup/settingsOnLoadSiteUrl.js b/packages/rocketchat-lib/lib/startup/settingsOnLoadSiteUrl.js index 8e4c7d987e6f..70c6d78cb6f0 100644 --- a/packages/rocketchat-lib/lib/startup/settingsOnLoadSiteUrl.js +++ b/packages/rocketchat-lib/lib/startup/settingsOnLoadSiteUrl.js @@ -1,4 +1,6 @@ /* globals WebAppInternals */ +import { Meteor } from 'meteor/meteor'; + RocketChat.settings.get('Site_Url', function(key, value) { if (value == null || value.trim() === '') { return; diff --git a/packages/rocketchat-lib/lib/templateVarHandler.js b/packages/rocketchat-lib/lib/templateVarHandler.js index 294520a550d5..f13bd9233a71 100644 --- a/packages/rocketchat-lib/lib/templateVarHandler.js +++ b/packages/rocketchat-lib/lib/templateVarHandler.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + let logger; if (Meteor.isServer) { diff --git a/packages/rocketchat-lib/server/functions/Notifications.js b/packages/rocketchat-lib/server/functions/Notifications.js index 92e78e6774ba..489350245a6a 100644 --- a/packages/rocketchat-lib/server/functions/Notifications.js +++ b/packages/rocketchat-lib/server/functions/Notifications.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.Notifications = new class { constructor() { this.debug = false; diff --git a/packages/rocketchat-lib/server/functions/addUserToRoom.js b/packages/rocketchat-lib/server/functions/addUserToRoom.js index cb8807de5873..26f8649c0f49 100644 --- a/packages/rocketchat-lib/server/functions/addUserToRoom.js +++ b/packages/rocketchat-lib/server/functions/addUserToRoom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.addUserToRoom = function(rid, user, inviter, silenced) { const now = new Date(); const room = RocketChat.models.Rooms.findOneById(rid); diff --git a/packages/rocketchat-lib/server/functions/archiveRoom.js b/packages/rocketchat-lib/server/functions/archiveRoom.js index f48be588c92f..26d756bd5e6e 100644 --- a/packages/rocketchat-lib/server/functions/archiveRoom.js +++ b/packages/rocketchat-lib/server/functions/archiveRoom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.archiveRoom = function(rid) { RocketChat.models.Rooms.archiveById(rid); RocketChat.models.Subscriptions.archiveByRoomId(rid); diff --git a/packages/rocketchat-lib/server/functions/checkEmailAvailability.js b/packages/rocketchat-lib/server/functions/checkEmailAvailability.js index b60d92741b2a..3e892c5f19ac 100644 --- a/packages/rocketchat-lib/server/functions/checkEmailAvailability.js +++ b/packages/rocketchat-lib/server/functions/checkEmailAvailability.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; RocketChat.checkEmailAvailability = function(email) { diff --git a/packages/rocketchat-lib/server/functions/checkUsernameAvailability.js b/packages/rocketchat-lib/server/functions/checkUsernameAvailability.js index 66720a8e8fa0..1aba54ba77f6 100644 --- a/packages/rocketchat-lib/server/functions/checkUsernameAvailability.js +++ b/packages/rocketchat-lib/server/functions/checkUsernameAvailability.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; diff --git a/packages/rocketchat-lib/server/functions/createRoom.js b/packages/rocketchat-lib/server/functions/createRoom.js index 311c0011bb5a..532b2e8c0ea7 100644 --- a/packages/rocketchat-lib/server/functions/createRoom.js +++ b/packages/rocketchat-lib/server/functions/createRoom.js @@ -1,4 +1,5 @@ /* globals RocketChat */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-lib/server/functions/deleteMessage.js b/packages/rocketchat-lib/server/functions/deleteMessage.js index eb0d6956a499..27a576d4141b 100644 --- a/packages/rocketchat-lib/server/functions/deleteMessage.js +++ b/packages/rocketchat-lib/server/functions/deleteMessage.js @@ -1,4 +1,6 @@ /* globals FileUpload */ +import { Meteor } from 'meteor/meteor'; + RocketChat.deleteMessage = function(message, user) { const keepHistory = RocketChat.settings.get('Message_KeepHistory'); const showDeletedStatus = RocketChat.settings.get('Message_ShowDeletedStatus'); diff --git a/packages/rocketchat-lib/server/functions/deleteUser.js b/packages/rocketchat-lib/server/functions/deleteUser.js index 87e98de99d7f..9382e49a8d22 100644 --- a/packages/rocketchat-lib/server/functions/deleteUser.js +++ b/packages/rocketchat-lib/server/functions/deleteUser.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.deleteUser = function(userId) { const user = RocketChat.models.Users.findOneById(userId, { fields: { username: 1, avatarOrigin: 1 }, diff --git a/packages/rocketchat-lib/server/functions/getRoomByNameOrIdWithOptionToJoin.js b/packages/rocketchat-lib/server/functions/getRoomByNameOrIdWithOptionToJoin.js index 05ef18401812..4ccf99191686 100644 --- a/packages/rocketchat-lib/server/functions/getRoomByNameOrIdWithOptionToJoin.js +++ b/packages/rocketchat-lib/server/functions/getRoomByNameOrIdWithOptionToJoin.js @@ -1,4 +1,5 @@ /* globals RocketChat */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; RocketChat.getRoomByNameOrIdWithOptionToJoin = function _getRoomByNameOrIdWithOptionToJoin({ currentUserId, nameOrId, type = '', tryDirectByUserIdOnly = false, joinChannel = true, errorOnEmpty = true }) { diff --git a/packages/rocketchat-lib/server/functions/notifications/email.js b/packages/rocketchat-lib/server/functions/notifications/email.js index ec2555b9c241..bf68e765f635 100644 --- a/packages/rocketchat-lib/server/functions/notifications/email.js +++ b/packages/rocketchat-lib/server/functions/notifications/email.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; import * as Mailer from 'meteor/rocketchat:mailer'; diff --git a/packages/rocketchat-lib/server/functions/notifications/index.js b/packages/rocketchat-lib/server/functions/notifications/index.js index 40fd2f03bb9b..d0aa8207a82d 100644 --- a/packages/rocketchat-lib/server/functions/notifications/index.js +++ b/packages/rocketchat-lib/server/functions/notifications/index.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; /** diff --git a/packages/rocketchat-lib/server/functions/notifications/mobile.js b/packages/rocketchat-lib/server/functions/notifications/mobile.js index 590519e8ebda..d772f7ea7b91 100644 --- a/packages/rocketchat-lib/server/functions/notifications/mobile.js +++ b/packages/rocketchat-lib/server/functions/notifications/mobile.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + const CATEGORY_MESSAGE = 'MESSAGE'; const CATEGORY_MESSAGE_NOREPLY = 'MESSAGE_NOREPLY'; diff --git a/packages/rocketchat-lib/server/functions/removeUserFromRoom.js b/packages/rocketchat-lib/server/functions/removeUserFromRoom.js index dc910a0a7ab1..f09aea6ad2ed 100644 --- a/packages/rocketchat-lib/server/functions/removeUserFromRoom.js +++ b/packages/rocketchat-lib/server/functions/removeUserFromRoom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.removeUserFromRoom = function(rid, user) { const room = RocketChat.models.Rooms.findOneById(rid); diff --git a/packages/rocketchat-lib/server/functions/saveCustomFieldsWithoutValidation.js b/packages/rocketchat-lib/server/functions/saveCustomFieldsWithoutValidation.js index b4280fddb7b8..f1c418193a34 100644 --- a/packages/rocketchat-lib/server/functions/saveCustomFieldsWithoutValidation.js +++ b/packages/rocketchat-lib/server/functions/saveCustomFieldsWithoutValidation.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; RocketChat.saveCustomFieldsWithoutValidation = function(userId, formData) { diff --git a/packages/rocketchat-lib/server/functions/sendMessage.js b/packages/rocketchat-lib/server/functions/sendMessage.js index 53d7338ca0ef..504d8a4a1092 100644 --- a/packages/rocketchat-lib/server/functions/sendMessage.js +++ b/packages/rocketchat-lib/server/functions/sendMessage.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + const objectMaybeIncluding = (types) => Match.Where((value) => { Object.keys(types).forEach((field) => { if (value[field] != null) { diff --git a/packages/rocketchat-lib/server/functions/setEmail.js b/packages/rocketchat-lib/server/functions/setEmail.js index 827edaca8a64..e947d5bfa514 100644 --- a/packages/rocketchat-lib/server/functions/setEmail.js +++ b/packages/rocketchat-lib/server/functions/setEmail.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; RocketChat._setEmail = function(userId, email, shouldSendVerificationEmail = true) { diff --git a/packages/rocketchat-lib/server/functions/setRealName.js b/packages/rocketchat-lib/server/functions/setRealName.js index 851ae2980ee0..6bf2f183ef75 100644 --- a/packages/rocketchat-lib/server/functions/setRealName.js +++ b/packages/rocketchat-lib/server/functions/setRealName.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; RocketChat._setRealName = function(userId, name) { diff --git a/packages/rocketchat-lib/server/functions/setUserAvatar.js b/packages/rocketchat-lib/server/functions/setUserAvatar.js index 5bfd3f86f94a..0985178849b2 100644 --- a/packages/rocketchat-lib/server/functions/setUserAvatar.js +++ b/packages/rocketchat-lib/server/functions/setUserAvatar.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.setUserAvatar = function(user, dataURI, contentType, service) { let encoding; let image; diff --git a/packages/rocketchat-lib/server/functions/settings.js b/packages/rocketchat-lib/server/functions/settings.js index 8933d91912f7..4ffe64fc9250 100644 --- a/packages/rocketchat-lib/server/functions/settings.js +++ b/packages/rocketchat-lib/server/functions/settings.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; const blockedSettings = {}; diff --git a/packages/rocketchat-lib/server/functions/updateMessage.js b/packages/rocketchat-lib/server/functions/updateMessage.js index 4d5c8e583b37..950454594c95 100644 --- a/packages/rocketchat-lib/server/functions/updateMessage.js +++ b/packages/rocketchat-lib/server/functions/updateMessage.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.updateMessage = function(message, user, originalMessage) { if (!originalMessage) { originalMessage = RocketChat.models.Messages.findOneById(message._id); diff --git a/packages/rocketchat-lib/server/functions/validateCustomFields.js b/packages/rocketchat-lib/server/functions/validateCustomFields.js index a700c4e373bc..26ccace4102b 100644 --- a/packages/rocketchat-lib/server/functions/validateCustomFields.js +++ b/packages/rocketchat-lib/server/functions/validateCustomFields.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; RocketChat.validateCustomFields = function(fields) { diff --git a/packages/rocketchat-lib/server/lib/PasswordPolicyClass.js b/packages/rocketchat-lib/server/lib/PasswordPolicyClass.js index 719b875e82fc..6246990e7dfb 100644 --- a/packages/rocketchat-lib/server/lib/PasswordPolicyClass.js +++ b/packages/rocketchat-lib/server/lib/PasswordPolicyClass.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + class PasswordPolicy { constructor({ enabled = false, diff --git a/packages/rocketchat-lib/server/lib/RateLimiter.js b/packages/rocketchat-lib/server/lib/RateLimiter.js index 1555cd4abeeb..327dc65c812a 100644 --- a/packages/rocketchat-lib/server/lib/RateLimiter.js +++ b/packages/rocketchat-lib/server/lib/RateLimiter.js @@ -1,4 +1,5 @@ /* globals RateLimiter */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; RocketChat.RateLimiter = new class { diff --git a/packages/rocketchat-lib/server/lib/bugsnag.js b/packages/rocketchat-lib/server/lib/bugsnag.js index a08d50274671..8d123c88d512 100644 --- a/packages/rocketchat-lib/server/lib/bugsnag.js +++ b/packages/rocketchat-lib/server/lib/bugsnag.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import bugsnag from 'bugsnag'; RocketChat.bugsnag = bugsnag; diff --git a/packages/rocketchat-lib/server/lib/configLogger.js b/packages/rocketchat-lib/server/lib/configLogger.js index a2fb4106e028..b0d2fef6170c 100644 --- a/packages/rocketchat-lib/server/lib/configLogger.js +++ b/packages/rocketchat-lib/server/lib/configLogger.js @@ -1,4 +1,6 @@ /* globals LoggerManager */ +import { Meteor } from 'meteor/meteor'; + RocketChat.settings.get('Log_Package', function(key, value) { return LoggerManager.showPackage = value; }); diff --git a/packages/rocketchat-lib/server/lib/debug.js b/packages/rocketchat-lib/server/lib/debug.js index 5ef15b457eba..1c7b577c2c27 100644 --- a/packages/rocketchat-lib/server/lib/debug.js +++ b/packages/rocketchat-lib/server/lib/debug.js @@ -1,4 +1,5 @@ /* global InstanceStatus */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; const logger = new Logger('Meteor', { diff --git a/packages/rocketchat-lib/server/lib/loginErrorMessageOverride.js b/packages/rocketchat-lib/server/lib/loginErrorMessageOverride.js index c9bb7a65cd8c..857a4eb5bf92 100644 --- a/packages/rocketchat-lib/server/lib/loginErrorMessageOverride.js +++ b/packages/rocketchat-lib/server/lib/loginErrorMessageOverride.js @@ -1,4 +1,6 @@ // Do not disclose if user exists when password is invalid +import { Meteor } from 'meteor/meteor'; + const { _runLoginHandlers } = Accounts; Accounts._runLoginHandlers = function(methodInvocation, options) { const result = _runLoginHandlers.call(Accounts, methodInvocation, options); diff --git a/packages/rocketchat-lib/server/lib/metrics.js b/packages/rocketchat-lib/server/lib/metrics.js index 30086b1a865f..4608c7176054 100644 --- a/packages/rocketchat-lib/server/lib/metrics.js +++ b/packages/rocketchat-lib/server/lib/metrics.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import client from 'prom-client'; import connect from 'connect'; import http from 'http'; diff --git a/packages/rocketchat-lib/server/lib/processDirectEmail.js b/packages/rocketchat-lib/server/lib/processDirectEmail.js index c204d213295b..94f0bfe33e8d 100644 --- a/packages/rocketchat-lib/server/lib/processDirectEmail.js +++ b/packages/rocketchat-lib/server/lib/processDirectEmail.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { EmailReplyParser as reply } from 'emailreplyparser'; import moment from 'moment'; diff --git a/packages/rocketchat-lib/server/methods/addOAuthService.js b/packages/rocketchat-lib/server/methods/addOAuthService.js index 4d91d64698d3..10b3a570ac0a 100644 --- a/packages/rocketchat-lib/server/methods/addOAuthService.js +++ b/packages/rocketchat-lib/server/methods/addOAuthService.js @@ -1,5 +1,6 @@ /* eslint no-multi-spaces: 0 */ /* eslint comma-spacing: 0 */ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/methods/blockUser.js b/packages/rocketchat-lib/server/methods/blockUser.js index 95639295ba27..957413911059 100644 --- a/packages/rocketchat-lib/server/methods/blockUser.js +++ b/packages/rocketchat-lib/server/methods/blockUser.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ blockUser({ rid, blocked }) { diff --git a/packages/rocketchat-lib/tests/server.mocks.js b/packages/rocketchat-lib/tests/server.mocks.js new file mode 100644 index 000000000000..47155e9084c8 --- /dev/null +++ b/packages/rocketchat-lib/tests/server.mocks.js @@ -0,0 +1,9 @@ +import mock from 'mock-require'; + +mock('meteor/meteor', { + Meteor: { + absoluteUrl() { + return 'http://localhost:3000/'; + }, + }, +}); diff --git a/packages/rocketchat-lib/tests/server.tests.js b/packages/rocketchat-lib/tests/server.tests.js index 01695f98bf06..5125826318fe 100644 --- a/packages/rocketchat-lib/tests/server.tests.js +++ b/packages/rocketchat-lib/tests/server.tests.js @@ -1,6 +1,7 @@ /* eslint-env mocha */ import 'babel-polyfill'; import assert from 'assert'; +import './server.mocks.js'; import PasswordPolicyClass from '../server/lib/PasswordPolicyClass'; import { messageProperties } from '../lib/MessageProperties'; From 3f0c9f7d068c8b1efd936977e7828549e291bb5b Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Fri, 19 Oct 2018 10:26:54 -0300 Subject: [PATCH 03/34] Third wave of removal of Meteor global --- .eslintrc | 1 - .../client/lib/emojiCustom.js | 2 ++ .../client/notifications/updateEmojiCustom.js | 2 ++ .../rocketchat-iframe-login/iframe_client.js | 1 + packages/rocketchat-lib/client/UserDeleted.js | 2 ++ .../client/lib/RocketChatAnnouncement.js | 2 ++ .../rocketchat-lib/server/lib/roomTypes.js | 1 + .../server/lib/sendNotificationsOnMessage.js | 1 + .../server/lib/validateEmailDomain.js | 1 + .../server/methods/addUserToRoom.js | 2 ++ .../methods/checkRegistrationSecretURL.js | 2 ++ .../methods/checkUsernameAvailability.js | 2 ++ .../server/methods/cleanRoomHistory.js | 1 + .../server/methods/createChannel.js | 2 ++ .../server/methods/createPrivateGroup.js | 2 ++ .../server/methods/createToken.js | 2 ++ .../methods/executeSlashCommandPreview.js | 2 ++ .../server/methods/filterATAllTag.js | 1 + .../server/methods/filterATHereTag.js | 1 + .../server/methods/getChannelHistory.js | 1 + .../server/methods/getFullUserData.js | 2 ++ .../server/methods/getRoomJoinCode.js | 2 ++ .../server/methods/getRoomRoles.js | 1 + .../server/methods/getServerInfo.js | 2 ++ .../server/methods/getSingleMessage.js | 2 ++ .../server/methods/getSlashCommandPreviews.js | 2 ++ .../server/methods/getUserRoles.js | 1 + .../server/methods/insertOrUpdateUser.js | 2 ++ .../server/methods/joinDefaultChannels.js | 2 ++ .../rocketchat-lib/server/methods/joinRoom.js | 2 ++ .../server/methods/leaveRoom.js | 2 ++ .../server/methods/refreshOAuthService.js | 2 ++ .../server/methods/removeOAuthService.js | 1 + .../server/methods/restartServer.js | 2 ++ .../server/methods/robotMethods.js | 1 + .../server/methods/saveSetting.js | 1 + .../server/methods/sendInvitationEmail.js | 2 ++ .../server/methods/sendMessage.js | 1 + .../server/methods/sendSMTPTestEmail.js | 1 + .../server/methods/setAdminStatus.js | 2 ++ .../rocketchat-lib/server/methods/setEmail.js | 2 ++ .../server/methods/setRealName.js | 2 ++ .../server/methods/setUsername.js | 1 + .../server/methods/unarchiveRoom.js | 2 ++ .../server/methods/unblockUser.js | 2 ++ .../server/methods/updateMessage.js | 1 + .../rocketchat-lib/server/models/Messages.js | 1 + .../rocketchat-lib/server/models/Users.js | 1 + packages/rocketchat-lib/server/oauth/oauth.js | 1 + .../rocketchat-lib/server/oauth/twitter.js | 1 + .../server/publications/settings.js | 2 ++ .../server/startup/oAuthServicesUpdate.js | 1 + .../server/startup/settingsOnLoadCdnPrefix.js | 1 + .../startup/settingsOnLoadDirectReply.js | 1 + .../server/startup/settingsOnLoadSMTP.js | 1 + .../.app/client/lib/CustomFields.js | 1 + .../.app/client/lib/LivechatFileUpload.js | 1 + .../.app/client/lib/LivechatVideoCall.js | 1 + .../.app/client/lib/_livechat.js | 1 + .../.app/client/lib/chatMessages.js | 21 ++++++++++--------- .../.app/client/lib/commands.js | 1 + .../.app/client/lib/fromApp/Notifications.js | 1 + .../client/lib/fromApp/RoomHistoryManager.js | 1 + .../.app/client/lib/fromApp/avatar.js | 2 ++ .../.app/client/lib/hooks.js | 1 + .../.app/client/lib/msgTyping.js | 1 + .../.app/client/lib/triggers.js | 1 + .../client/methods/sendMessageExternal.js | 1 + .../.app/client/startup/customFields.js | 1 + .../.app/client/startup/visitor.js | 1 + .../.app/client/views/avatar.js | 1 + .../.app/client/views/livechatWindow.js | 1 + .../.app/client/views/messages.js | 1 + .../.app/client/views/offlineForm.js | 1 + .../.app/client/views/options.js | 1 + .../.app/client/views/register.js | 1 + .../.app/client/views/survey.js | 1 + .../.app/client/views/switchDepartment.js | 1 + .../.app/imports/client/visitor.js | 1 + .../client/methods/changeLivechatStatus.js | 2 ++ .../client/startup/notifyUnreadRooms.js | 2 ++ .../views/app/analytics/livechatAnalytics.js | 1 + .../livechatIntegrationFacebook.js | 2 ++ .../livechatIntegrationWebhook.js | 1 + .../client/views/app/livechatAppearance.js | 1 + .../client/views/app/livechatCurrentChats.js | 1 + .../views/app/livechatCustomFieldForm.js | 2 ++ .../client/views/app/livechatCustomFields.js | 2 ++ .../views/app/livechatDepartmentForm.js | 1 + .../client/views/app/livechatDepartments.js | 2 ++ .../client/views/app/livechatOfficeHours.js | 1 + .../client/views/app/livechatQueue.js | 1 + .../client/views/app/livechatTriggers.js | 2 ++ .../client/views/app/livechatTriggersForm.js | 1 + .../client/views/app/livechatUsers.js | 1 + .../client/views/app/tabbar/visitorEdit.js | 1 + .../client/views/app/tabbar/visitorForward.js | 1 + .../client/views/app/tabbar/visitorInfo.js | 1 + .../client/views/sideNav/livechat.js | 2 ++ packages/rocketchat-livechat/config.js | 2 ++ .../imports/server/rest/sms.js | 1 + .../imports/server/rest/upload.js | 1 + packages/rocketchat-livechat/livechat.js | 1 + packages/rocketchat-livechat/messageTypes.js | 2 ++ packages/rocketchat-livechat/permissions.js | 1 + .../server/api/v1/agent.js | 1 + .../server/api/v1/customField.js | 1 + .../server/api/v1/message.js | 1 + .../server/api/v1/pageVisited.js | 1 + .../rocketchat-livechat/server/api/v1/room.js | 1 + .../server/api/v1/videoCall.js | 1 + .../server/api/v1/visitor.js | 1 + .../server/hooks/externalMessage.js | 1 + .../server/hooks/markRoomResponded.js | 2 ++ .../server/hooks/saveAnalyticsData.js | 2 ++ .../server/lib/OfficeClock.js | 2 ++ .../server/lib/QueueMethods.js | 1 + .../server/methods/addAgent.js | 2 ++ .../server/methods/addManager.js | 2 ++ .../server/methods/changeLivechatStatus.js | 2 ++ .../server/methods/closeByVisitor.js | 1 + .../server/methods/closeRoom.js | 2 ++ .../server/methods/facebook.js | 1 + .../server/methods/getAgentData.js | 1 + .../server/methods/getAgentOverviewData.js | 2 ++ .../server/methods/getAnalyticsChartData.js | 2 ++ .../methods/getAnalyticsOverviewData.js | 2 ++ .../server/methods/getCustomFields.js | 2 ++ .../server/methods/getInitialData.js | 1 + .../server/methods/getNextAgent.js | 2 ++ .../server/methods/loadHistory.js | 1 + .../server/methods/loginByToken.js | 1 + .../server/methods/pageVisited.js | 2 ++ .../server/methods/registerGuest.js | 1 + .../server/methods/removeAgent.js | 2 ++ .../server/methods/removeCustomField.js | 2 ++ .../server/methods/removeDepartment.js | 2 ++ .../server/methods/removeManager.js | 2 ++ .../server/methods/removeRoom.js | 2 ++ .../server/methods/removeTrigger.js | 2 ++ .../server/methods/returnAsInquiry.js | 2 ++ .../server/methods/saveAppearance.js | 2 ++ .../server/methods/saveCustomField.js | 1 + .../server/methods/saveDepartment.js | 2 ++ .../server/methods/saveInfo.js | 1 + .../server/methods/saveIntegration.js | 1 + .../server/methods/saveOfficeHours.js | 2 ++ .../server/methods/saveSurveyFeedback.js | 1 + .../server/methods/saveTrigger.js | 2 ++ .../server/methods/searchAgent.js | 1 + .../server/methods/sendFileLivechatMessage.js | 1 + .../server/methods/sendMessageLivechat.js | 1 + .../server/methods/sendOfflineMessage.js | 1 + .../server/methods/sendTranscript.js | 1 + .../server/methods/setCustomField.js | 1 + .../server/methods/setDepartmentForVisitor.js | 1 + .../server/methods/startFileUploadRoom.js | 1 + .../server/methods/startVideoCall.js | 2 ++ .../server/methods/takeInquiry.js | 2 ++ .../server/methods/transfer.js | 1 + .../server/methods/webhookTest.js | 2 ++ .../server/models/LivechatDepartmentAgents.js | 1 + .../server/models/LivechatExternalMessage.js | 2 ++ .../server/models/LivechatVisitors.js | 1 + .../server/models/Rooms.js | 1 + .../server/models/Users.js | 2 ++ .../server/models/indexes.js | 2 ++ .../server/publications/customFields.js | 1 + .../server/publications/departmentAgents.js | 2 ++ .../server/publications/externalMessages.js | 2 ++ .../server/publications/livechatAgents.js | 2 ++ .../server/publications/livechatAppearance.js | 2 ++ .../publications/livechatDepartments.js | 2 ++ .../server/publications/livechatInquiries.js | 2 ++ .../publications/livechatIntegration.js | 2 ++ .../server/publications/livechatManagers.js | 2 ++ .../server/publications/livechatMonitoring.js | 2 ++ .../publications/livechatOfficeHours.js | 2 ++ .../server/publications/livechatQueue.js | 2 ++ .../server/publications/livechatRooms.js | 2 ++ .../server/publications/livechatTriggers.js | 2 ++ .../server/publications/livechatVisitors.js | 1 + .../server/publications/visitorHistory.js | 2 ++ .../server/publications/visitorInfo.js | 1 + .../server/publications/visitorPageVisited.js | 2 ++ .../rocketchat-livechat/server/startup.js | 2 ++ .../server/unclosedLivechats.js | 1 + .../server/visitorStatus.js | 2 ++ .../rocketchat-livestream/client/oauth.js | 2 ++ .../rocketchat-livestream/client/tabBar.js | 2 ++ .../client/views/broadcastView.js | 2 ++ .../client/views/liveStreamTab.js | 1 + .../server/functions/saveStreamingOptions.js | 2 ++ .../rocketchat-livestream/server/routes.js | 1 + .../rocketchat-livestream/server/settings.js | 2 ++ packages/rocketchat-logger/client/viewLogs.js | 1 + .../client/views/viewLogs.js | 1 + packages/rocketchat-logger/server/server.js | 1 + .../rocketchat-mail-messages/client/router.js | 2 ++ .../client/views/mailer.js | 2 ++ .../server/functions/sendMail.js | 1 + .../server/methods/sendMail.js | 2 ++ .../server/methods/unsubscribe.js | 2 ++ .../server/startup.js | 2 ++ packages/rocketchat-mailer/server/api.js | 1 + .../rocketchat-mapview/server/settings.js | 2 ++ .../client/actionButton.js | 2 ++ .../client/tabBar.js | 2 ++ .../server/publications/mentionedMessages.js | 2 ++ packages/rocketchat-mentions/client/client.js | 1 + .../methods/getUserMentionsByChannel.js | 2 ++ packages/rocketchat-mentions/server/server.js | 1 + .../client/messageAttachment.js | 1 + .../client/actionButton.js | 2 ++ .../server/unreadMessages.js | 1 + .../client/actionButton.js | 1 + .../client/messageType.js | 2 ++ .../client/pinMessage.js | 2 ++ .../rocketchat-message-pin/client/tabBar.js | 2 ++ .../server/publications/pinnedMessages.js | 2 ++ .../rocketchat-message-pin/server/settings.js | 2 ++ .../server/startup/indexes.js | 2 ++ .../client/actionButton.js | 2 ++ .../client/messageType.js | 1 + .../client/page/snippetPage.js | 1 + .../client/snippetMessage.js | 2 ++ .../client/tabBar/tabBar.js | 2 ++ .../server/methods/snippetMessage.js | 2 ++ .../server/publications/snippetedMessage.js | 2 ++ .../publications/snippetedMessagesByRoom.js | 2 ++ .../server/startup/settings.js | 2 ++ .../client/actionButton.js | 1 + .../client/starMessage.js | 2 ++ .../rocketchat-message-star/client/tabBar.js | 2 ++ .../server/publications/starredMessages.js | 2 ++ .../server/settings.js | 2 ++ .../server/starMessage.js | 2 ++ .../server/startup/indexes.js | 2 ++ packages/rocketchat-migrations/migrations.js | 1 + packages/rocketchat-nrr/nrr.js | 1 + .../admin/client/views/oauthApp.js | 2 ++ .../admin/server/methods/addOAuthApp.js | 1 + .../admin/server/methods/deleteOAuthApp.js | 2 ++ .../admin/server/methods/updateOAuthApp.js | 1 + .../admin/server/publications/oauthApps.js | 2 ++ .../oauth/client/oauth2-client.js | 2 ++ .../oauth/server/oauth2-server.js | 1 + .../client/oembedAudioWidget.js | 2 ++ .../client/oembedFrameWidget.js | 2 ++ .../client/oembedImageWidget.js | 2 ++ .../client/oembedSandstormGrain.js | 2 ++ .../client/oembedUrlWidget.js | 1 + .../client/oembedVideoWidget.js | 2 ++ .../client/oembedYoutubeWidget.js | 2 ++ .../rocketchat-oembed/server/jumpToMessage.js | 1 + packages/rocketchat-oembed/server/server.js | 1 + .../rocketchat-otr/client/rocketchat.otr.js | 2 ++ .../client/rocketchat.otr.room.js | 1 + packages/rocketchat-otr/client/tabBar.js | 2 ++ .../rocketchat-otr/client/views/otrFlexTab.js | 2 ++ .../server/methods/deleteOldOTRMessages.js | 2 ++ .../server/methods/updateOTRAck.js | 2 ++ .../client/tabBar.js | 2 ++ .../client/views/pushNotificationsFlexTab.js | 1 + packages/rocketchat-reactions/client/init.js | 2 ++ .../client/methods/setReaction.js | 1 + packages/rocketchat-reactions/setReaction.js | 1 + .../server/cronPruneMessages.js | 1 + .../client/powerboxListener.js | 2 ++ .../rocketchat-sandstorm/client/setPath.js | 2 ++ .../rocketchat-sandstorm/server/events.js | 2 +- .../rocketchat-sandstorm/server/powerbox.js | 1 + .../client/provider/result.js | 1 + .../rocketchat-search/client/search/search.js | 1 + .../server/provider/defaultProvider.js | 1 + .../server/service/providerService.js | 1 + .../server/service/validationService.js | 1 + .../rocketchat-setup-wizard/client/final.js | 2 ++ .../client/setupWizard.js | 2 ++ .../server/getSetupWizardParameters.js | 2 ++ .../server/RocketAdapter.js | 1 + .../rocketchat-slackbridge/server/settings.js | 2 ++ .../server/slackbridge_import.server.js | 2 ++ .../gimme.js | 1 + .../lenny.js | 1 + .../shrug.js | 1 + .../tableflip.js | 1 + .../unflip.js | 1 + .../server/server.js | 2 ++ .../server/server.js | 2 ++ .../rocketchat-slashcommands-help/server.js | 1 + .../server/hide.js | 1 + .../server/server.js | 1 + .../server/server.js | 1 + .../server/server.js | 2 +- .../server/server.js | 1 + .../rocketchat-slashcommands-leave/leave.js | 1 + packages/rocketchat-slashcommands-me/me.js | 1 + .../rocketchat-slashcommands-msg/server.js | 1 + .../server/mute.js | 1 + .../server/unmute.js | 1 + .../client/client.js | 2 ++ .../rocketchat-slashcommands-topic/topic.js | 2 ++ .../server/server.js | 2 ++ .../server/functions/generateEml.js | 1 + .../server/startup.js | 1 + packages/rocketchat-sms/SMS.js | 2 ++ packages/rocketchat-sms/settings.js | 2 ++ .../server/functions/get.js | 1 + .../server/methods/getStatistics.js | 2 ++ packages/rocketchat-theme/server/server.js | 1 + .../client/login_token_client.js | 2 ++ .../server/login_token_server.js | 1 + .../rocketchat-tokenpass/client/roomType.js | 1 + .../rocketchat-tokenpass/client/startup.js | 2 ++ .../client/tokenChannelsList.js | 2 ++ .../client/tokenpassChannelSettings.js | 2 ++ packages/rocketchat-tokenpass/common.js | 1 + .../server/cronRemoveUsers.js | 2 ++ .../getProtectedTokenpassBalances.js | 2 ++ .../functions/getPublicTokenpassBalances.js | 2 ++ .../server/functions/saveRoomTokens.js | 2 ++ .../functions/saveRoomTokensMinimumBalance.js | 1 + .../server/methods/findTokenChannels.js | 2 ++ .../server/methods/getChannelTokenpass.js | 2 ++ .../server/models/indexes.js | 2 ++ .../rocketchat-tokenpass/server/startup.js | 2 ++ .../client/accountIntegrations.js | 1 + .../client/avatar/avatar.js | 2 ++ .../client/avatar/prompt.js | 1 + .../rocketchat-ui-admin/client/adminInfo.js | 1 + .../client/rooms/channelSettingsDefault.js | 1 + .../client/users/adminInviteUser.js | 1 + .../client/users/adminUsers.js | 1 + .../publications/adminRooms.js | 1 + .../client/lib/startup.js | 2 ++ .../client/flexTabBar.js | 1 + .../client/tabs/inviteUsers.js | 1 + .../client/tabs/membersList.js | 1 + .../client/tabs/userEdit.js | 1 + .../client/tabs/userInfo.js | 1 + .../client/login/services.js | 1 + .../client/reset-password/resetPassword.js | 2 ++ .../client/username/username.js | 1 + .../rocketchat-ui-master/server/inject.js | 1 + .../client/popup/messagePopup.js | 1 + .../popup/messagePopupSlashCommandPreview.js | 1 + .../startup/messageBoxActions.js | 1 + .../client/createCombinedFlex.js | 1 + .../client/listChannelsFlex.js | 1 + .../client/listCombinedFlex.js | 1 + .../rocketchat-ui-sidenav/client/roomList.js | 1 + .../rocketchat-ui-sidenav/client/sideNav.js | 1 + .../client/sidebarHeader.js | 2 ++ .../client/sidebarItem.js | 1 + .../rocketchat-ui-sidenav/client/sortlist.js | 1 + .../rocketchat-ui-sidenav/client/toolbar.js | 1 + .../client/components/header/header.js | 1 + .../client/lib/RoomHistoryManager.js | 1 + .../rocketchat-ui/client/lib/accountBox.js | 1 + packages/rocketchat-ui/client/lib/accounts.js | 2 ++ .../lib/codeMirror/codeMirrorComponent.js | 1 + .../rocketchat-ui/client/lib/collections.js | 1 + .../client/lib/cordova/facebook-login.js | 2 ++ .../client/lib/cordova/keyboard-fix.js | 2 ++ .../rocketchat-ui/client/lib/cordova/push.js | 2 ++ .../rocketchat-ui/client/lib/cordova/urls.js | 2 ++ .../client/lib/cordova/user-state.js | 1 + .../rocketchat-ui/client/lib/fileUpload.js | 1 + .../client/lib/iframeCommands.js | 1 + .../rocketchat-ui/client/lib/msgTyping.js | 1 + .../rocketchat-ui/client/lib/readMessages.js | 15 +++++-------- .../client/views/404/roomNotFound.js | 2 ++ .../client/views/app/createChannel.js | 1 + .../client/views/app/directory.js | 1 + .../rocketchat-ui/client/views/app/modal.js | 1 + .../client/views/app/photoswipe.js | 1 + .../rocketchat-ui/client/views/app/popover.js | 1 + .../client/views/app/secretURL.js | 2 ++ .../client/views/app/videoCall/videoCall.js | 2 ++ .../rocketchat-ui/client/views/cmsPage.js | 2 ++ .../rocketchat-ui/getAvatarUrlFromUsername.js | 2 ++ .../server/cronProcessDownloads.js | 1 + .../rocketchat-version-check/client/client.js | 1 + .../server/functions/checkVersionUpdate.js | 1 + .../server/methods/banner_dismiss.js | 2 ++ .../rocketchat-version-check/server/server.js | 1 + .../rocketchat-videobridge/client/tabBar.js | 2 ++ .../client/views/videoFlexTabBbb.js | 1 + .../rocketchat-videobridge/lib/messageType.js | 2 ++ .../server/methods/jitsiSetTimeout.js | 2 ++ .../rocketchat-videobridge/server/settings.js | 2 ++ .../rocketchat-webdav/client/actionButton.js | 1 + .../client/addWebdavAccount.js | 1 + .../client/selectWebdavAccount.js | 1 + .../client/webdavFilePicker.js | 1 + .../server/methods/addWebdavAccount.js | 1 + .../server/methods/getFileFromWebdav.js | 1 + .../server/methods/getWebdavFileList.js | 1 + .../server/methods/removeWebdavAccount.js | 2 ++ .../server/methods/uploadFileToWebdav.js | 1 + .../server/publications/webdavAccounts.js | 2 ++ .../startup/messageBoxActions.js | 2 ++ .../rocketchat-webdav/startup/subscription.js | 2 ++ packages/rocketchat-wordpress/common.js | 1 + server/lib/cordova.js | 1 + server/methods/OEmbedCacheCleanup.js | 2 ++ server/methods/addAllUserToRoom.js | 2 ++ server/methods/afterVerifyEmail.js | 1 + server/methods/browseChannels.js | 1 + server/methods/canAccessRoom.js | 2 ++ server/methods/channelsList.js | 1 + server/methods/deleteFileMessage.js | 2 ++ server/methods/eraseRoom.js | 1 + server/methods/getAvatarSuggestion.js | 1 + server/methods/getRoomIdByNameOrId.js | 2 ++ server/methods/getRoomNameById.js | 2 ++ server/methods/getTotalChannels.js | 2 ++ server/methods/getUsernameSuggestion.js | 1 + server/methods/getUsersOfRoom.js | 2 ++ server/methods/hideRoom.js | 2 ++ server/methods/ignoreUser.js | 1 + server/methods/loadHistory.js | 2 ++ server/methods/loadLocale.js | 2 ++ server/methods/loadMissedMessages.js | 2 ++ server/methods/loadNextMessages.js | 1 + server/methods/loadSurroundingMessages.js | 1 + server/methods/logoutCleanUp.js | 2 ++ server/methods/messageSearch.js | 1 + server/methods/migrate.js | 2 ++ server/methods/muteUserInRoom.js | 2 ++ server/methods/openRoom.js | 2 ++ server/methods/readMessages.js | 1 + server/methods/registerUser.js | 1 + server/methods/removeRoomLeader.js | 2 ++ server/methods/removeRoomModerator.js | 2 ++ server/methods/removeRoomOwner.js | 2 ++ server/methods/removeUserFromRoom.js | 2 ++ server/methods/reportMessage.js | 2 ++ server/methods/requestDataDownload.js | 1 + server/methods/resetAvatar.js | 2 ++ server/methods/roomNameExists.js | 2 ++ server/methods/saveUserPreferences.js | 2 ++ server/methods/saveUserProfile.js | 2 ++ server/methods/sendConfirmationEmail.js | 1 + server/methods/sendForgotPasswordEmail.js | 1 + server/methods/setAvatarFromService.js | 2 ++ server/methods/setUserActiveStatus.js | 1 + server/methods/setUserPassword.js | 2 ++ server/methods/toogleFavorite.js | 2 ++ server/methods/unmuteUserInRoom.js | 2 ++ server/methods/userSetUtcOffset.js | 2 ++ server/publications/activeUsers.js | 2 ++ .../channelAndPrivateAutocomplete.js | 2 ++ server/publications/fullUserData.js | 2 ++ server/publications/messages.js | 1 + server/publications/room.js | 1 + server/publications/roomFiles.js | 1 + .../publications/roomFilesWithSearchText.js | 1 + .../publications/roomSubscriptionsByRole.js | 2 ++ server/publications/spotlight.js | 1 + server/publications/subscription.js | 2 ++ server/publications/userAutocomplete.js | 1 + server/publications/userChannels.js | 2 ++ server/publications/userData.js | 2 ++ server/startup/appcache.js | 2 ++ server/startup/avatar.js | 1 + server/startup/cron.js | 1 + server/startup/initialData.js | 1 + server/startup/migrations/v009.js | 2 ++ server/startup/migrations/v012.js | 2 ++ server/startup/migrations/v015.js | 2 ++ server/startup/migrations/v019.js | 1 + server/startup/migrations/v036.js | 1 + server/startup/migrations/v099.js | 1 + server/startup/migrations/v106.js | 1 + server/startup/migrations/v123.js | 2 ++ server/startup/migrations/v130.js | 1 + server/startup/presence.js | 1 + server/startup/serverRunning.js | 1 + 480 files changed, 724 insertions(+), 23 deletions(-) diff --git a/.eslintrc b/.eslintrc index 75450d624d50..42e4850f3e0d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -36,7 +36,6 @@ "LivechatTrigger" : false, "Logger" : false, "Match" : false, - "Meteor" : false, "modal" : false, "moment" : false, "Mongo" : false, diff --git a/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js b/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js index a48cbe20ad22..c7e3af1786b0 100644 --- a/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js +++ b/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js @@ -1,4 +1,6 @@ /* globals getEmojiUrlFromName:true, updateEmojiCustom:true, deleteEmojiCustom:true, isSetNotNull */ +import { Meteor } from 'meteor/meteor'; + RocketChat.emoji.packages.emojiCustom = { emojiCategories: { rocket: 'Custom' }, toneList: {}, diff --git a/packages/rocketchat-emoji-custom/client/notifications/updateEmojiCustom.js b/packages/rocketchat-emoji-custom/client/notifications/updateEmojiCustom.js index afabb4786e00..ccf55478b603 100644 --- a/packages/rocketchat-emoji-custom/client/notifications/updateEmojiCustom.js +++ b/packages/rocketchat-emoji-custom/client/notifications/updateEmojiCustom.js @@ -1,4 +1,6 @@ /* globals updateEmojiCustom */ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(() => RocketChat.Notifications.onLogged('updateEmojiCustom', (data) => updateEmojiCustom(data.emojiData)) ); diff --git a/packages/rocketchat-iframe-login/iframe_client.js b/packages/rocketchat-iframe-login/iframe_client.js index fc883fd38192..addb273fc868 100644 --- a/packages/rocketchat-iframe-login/iframe_client.js +++ b/packages/rocketchat-iframe-login/iframe_client.js @@ -1,5 +1,6 @@ /* globals Accounts, Tracker, ReactiveVar, FlowRouter, Accounts, HTTP, facebookConnectPlugin, TwitterConnect, OAuth */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; const { _unstoreLoginToken } = Accounts; diff --git a/packages/rocketchat-lib/client/UserDeleted.js b/packages/rocketchat-lib/client/UserDeleted.js index 22defd1eb85a..5468241d847f 100644 --- a/packages/rocketchat-lib/client/UserDeleted.js +++ b/packages/rocketchat-lib/client/UserDeleted.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.Notifications.onLogged('Users:Deleted', ({ userId }) => ChatMessage.remove({ diff --git a/packages/rocketchat-lib/client/lib/RocketChatAnnouncement.js b/packages/rocketchat-lib/client/lib/RocketChatAnnouncement.js index f872c0a2249c..a220b388906c 100644 --- a/packages/rocketchat-lib/client/lib/RocketChatAnnouncement.js +++ b/packages/rocketchat-lib/client/lib/RocketChatAnnouncement.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + export class RocketChatAnnouncement { constructor(args = {}) { this.room = new ReactiveVar(args.room); diff --git a/packages/rocketchat-lib/server/lib/roomTypes.js b/packages/rocketchat-lib/server/lib/roomTypes.js index e6ee83c8bf70..a1cdabe20977 100644 --- a/packages/rocketchat-lib/server/lib/roomTypes.js +++ b/packages/rocketchat-lib/server/lib/roomTypes.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { RoomTypesCommon } from '../../lib/RoomTypesCommon'; RocketChat.roomTypes = new class roomTypesServer extends RoomTypesCommon { diff --git a/packages/rocketchat-lib/server/lib/sendNotificationsOnMessage.js b/packages/rocketchat-lib/server/lib/sendNotificationsOnMessage.js index 345dc856c54a..f7d4690e007a 100644 --- a/packages/rocketchat-lib/server/lib/sendNotificationsOnMessage.js +++ b/packages/rocketchat-lib/server/lib/sendNotificationsOnMessage.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import moment from 'moment'; import { callJoinRoom, messageContainsHighlight, parseMessageTextPerUser, replaceMentionedUsernamesWithFullNames } from '../functions/notifications/'; diff --git a/packages/rocketchat-lib/server/lib/validateEmailDomain.js b/packages/rocketchat-lib/server/lib/validateEmailDomain.js index d964b6b63186..005dab6506cb 100644 --- a/packages/rocketchat-lib/server/lib/validateEmailDomain.js +++ b/packages/rocketchat-lib/server/lib/validateEmailDomain.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import dns from 'dns'; diff --git a/packages/rocketchat-lib/server/methods/addUserToRoom.js b/packages/rocketchat-lib/server/methods/addUserToRoom.js index 26255dad2ad7..f9ba0efd95fa 100644 --- a/packages/rocketchat-lib/server/methods/addUserToRoom.js +++ b/packages/rocketchat-lib/server/methods/addUserToRoom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ addUserToRoom(data) { return Meteor.call('addUsersToRoom', { diff --git a/packages/rocketchat-lib/server/methods/checkRegistrationSecretURL.js b/packages/rocketchat-lib/server/methods/checkRegistrationSecretURL.js index 0997b067c073..e996a7d503a5 100644 --- a/packages/rocketchat-lib/server/methods/checkRegistrationSecretURL.js +++ b/packages/rocketchat-lib/server/methods/checkRegistrationSecretURL.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ checkRegistrationSecretURL(hash) { diff --git a/packages/rocketchat-lib/server/methods/checkUsernameAvailability.js b/packages/rocketchat-lib/server/methods/checkUsernameAvailability.js index e935ce636dbf..28cce1f0d9bd 100644 --- a/packages/rocketchat-lib/server/methods/checkUsernameAvailability.js +++ b/packages/rocketchat-lib/server/methods/checkUsernameAvailability.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ checkUsernameAvailability(username) { check(username, String); diff --git a/packages/rocketchat-lib/server/methods/cleanRoomHistory.js b/packages/rocketchat-lib/server/methods/cleanRoomHistory.js index ae85a34e82d4..c2ae1ad78ab4 100644 --- a/packages/rocketchat-lib/server/methods/cleanRoomHistory.js +++ b/packages/rocketchat-lib/server/methods/cleanRoomHistory.js @@ -1,4 +1,5 @@ /* globals FileUpload */ +import { Meteor } from 'meteor/meteor'; Meteor.methods({ cleanRoomHistory({ roomId, latest, oldest, inclusive = true, limit, excludePinned = false, filesOnly = false, fromUsers = [] }) { diff --git a/packages/rocketchat-lib/server/methods/createChannel.js b/packages/rocketchat-lib/server/methods/createChannel.js index 223534ce83b4..fee80fdd4e58 100644 --- a/packages/rocketchat-lib/server/methods/createChannel.js +++ b/packages/rocketchat-lib/server/methods/createChannel.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ createChannel(name, members, readOnly = false, customFields = {}, extraData = {}) { check(name, String); diff --git a/packages/rocketchat-lib/server/methods/createPrivateGroup.js b/packages/rocketchat-lib/server/methods/createPrivateGroup.js index 7b2fd11240d2..7f40cf14f141 100644 --- a/packages/rocketchat-lib/server/methods/createPrivateGroup.js +++ b/packages/rocketchat-lib/server/methods/createPrivateGroup.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ createPrivateGroup(name, members, readOnly = false, customFields = {}, extraData = {}) { check(name, String); diff --git a/packages/rocketchat-lib/server/methods/createToken.js b/packages/rocketchat-lib/server/methods/createToken.js index b066cfda3e3e..0dc8711b9df2 100644 --- a/packages/rocketchat-lib/server/methods/createToken.js +++ b/packages/rocketchat-lib/server/methods/createToken.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ createToken(userId) { if (Meteor.userId() !== userId && !RocketChat.authz.hasPermission(Meteor.userId(), 'user-generate-access-token')) { diff --git a/packages/rocketchat-lib/server/methods/executeSlashCommandPreview.js b/packages/rocketchat-lib/server/methods/executeSlashCommandPreview.js index 3dbb8bb8e9f4..50460526fd37 100644 --- a/packages/rocketchat-lib/server/methods/executeSlashCommandPreview.js +++ b/packages/rocketchat-lib/server/methods/executeSlashCommandPreview.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ executeSlashCommandPreview(command, preview) { if (!Meteor.userId()) { diff --git a/packages/rocketchat-lib/server/methods/filterATAllTag.js b/packages/rocketchat-lib/server/methods/filterATAllTag.js index 645311691d4b..906e68af624f 100644 --- a/packages/rocketchat-lib/server/methods/filterATAllTag.js +++ b/packages/rocketchat-lib/server/methods/filterATAllTag.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; RocketChat.callbacks.add('beforeSaveMessage', function(message) { diff --git a/packages/rocketchat-lib/server/methods/filterATHereTag.js b/packages/rocketchat-lib/server/methods/filterATHereTag.js index 07cf9a9c5364..a5765967de4e 100644 --- a/packages/rocketchat-lib/server/methods/filterATHereTag.js +++ b/packages/rocketchat-lib/server/methods/filterATHereTag.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; RocketChat.callbacks.add('beforeSaveMessage', function(message) { diff --git a/packages/rocketchat-lib/server/methods/getChannelHistory.js b/packages/rocketchat-lib/server/methods/getChannelHistory.js index 440fd1e63a24..448133c7183b 100644 --- a/packages/rocketchat-lib/server/methods/getChannelHistory.js +++ b/packages/rocketchat-lib/server/methods/getChannelHistory.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/methods/getFullUserData.js b/packages/rocketchat-lib/server/methods/getFullUserData.js index c8b31309d2da..e65628ecc7f0 100644 --- a/packages/rocketchat-lib/server/methods/getFullUserData.js +++ b/packages/rocketchat-lib/server/methods/getFullUserData.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ getFullUserData({ filter = '', username = '', limit = 1 }) { const result = RocketChat.getFullUserData({ userId: Meteor.userId(), filter: filter || username, limit }); diff --git a/packages/rocketchat-lib/server/methods/getRoomJoinCode.js b/packages/rocketchat-lib/server/methods/getRoomJoinCode.js index 30c7861d56d0..af4dd9515c97 100644 --- a/packages/rocketchat-lib/server/methods/getRoomJoinCode.js +++ b/packages/rocketchat-lib/server/methods/getRoomJoinCode.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ getRoomJoinCode(rid) { check(rid, String); diff --git a/packages/rocketchat-lib/server/methods/getRoomRoles.js b/packages/rocketchat-lib/server/methods/getRoomRoles.js index af0afd0f5c5a..e05bb281657a 100644 --- a/packages/rocketchat-lib/server/methods/getRoomRoles.js +++ b/packages/rocketchat-lib/server/methods/getRoomRoles.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/methods/getServerInfo.js b/packages/rocketchat-lib/server/methods/getServerInfo.js index 6b6155a4d5a2..7c91ded54a60 100644 --- a/packages/rocketchat-lib/server/methods/getServerInfo.js +++ b/packages/rocketchat-lib/server/methods/getServerInfo.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ getServerInfo() { return RocketChat.Info; diff --git a/packages/rocketchat-lib/server/methods/getSingleMessage.js b/packages/rocketchat-lib/server/methods/getSingleMessage.js index 06ea858fe903..e6c179a39d74 100644 --- a/packages/rocketchat-lib/server/methods/getSingleMessage.js +++ b/packages/rocketchat-lib/server/methods/getSingleMessage.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ getSingleMessage(msgId) { check(msgId, String); diff --git a/packages/rocketchat-lib/server/methods/getSlashCommandPreviews.js b/packages/rocketchat-lib/server/methods/getSlashCommandPreviews.js index 4532f04b017e..b3ddb974d683 100644 --- a/packages/rocketchat-lib/server/methods/getSlashCommandPreviews.js +++ b/packages/rocketchat-lib/server/methods/getSlashCommandPreviews.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ getSlashCommandPreviews(command) { if (!Meteor.userId()) { diff --git a/packages/rocketchat-lib/server/methods/getUserRoles.js b/packages/rocketchat-lib/server/methods/getUserRoles.js index 1efce2aa74e9..a0c5ad940f44 100644 --- a/packages/rocketchat-lib/server/methods/getUserRoles.js +++ b/packages/rocketchat-lib/server/methods/getUserRoles.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/methods/insertOrUpdateUser.js b/packages/rocketchat-lib/server/methods/insertOrUpdateUser.js index b6a95378fa9d..16a449b81204 100644 --- a/packages/rocketchat-lib/server/methods/insertOrUpdateUser.js +++ b/packages/rocketchat-lib/server/methods/insertOrUpdateUser.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ insertOrUpdateUser(userData) { diff --git a/packages/rocketchat-lib/server/methods/joinDefaultChannels.js b/packages/rocketchat-lib/server/methods/joinDefaultChannels.js index c2f3f5c69727..835e41d09f73 100644 --- a/packages/rocketchat-lib/server/methods/joinDefaultChannels.js +++ b/packages/rocketchat-lib/server/methods/joinDefaultChannels.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ joinDefaultChannels(silenced) { check(silenced, Match.Optional(Boolean)); diff --git a/packages/rocketchat-lib/server/methods/joinRoom.js b/packages/rocketchat-lib/server/methods/joinRoom.js index 98a466668688..4d1416409c0c 100644 --- a/packages/rocketchat-lib/server/methods/joinRoom.js +++ b/packages/rocketchat-lib/server/methods/joinRoom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ joinRoom(rid, code) { check(rid, String); diff --git a/packages/rocketchat-lib/server/methods/leaveRoom.js b/packages/rocketchat-lib/server/methods/leaveRoom.js index b4b5471a87e0..42e8733411c5 100644 --- a/packages/rocketchat-lib/server/methods/leaveRoom.js +++ b/packages/rocketchat-lib/server/methods/leaveRoom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ leaveRoom(rid) { diff --git a/packages/rocketchat-lib/server/methods/refreshOAuthService.js b/packages/rocketchat-lib/server/methods/refreshOAuthService.js index 01fbfc675af6..15c923a2e867 100644 --- a/packages/rocketchat-lib/server/methods/refreshOAuthService.js +++ b/packages/rocketchat-lib/server/methods/refreshOAuthService.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ refreshOAuthService() { if (!Meteor.userId()) { diff --git a/packages/rocketchat-lib/server/methods/removeOAuthService.js b/packages/rocketchat-lib/server/methods/removeOAuthService.js index 6faa27d1a538..704dce2954e5 100644 --- a/packages/rocketchat-lib/server/methods/removeOAuthService.js +++ b/packages/rocketchat-lib/server/methods/removeOAuthService.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/methods/restartServer.js b/packages/rocketchat-lib/server/methods/restartServer.js index 544203fcc401..dba153b4edb3 100644 --- a/packages/rocketchat-lib/server/methods/restartServer.js +++ b/packages/rocketchat-lib/server/methods/restartServer.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ restart_server() { if (!Meteor.userId()) { diff --git a/packages/rocketchat-lib/server/methods/robotMethods.js b/packages/rocketchat-lib/server/methods/robotMethods.js index 7fe8807972ae..dca1f92cbcc2 100644 --- a/packages/rocketchat-lib/server/methods/robotMethods.js +++ b/packages/rocketchat-lib/server/methods/robotMethods.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/methods/saveSetting.js b/packages/rocketchat-lib/server/methods/saveSetting.js index eb804d8e93a9..04f891f967ef 100644 --- a/packages/rocketchat-lib/server/methods/saveSetting.js +++ b/packages/rocketchat-lib/server/methods/saveSetting.js @@ -1,4 +1,5 @@ /* eslint new-cap: 0 */ +import { Meteor } from 'meteor/meteor'; Meteor.methods({ saveSetting(_id, value, editor) { diff --git a/packages/rocketchat-lib/server/methods/sendInvitationEmail.js b/packages/rocketchat-lib/server/methods/sendInvitationEmail.js index aeeb2a0c7fd5..6dc9c0236966 100644 --- a/packages/rocketchat-lib/server/methods/sendInvitationEmail.js +++ b/packages/rocketchat-lib/server/methods/sendInvitationEmail.js @@ -1,4 +1,6 @@ +import { Meteor } from 'meteor/meteor'; import * as Mailer from 'meteor/rocketchat:mailer'; + let html = ''; Meteor.startup(() => { Mailer.getTemplate('Invitation_Email', (value) => { diff --git a/packages/rocketchat-lib/server/methods/sendMessage.js b/packages/rocketchat-lib/server/methods/sendMessage.js index 881daebd0206..bfec23de3dd4 100644 --- a/packages/rocketchat-lib/server/methods/sendMessage.js +++ b/packages/rocketchat-lib/server/methods/sendMessage.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import moment from 'moment'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/methods/sendSMTPTestEmail.js b/packages/rocketchat-lib/server/methods/sendSMTPTestEmail.js index 22a8abeb2cd6..1c9001e880d6 100644 --- a/packages/rocketchat-lib/server/methods/sendSMTPTestEmail.js +++ b/packages/rocketchat-lib/server/methods/sendSMTPTestEmail.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import * as Mailer from 'meteor/rocketchat:mailer'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/methods/setAdminStatus.js b/packages/rocketchat-lib/server/methods/setAdminStatus.js index cd73e86925e0..af2deea01945 100644 --- a/packages/rocketchat-lib/server/methods/setAdminStatus.js +++ b/packages/rocketchat-lib/server/methods/setAdminStatus.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ setAdminStatus(userId, admin) { diff --git a/packages/rocketchat-lib/server/methods/setEmail.js b/packages/rocketchat-lib/server/methods/setEmail.js index 36c1553e05af..f0e8aac4e164 100644 --- a/packages/rocketchat-lib/server/methods/setEmail.js +++ b/packages/rocketchat-lib/server/methods/setEmail.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ setEmail(email) { diff --git a/packages/rocketchat-lib/server/methods/setRealName.js b/packages/rocketchat-lib/server/methods/setRealName.js index 297b2e4b535a..ffbba773999f 100644 --- a/packages/rocketchat-lib/server/methods/setRealName.js +++ b/packages/rocketchat-lib/server/methods/setRealName.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ setRealName(name) { diff --git a/packages/rocketchat-lib/server/methods/setUsername.js b/packages/rocketchat-lib/server/methods/setUsername.js index de6449368010..ca5ba332f3d7 100644 --- a/packages/rocketchat-lib/server/methods/setUsername.js +++ b/packages/rocketchat-lib/server/methods/setUsername.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/methods/unarchiveRoom.js b/packages/rocketchat-lib/server/methods/unarchiveRoom.js index 519422548d40..3028d09263e3 100644 --- a/packages/rocketchat-lib/server/methods/unarchiveRoom.js +++ b/packages/rocketchat-lib/server/methods/unarchiveRoom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ unarchiveRoom(rid) { diff --git a/packages/rocketchat-lib/server/methods/unblockUser.js b/packages/rocketchat-lib/server/methods/unblockUser.js index f834d219673b..b04ccca58a20 100644 --- a/packages/rocketchat-lib/server/methods/unblockUser.js +++ b/packages/rocketchat-lib/server/methods/unblockUser.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ unblockUser({ rid, blocked }) { diff --git a/packages/rocketchat-lib/server/methods/updateMessage.js b/packages/rocketchat-lib/server/methods/updateMessage.js index c0e389f0c6af..9ce9bb028280 100644 --- a/packages/rocketchat-lib/server/methods/updateMessage.js +++ b/packages/rocketchat-lib/server/methods/updateMessage.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import moment from 'moment'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/models/Messages.js b/packages/rocketchat-lib/server/models/Messages.js index fd25dbd8d492..970867400b66 100644 --- a/packages/rocketchat-lib/server/models/Messages.js +++ b/packages/rocketchat-lib/server/models/Messages.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; RocketChat.models.Messages = new class extends RocketChat.models._Base { diff --git a/packages/rocketchat-lib/server/models/Users.js b/packages/rocketchat-lib/server/models/Users.js index 70381872451c..87fe3900e332 100644 --- a/packages/rocketchat-lib/server/models/Users.js +++ b/packages/rocketchat-lib/server/models/Users.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-lib/server/oauth/oauth.js b/packages/rocketchat-lib/server/oauth/oauth.js index 60de62f04be5..71cf29905869 100644 --- a/packages/rocketchat-lib/server/oauth/oauth.js +++ b/packages/rocketchat-lib/server/oauth/oauth.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; const AccessTokenServices = {}; diff --git a/packages/rocketchat-lib/server/oauth/twitter.js b/packages/rocketchat-lib/server/oauth/twitter.js index 8585aef8ea7d..1c542b1d8e7e 100644 --- a/packages/rocketchat-lib/server/oauth/twitter.js +++ b/packages/rocketchat-lib/server/oauth/twitter.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import Twit from 'twit'; import _ from 'underscore'; diff --git a/packages/rocketchat-lib/server/publications/settings.js b/packages/rocketchat-lib/server/publications/settings.js index 0b9388534e30..9f05a9465621 100644 --- a/packages/rocketchat-lib/server/publications/settings.js +++ b/packages/rocketchat-lib/server/publications/settings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'public-settings/get'(updatedAt) { this.unblock(); diff --git a/packages/rocketchat-lib/server/startup/oAuthServicesUpdate.js b/packages/rocketchat-lib/server/startup/oAuthServicesUpdate.js index 246cfb672593..766c4a231494 100644 --- a/packages/rocketchat-lib/server/startup/oAuthServicesUpdate.js +++ b/packages/rocketchat-lib/server/startup/oAuthServicesUpdate.js @@ -1,4 +1,5 @@ /* globals CustomOAuth */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; const logger = new Logger('rocketchat:lib', { diff --git a/packages/rocketchat-lib/server/startup/settingsOnLoadCdnPrefix.js b/packages/rocketchat-lib/server/startup/settingsOnLoadCdnPrefix.js index d76ab7f7d760..8e3ada873bb7 100644 --- a/packages/rocketchat-lib/server/startup/settingsOnLoadCdnPrefix.js +++ b/packages/rocketchat-lib/server/startup/settingsOnLoadCdnPrefix.js @@ -1,4 +1,5 @@ /* globals WebAppInternals*/ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; function testWebAppInternals(fn) { diff --git a/packages/rocketchat-lib/server/startup/settingsOnLoadDirectReply.js b/packages/rocketchat-lib/server/startup/settingsOnLoadDirectReply.js index 54b746c7f395..b0a532295b21 100644 --- a/packages/rocketchat-lib/server/startup/settingsOnLoadDirectReply.js +++ b/packages/rocketchat-lib/server/startup/settingsOnLoadDirectReply.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import { IMAPIntercepter, POP3Helper } from '../lib/interceptDirectReplyEmails.js'; diff --git a/packages/rocketchat-lib/server/startup/settingsOnLoadSMTP.js b/packages/rocketchat-lib/server/startup/settingsOnLoadSMTP.js index d70d684a876a..bab4eac13ba2 100644 --- a/packages/rocketchat-lib/server/startup/settingsOnLoadSMTP.js +++ b/packages/rocketchat-lib/server/startup/settingsOnLoadSMTP.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; const buildMailURL = _.debounce(function() { diff --git a/packages/rocketchat-livechat/.app/client/lib/CustomFields.js b/packages/rocketchat-livechat/.app/client/lib/CustomFields.js index 4f37bf08c86c..fe1bb0df99a1 100644 --- a/packages/rocketchat-livechat/.app/client/lib/CustomFields.js +++ b/packages/rocketchat-livechat/.app/client/lib/CustomFields.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import visitor from '../../imports/client/visitor'; this.CustomFields = (function() { diff --git a/packages/rocketchat-livechat/.app/client/lib/LivechatFileUpload.js b/packages/rocketchat-livechat/.app/client/lib/LivechatFileUpload.js index 9d0b4e94221a..05e749a0df3f 100644 --- a/packages/rocketchat-livechat/.app/client/lib/LivechatFileUpload.js +++ b/packages/rocketchat-livechat/.app/client/lib/LivechatFileUpload.js @@ -1,5 +1,6 @@ /* globals fileUpload, Livechat, Handlebars, showError, sendFileUpload */ /* exported LivechatFileUpload, fileUpload, sendFileUpload */ +import { Meteor } from 'meteor/meteor'; import visitor from '../../imports/client/visitor'; import swal from 'sweetalert2'; diff --git a/packages/rocketchat-livechat/.app/client/lib/LivechatVideoCall.js b/packages/rocketchat-livechat/.app/client/lib/LivechatVideoCall.js index e22e7046950f..feb456ed82f8 100644 --- a/packages/rocketchat-livechat/.app/client/lib/LivechatVideoCall.js +++ b/packages/rocketchat-livechat/.app/client/lib/LivechatVideoCall.js @@ -1,4 +1,5 @@ /* globals LivechatVideoCall, cordova, JitsiMeetExternalAPI */ +import { Meteor } from 'meteor/meteor'; import visitor from '../../imports/client/visitor'; LivechatVideoCall = new (class LivechatVideoCall { diff --git a/packages/rocketchat-livechat/.app/client/lib/_livechat.js b/packages/rocketchat-livechat/.app/client/lib/_livechat.js index 84c464776b9d..fddfc5040f87 100644 --- a/packages/rocketchat-livechat/.app/client/lib/_livechat.js +++ b/packages/rocketchat-livechat/.app/client/lib/_livechat.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import visitor from '../../imports/client/visitor'; this.Livechat = new (class Livechat { diff --git a/packages/rocketchat-livechat/.app/client/lib/chatMessages.js b/packages/rocketchat-livechat/.app/client/lib/chatMessages.js index 65589f9ecd21..98bdb93c1cbf 100644 --- a/packages/rocketchat-livechat/.app/client/lib/chatMessages.js +++ b/packages/rocketchat-livechat/.app/client/lib/chatMessages.js @@ -1,4 +1,5 @@ /* globals MsgTyping, showError, Livechat */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; @@ -258,16 +259,16 @@ this.ChatMessages = class ChatMessages { this.clearEditing(); return; } - // else if k is 38 or k is 40 # Arrow Up or down - // if k is 38 - // return if input.value.slice(0, input.selectionStart).match(/[\n]/) isnt null - // this.toPrevMessage() - // else - // return if input.value.slice(input.selectionEnd, input.value.length).match(/[\n]/) isnt null - // this.toNextMessage() - - // event.preventDefault() - // event.stopPropagation() + // else if k is 38 or k is 40 # Arrow Up or down + // if k is 38 + // return if input.value.slice(0, input.selectionStart).match(/[\n]/) isnt null + // this.toPrevMessage() + // else + // return if input.value.slice(input.selectionEnd, input.value.length).match(/[\n]/) isnt null + // this.toNextMessage() + + // event.preventDefault() + // event.stopPropagation() // ctrl (command) + shift + k -> clear room messages } else if (k === 75 && ((navigator.platform.indexOf('Mac') !== -1 && event.metaKey && event.shiftKey) || (navigator.platform.indexOf('Mac') === -1 && event.ctrlKey && event.shiftKey))) { diff --git a/packages/rocketchat-livechat/.app/client/lib/commands.js b/packages/rocketchat-livechat/.app/client/lib/commands.js index 0d27c636b3ac..8fdc0dc0bd88 100644 --- a/packages/rocketchat-livechat/.app/client/lib/commands.js +++ b/packages/rocketchat-livechat/.app/client/lib/commands.js @@ -1,4 +1,5 @@ /* globals LivechatVideoCall, Livechat */ +import { Meteor } from 'meteor/meteor'; import swal from 'sweetalert2'; import visitor from '../../imports/client/visitor'; diff --git a/packages/rocketchat-livechat/.app/client/lib/fromApp/Notifications.js b/packages/rocketchat-livechat/.app/client/lib/fromApp/Notifications.js index 362962b4bb8a..4a544ca9678f 100644 --- a/packages/rocketchat-livechat/.app/client/lib/fromApp/Notifications.js +++ b/packages/rocketchat-livechat/.app/client/lib/fromApp/Notifications.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import visitor from '../../../imports/client/visitor'; this.Notifications = new class { diff --git a/packages/rocketchat-livechat/.app/client/lib/fromApp/RoomHistoryManager.js b/packages/rocketchat-livechat/.app/client/lib/fromApp/RoomHistoryManager.js index 085e4b7d8eb2..76a64bdbc905 100644 --- a/packages/rocketchat-livechat/.app/client/lib/fromApp/RoomHistoryManager.js +++ b/packages/rocketchat-livechat/.app/client/lib/fromApp/RoomHistoryManager.js @@ -1,5 +1,6 @@ /* globals readMessage UserRoles RoomRoles*/ +import { Meteor } from 'meteor/meteor'; import visitor from '../../../imports/client/visitor'; import _ from 'underscore'; diff --git a/packages/rocketchat-livechat/.app/client/lib/fromApp/avatar.js b/packages/rocketchat-livechat/.app/client/lib/fromApp/avatar.js index 553e602278b4..616627dac694 100644 --- a/packages/rocketchat-livechat/.app/client/lib/fromApp/avatar.js +++ b/packages/rocketchat-livechat/.app/client/lib/fromApp/avatar.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + this.getAvatarUrlFromUsername = (username) => { const key = `avatar_random_${ username }`; const random = Session.keys[key] || 0; diff --git a/packages/rocketchat-livechat/.app/client/lib/hooks.js b/packages/rocketchat-livechat/.app/client/lib/hooks.js index ca3df574084d..9bbf720933bb 100644 --- a/packages/rocketchat-livechat/.app/client/lib/hooks.js +++ b/packages/rocketchat-livechat/.app/client/lib/hooks.js @@ -1,4 +1,5 @@ /* globals CustomFields, Livechat */ +import { Meteor } from 'meteor/meteor'; import visitor from '../../imports/client/visitor'; const api = { diff --git a/packages/rocketchat-livechat/.app/client/lib/msgTyping.js b/packages/rocketchat-livechat/.app/client/lib/msgTyping.js index ed549cc9bde9..a4222d404c95 100644 --- a/packages/rocketchat-livechat/.app/client/lib/msgTyping.js +++ b/packages/rocketchat-livechat/.app/client/lib/msgTyping.js @@ -1,4 +1,5 @@ /* globals Notifications, Livechat */ +import { Meteor } from 'meteor/meteor'; import visitor from '../../imports/client/visitor'; import _ from 'underscore'; diff --git a/packages/rocketchat-livechat/.app/client/lib/triggers.js b/packages/rocketchat-livechat/.app/client/lib/triggers.js index 0ef016171279..a69720f3f39d 100644 --- a/packages/rocketchat-livechat/.app/client/lib/triggers.js +++ b/packages/rocketchat-livechat/.app/client/lib/triggers.js @@ -1,4 +1,5 @@ /* globals Livechat */ +import { Meteor } from 'meteor/meteor'; import visitor from '../../imports/client/visitor'; const firedTriggers = JSON.parse(localStorage.getItem('rocketChatFiredTriggers')) || []; diff --git a/packages/rocketchat-livechat/.app/client/methods/sendMessageExternal.js b/packages/rocketchat-livechat/.app/client/methods/sendMessageExternal.js index 8e67ccd678f5..93fed539c92f 100644 --- a/packages/rocketchat-livechat/.app/client/methods/sendMessageExternal.js +++ b/packages/rocketchat-livechat/.app/client/methods/sendMessageExternal.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import visitor from '../../imports/client/visitor'; import s from 'underscore.string'; diff --git a/packages/rocketchat-livechat/.app/client/startup/customFields.js b/packages/rocketchat-livechat/.app/client/startup/customFields.js index d0e7899ecc9c..f8fd2a4a62f3 100644 --- a/packages/rocketchat-livechat/.app/client/startup/customFields.js +++ b/packages/rocketchat-livechat/.app/client/startup/customFields.js @@ -1,4 +1,5 @@ /* globals CustomFields */ +import { Meteor } from 'meteor/meteor'; Meteor.startup(function() { CustomFields.init(); diff --git a/packages/rocketchat-livechat/.app/client/startup/visitor.js b/packages/rocketchat-livechat/.app/client/startup/visitor.js index 0917815e7a66..35748e0f0788 100644 --- a/packages/rocketchat-livechat/.app/client/startup/visitor.js +++ b/packages/rocketchat-livechat/.app/client/startup/visitor.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import visitor from '../../imports/client/visitor'; Meteor.startup(() => { diff --git a/packages/rocketchat-livechat/.app/client/views/avatar.js b/packages/rocketchat-livechat/.app/client/views/avatar.js index c2500afbdc0f..ec393892b0e7 100644 --- a/packages/rocketchat-livechat/.app/client/views/avatar.js +++ b/packages/rocketchat-livechat/.app/client/views/avatar.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import visitor from '../../imports/client/visitor'; Template.avatar.helpers({ diff --git a/packages/rocketchat-livechat/.app/client/views/livechatWindow.js b/packages/rocketchat-livechat/.app/client/views/livechatWindow.js index c63a081bdd3a..d34646294912 100644 --- a/packages/rocketchat-livechat/.app/client/views/livechatWindow.js +++ b/packages/rocketchat-livechat/.app/client/views/livechatWindow.js @@ -1,4 +1,5 @@ /* globals Department, Livechat, LivechatVideoCall */ +import { Meteor } from 'meteor/meteor'; import visitor from '../../imports/client/visitor'; function showDepartments() { diff --git a/packages/rocketchat-livechat/.app/client/views/messages.js b/packages/rocketchat-livechat/.app/client/views/messages.js index 299ae87c5c0b..d215a5845b92 100644 --- a/packages/rocketchat-livechat/.app/client/views/messages.js +++ b/packages/rocketchat-livechat/.app/client/views/messages.js @@ -1,4 +1,5 @@ /* globals Livechat, LivechatVideoCall, MsgTyping, fileUpload */ +import { Meteor } from 'meteor/meteor'; import visitor from '../../imports/client/visitor'; import _ from 'underscore'; import mime from 'mime-type/with-db'; diff --git a/packages/rocketchat-livechat/.app/client/views/offlineForm.js b/packages/rocketchat-livechat/.app/client/views/offlineForm.js index 10a1da0d3632..ca1742fef4cd 100644 --- a/packages/rocketchat-livechat/.app/client/views/offlineForm.js +++ b/packages/rocketchat-livechat/.app/client/views/offlineForm.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-livechat/.app/client/views/options.js b/packages/rocketchat-livechat/.app/client/views/options.js index 95c892697ea2..61ec20f8a1f9 100644 --- a/packages/rocketchat-livechat/.app/client/views/options.js +++ b/packages/rocketchat-livechat/.app/client/views/options.js @@ -1,4 +1,5 @@ /* globals Department, Livechat */ +import { Meteor } from 'meteor/meteor'; import swal from 'sweetalert2'; import visitor from '../../imports/client/visitor'; diff --git a/packages/rocketchat-livechat/.app/client/views/register.js b/packages/rocketchat-livechat/.app/client/views/register.js index 5bd8516a8998..1dd8bd91b21b 100644 --- a/packages/rocketchat-livechat/.app/client/views/register.js +++ b/packages/rocketchat-livechat/.app/client/views/register.js @@ -1,4 +1,5 @@ /* globals Department, Livechat, LivechatVideoCall */ +import { Meteor } from 'meteor/meteor'; import visitor from '../../imports/client/visitor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-livechat/.app/client/views/survey.js b/packages/rocketchat-livechat/.app/client/views/survey.js index b70ef65ad9cc..a5506238abec 100644 --- a/packages/rocketchat-livechat/.app/client/views/survey.js +++ b/packages/rocketchat-livechat/.app/client/views/survey.js @@ -1,4 +1,5 @@ /* globals */ +import { Meteor } from 'meteor/meteor'; import swal from 'sweetalert2'; import visitor from '../../imports/client/visitor'; diff --git a/packages/rocketchat-livechat/.app/client/views/switchDepartment.js b/packages/rocketchat-livechat/.app/client/views/switchDepartment.js index 648f4a441d1c..5f04075380d3 100644 --- a/packages/rocketchat-livechat/.app/client/views/switchDepartment.js +++ b/packages/rocketchat-livechat/.app/client/views/switchDepartment.js @@ -1,4 +1,5 @@ /* globals Department, Livechat */ +import { Meteor } from 'meteor/meteor'; import swal from 'sweetalert2'; import visitor from '../../imports/client/visitor'; diff --git a/packages/rocketchat-livechat/.app/imports/client/visitor.js b/packages/rocketchat-livechat/.app/imports/client/visitor.js index 9fadbeb79591..8a51ab48d797 100644 --- a/packages/rocketchat-livechat/.app/imports/client/visitor.js +++ b/packages/rocketchat-livechat/.app/imports/client/visitor.js @@ -1,4 +1,5 @@ /* globals Commands, Livechat, UserPresence */ +import { Meteor } from 'meteor/meteor'; const msgStream = new Meteor.Streamer('room-messages'); export default { diff --git a/packages/rocketchat-livechat/client/methods/changeLivechatStatus.js b/packages/rocketchat-livechat/client/methods/changeLivechatStatus.js index 3a996a3cf491..d98d97ca9038 100644 --- a/packages/rocketchat-livechat/client/methods/changeLivechatStatus.js +++ b/packages/rocketchat-livechat/client/methods/changeLivechatStatus.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:changeLivechatStatus'() { if (!Meteor.userId()) { diff --git a/packages/rocketchat-livechat/client/startup/notifyUnreadRooms.js b/packages/rocketchat-livechat/client/startup/notifyUnreadRooms.js index a95652f33f0d..b2330ad5e00c 100644 --- a/packages/rocketchat-livechat/client/startup/notifyUnreadRooms.js +++ b/packages/rocketchat-livechat/client/startup/notifyUnreadRooms.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + let audio = null; const stop = (audio) => { diff --git a/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalytics.js b/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalytics.js index 89e2c4932973..9584b02159bb 100644 --- a/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalytics.js +++ b/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalytics.js @@ -1,4 +1,5 @@ /* globals popover */ +import { Meteor } from 'meteor/meteor'; import moment from 'moment'; import { drawLineChart } from '../../../lib/chartHandler'; diff --git a/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationFacebook.js b/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationFacebook.js index 3d200e1e114c..be8ba6494be0 100644 --- a/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationFacebook.js +++ b/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationFacebook.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Template.livechatIntegrationFacebook.helpers({ pages() { return Template.instance().pages.get(); diff --git a/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationWebhook.js b/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationWebhook.js index 083989ce684f..ee78853ae6e1 100644 --- a/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationWebhook.js +++ b/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationWebhook.js @@ -1,4 +1,5 @@ /* globals LivechatIntegration */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatAppearance.js b/packages/rocketchat-livechat/client/views/app/livechatAppearance.js index 2776756385bd..a23eb5f812ed 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatAppearance.js +++ b/packages/rocketchat-livechat/client/views/app/livechatAppearance.js @@ -1,5 +1,6 @@ /* globals jscolor*/ /* eslint new-cap: ["error", { "newIsCapExceptions": ["jscolor"] }]*/ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; import moment from 'moment'; import toastr from 'toastr'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js b/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js index 8ef4e34a6825..5da996c4c799 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js +++ b/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import moment from 'moment'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatCustomFieldForm.js b/packages/rocketchat-livechat/client/views/app/livechatCustomFieldForm.js index bf5bbf6122c4..d37f0d04d0e4 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatCustomFieldForm.js +++ b/packages/rocketchat-livechat/client/views/app/livechatCustomFieldForm.js @@ -1,4 +1,6 @@ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; + Template.livechatCustomFieldForm.helpers({ customField() { return Template.instance().customField.get(); diff --git a/packages/rocketchat-livechat/client/views/app/livechatCustomFields.js b/packages/rocketchat-livechat/client/views/app/livechatCustomFields.js index c94c5404d77f..e1f7a2b01249 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatCustomFields.js +++ b/packages/rocketchat-livechat/client/views/app/livechatCustomFields.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Template.livechatCustomFields.helpers({ customFields() { return LivechatCustomField.find(); diff --git a/packages/rocketchat-livechat/client/views/app/livechatDepartmentForm.js b/packages/rocketchat-livechat/client/views/app/livechatDepartmentForm.js index 3a1b29591c49..ffada6274c48 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatDepartmentForm.js +++ b/packages/rocketchat-livechat/client/views/app/livechatDepartmentForm.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatDepartments.js b/packages/rocketchat-livechat/client/views/app/livechatDepartments.js index ef41de06a729..d36c5ee21677 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatDepartments.js +++ b/packages/rocketchat-livechat/client/views/app/livechatDepartments.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Template.livechatDepartments.helpers({ departments() { return LivechatDepartment.find(); diff --git a/packages/rocketchat-livechat/client/views/app/livechatOfficeHours.js b/packages/rocketchat-livechat/client/views/app/livechatOfficeHours.js index 08d45cb4f50d..88c22b84a0e4 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatOfficeHours.js +++ b/packages/rocketchat-livechat/client/views/app/livechatOfficeHours.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; /* globals LivechatOfficeHour */ import moment from 'moment'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatQueue.js b/packages/rocketchat-livechat/client/views/app/livechatQueue.js index c5fb695f6f7e..7925fa0bb58f 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatQueue.js +++ b/packages/rocketchat-livechat/client/views/app/livechatQueue.js @@ -1,4 +1,5 @@ /* globals LivechatQueueUser */ +import { Meteor } from 'meteor/meteor'; Template.livechatQueue.helpers({ departments() { diff --git a/packages/rocketchat-livechat/client/views/app/livechatTriggers.js b/packages/rocketchat-livechat/client/views/app/livechatTriggers.js index 63e67f12feda..8d987cf50b52 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatTriggers.js +++ b/packages/rocketchat-livechat/client/views/app/livechatTriggers.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Template.livechatTriggers.helpers({ triggers() { return LivechatTrigger.find(); diff --git a/packages/rocketchat-livechat/client/views/app/livechatTriggersForm.js b/packages/rocketchat-livechat/client/views/app/livechatTriggersForm.js index 595365f20c2e..565df148412f 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatTriggersForm.js +++ b/packages/rocketchat-livechat/client/views/app/livechatTriggersForm.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; Template.livechatTriggersForm.helpers({ name() { diff --git a/packages/rocketchat-livechat/client/views/app/livechatUsers.js b/packages/rocketchat-livechat/client/views/app/livechatUsers.js index 0918f5cf2183..b0ef030c6a0d 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatUsers.js +++ b/packages/rocketchat-livechat/client/views/app/livechatUsers.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import toastr from 'toastr'; let ManagerUsers; diff --git a/packages/rocketchat-livechat/client/views/app/tabbar/visitorEdit.js b/packages/rocketchat-livechat/client/views/app/tabbar/visitorEdit.js index 0f8d6dd0865a..e8267c986795 100644 --- a/packages/rocketchat-livechat/client/views/app/tabbar/visitorEdit.js +++ b/packages/rocketchat-livechat/client/views/app/tabbar/visitorEdit.js @@ -1,4 +1,5 @@ /* globals LivechatVisitor */ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; Template.visitorEdit.helpers({ diff --git a/packages/rocketchat-livechat/client/views/app/tabbar/visitorForward.js b/packages/rocketchat-livechat/client/views/app/tabbar/visitorForward.js index 1b56a48786cb..777e7141dd71 100644 --- a/packages/rocketchat-livechat/client/views/app/tabbar/visitorForward.js +++ b/packages/rocketchat-livechat/client/views/app/tabbar/visitorForward.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; Template.visitorForward.helpers({ visitor() { diff --git a/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js b/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js index 3785b310d2b8..7a95b9f62646 100644 --- a/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js +++ b/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js @@ -1,5 +1,6 @@ /* globals LivechatVisitor */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-livechat/client/views/sideNav/livechat.js b/packages/rocketchat-livechat/client/views/sideNav/livechat.js index 88a3bd3287d4..c5d053bc70bd 100644 --- a/packages/rocketchat-livechat/client/views/sideNav/livechat.js +++ b/packages/rocketchat-livechat/client/views/sideNav/livechat.js @@ -1,4 +1,6 @@ /* globals LivechatInquiry, KonchatNotification */ +import { Meteor } from 'meteor/meteor'; + Template.livechat.helpers({ isActive() { const query = { diff --git a/packages/rocketchat-livechat/config.js b/packages/rocketchat-livechat/config.js index 6a032491299a..f852de56051a 100644 --- a/packages/rocketchat-livechat/config.js +++ b/packages/rocketchat-livechat/config.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.settings.addGroup('Livechat'); diff --git a/packages/rocketchat-livechat/imports/server/rest/sms.js b/packages/rocketchat-livechat/imports/server/rest/sms.js index 1f4b9ccce173..a8d90481e232 100644 --- a/packages/rocketchat-livechat/imports/server/rest/sms.js +++ b/packages/rocketchat-livechat/imports/server/rest/sms.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import LivechatVisitors from '../../../server/models/LivechatVisitors'; RocketChat.API.v1.addRoute('livechat/sms-incoming/:service', { diff --git a/packages/rocketchat-livechat/imports/server/rest/upload.js b/packages/rocketchat-livechat/imports/server/rest/upload.js index f7e8078cd16f..37fe97ef1ee5 100644 --- a/packages/rocketchat-livechat/imports/server/rest/upload.js +++ b/packages/rocketchat-livechat/imports/server/rest/upload.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import Busboy from 'busboy'; import filesize from 'filesize'; import LivechatVisitors from '../../../server/models/LivechatVisitors'; diff --git a/packages/rocketchat-livechat/livechat.js b/packages/rocketchat-livechat/livechat.js index ad6654b70e52..5b79e2d35634 100644 --- a/packages/rocketchat-livechat/livechat.js +++ b/packages/rocketchat-livechat/livechat.js @@ -1,4 +1,5 @@ /* globals WebApp:true */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import url from 'url'; diff --git a/packages/rocketchat-livechat/messageTypes.js b/packages/rocketchat-livechat/messageTypes.js index 5b59e770edf7..364d0a8ae217 100644 --- a/packages/rocketchat-livechat/messageTypes.js +++ b/packages/rocketchat-livechat/messageTypes.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.MessageTypes.registerType({ id: 'livechat_navigation_history', system: true, diff --git a/packages/rocketchat-livechat/permissions.js b/packages/rocketchat-livechat/permissions.js index 8c6a00bcd6dc..78fac7adef60 100644 --- a/packages/rocketchat-livechat/permissions.js +++ b/packages/rocketchat-livechat/permissions.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.startup(() => { diff --git a/packages/rocketchat-livechat/server/api/v1/agent.js b/packages/rocketchat-livechat/server/api/v1/agent.js index 2543bb4befdd..c69b432e365e 100644 --- a/packages/rocketchat-livechat/server/api/v1/agent.js +++ b/packages/rocketchat-livechat/server/api/v1/agent.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { findRoom, findGuest, findAgent } from '../lib/livechat'; RocketChat.API.v1.addRoute('livechat/agent.info/:rid/:token', { diff --git a/packages/rocketchat-livechat/server/api/v1/customField.js b/packages/rocketchat-livechat/server/api/v1/customField.js index 810532dc621b..a1467f7062e8 100644 --- a/packages/rocketchat-livechat/server/api/v1/customField.js +++ b/packages/rocketchat-livechat/server/api/v1/customField.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { findGuest } from '../lib/livechat'; RocketChat.API.v1.addRoute('livechat/custom.field', { diff --git a/packages/rocketchat-livechat/server/api/v1/message.js b/packages/rocketchat-livechat/server/api/v1/message.js index e9d7046eea65..cf3936078bf2 100644 --- a/packages/rocketchat-livechat/server/api/v1/message.js +++ b/packages/rocketchat-livechat/server/api/v1/message.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import LivechatVisitors from '../../../server/models/LivechatVisitors'; import { findGuest, findRoom } from '../lib/livechat'; diff --git a/packages/rocketchat-livechat/server/api/v1/pageVisited.js b/packages/rocketchat-livechat/server/api/v1/pageVisited.js index 0744dc3c87a7..c917d224a2ed 100644 --- a/packages/rocketchat-livechat/server/api/v1/pageVisited.js +++ b/packages/rocketchat-livechat/server/api/v1/pageVisited.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import { findGuest, findRoom } from '../lib/livechat'; diff --git a/packages/rocketchat-livechat/server/api/v1/room.js b/packages/rocketchat-livechat/server/api/v1/room.js index a9dc08ab064d..08d3b7c93bbb 100644 --- a/packages/rocketchat-livechat/server/api/v1/room.js +++ b/packages/rocketchat-livechat/server/api/v1/room.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { findGuest, findRoom, getRoom, settings } from '../lib/livechat'; RocketChat.API.v1.addRoute('livechat/room', { diff --git a/packages/rocketchat-livechat/server/api/v1/videoCall.js b/packages/rocketchat-livechat/server/api/v1/videoCall.js index 36f1dfd3760b..00e4d44e1976 100644 --- a/packages/rocketchat-livechat/server/api/v1/videoCall.js +++ b/packages/rocketchat-livechat/server/api/v1/videoCall.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { findGuest, getRoom, settings } from '../lib/livechat'; RocketChat.API.v1.addRoute('livechat/video.call/:token', { diff --git a/packages/rocketchat-livechat/server/api/v1/visitor.js b/packages/rocketchat-livechat/server/api/v1/visitor.js index aabf281cb309..74f51e172ccd 100644 --- a/packages/rocketchat-livechat/server/api/v1/visitor.js +++ b/packages/rocketchat-livechat/server/api/v1/visitor.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import LivechatVisitors from '../../../server/models/LivechatVisitors'; RocketChat.API.v1.addRoute('livechat/visitor', { diff --git a/packages/rocketchat-livechat/server/hooks/externalMessage.js b/packages/rocketchat-livechat/server/hooks/externalMessage.js index e384c51dee49..0bf60cb29a9a 100644 --- a/packages/rocketchat-livechat/server/hooks/externalMessage.js +++ b/packages/rocketchat-livechat/server/hooks/externalMessage.js @@ -1,4 +1,5 @@ /* globals HTTP, SystemLogger */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; let knowledgeEnabled = false; diff --git a/packages/rocketchat-livechat/server/hooks/markRoomResponded.js b/packages/rocketchat-livechat/server/hooks/markRoomResponded.js index 9c4a26660d52..648e73a5824b 100644 --- a/packages/rocketchat-livechat/server/hooks/markRoomResponded.js +++ b/packages/rocketchat-livechat/server/hooks/markRoomResponded.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.callbacks.add('afterSaveMessage', function(message, room) { // skips this callback if the message was edited if (!message || message.editedAt) { diff --git a/packages/rocketchat-livechat/server/hooks/saveAnalyticsData.js b/packages/rocketchat-livechat/server/hooks/saveAnalyticsData.js index 845b6f3087fe..d1187ceac374 100644 --- a/packages/rocketchat-livechat/server/hooks/saveAnalyticsData.js +++ b/packages/rocketchat-livechat/server/hooks/saveAnalyticsData.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.callbacks.add('afterSaveMessage', function(message, room) { // skips this callback if the message was edited if (!message || message.editedAt) { diff --git a/packages/rocketchat-livechat/server/lib/OfficeClock.js b/packages/rocketchat-livechat/server/lib/OfficeClock.js index 542f0adeec1d..1ff5c067e673 100644 --- a/packages/rocketchat-livechat/server/lib/OfficeClock.js +++ b/packages/rocketchat-livechat/server/lib/OfficeClock.js @@ -1,4 +1,6 @@ // Every minute check if office closed +import { Meteor } from 'meteor/meteor'; + Meteor.setInterval(function() { if (RocketChat.settings.get('Livechat_enable_office_hours')) { if (RocketChat.models.LivechatOfficeHour.isOpeningTime()) { diff --git a/packages/rocketchat-livechat/server/lib/QueueMethods.js b/packages/rocketchat-livechat/server/lib/QueueMethods.js index b9a237b6728a..c13e1f69f933 100644 --- a/packages/rocketchat-livechat/server/lib/QueueMethods.js +++ b/packages/rocketchat-livechat/server/lib/QueueMethods.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import { sendNotification } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-livechat/server/methods/addAgent.js b/packages/rocketchat-livechat/server/methods/addAgent.js index c6893c624986..8335d4f5eef0 100644 --- a/packages/rocketchat-livechat/server/methods/addAgent.js +++ b/packages/rocketchat-livechat/server/methods/addAgent.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:addAgent'(username) { if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { diff --git a/packages/rocketchat-livechat/server/methods/addManager.js b/packages/rocketchat-livechat/server/methods/addManager.js index b3a079446fae..125aeccd6244 100644 --- a/packages/rocketchat-livechat/server/methods/addManager.js +++ b/packages/rocketchat-livechat/server/methods/addManager.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:addManager'(username) { if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { diff --git a/packages/rocketchat-livechat/server/methods/changeLivechatStatus.js b/packages/rocketchat-livechat/server/methods/changeLivechatStatus.js index 1cb292316a34..7fbd9c1b0e10 100644 --- a/packages/rocketchat-livechat/server/methods/changeLivechatStatus.js +++ b/packages/rocketchat-livechat/server/methods/changeLivechatStatus.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:changeLivechatStatus'() { if (!Meteor.userId()) { diff --git a/packages/rocketchat-livechat/server/methods/closeByVisitor.js b/packages/rocketchat-livechat/server/methods/closeByVisitor.js index 85614b011bd1..5e631489e79a 100644 --- a/packages/rocketchat-livechat/server/methods/closeByVisitor.js +++ b/packages/rocketchat-livechat/server/methods/closeByVisitor.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/methods/closeRoom.js b/packages/rocketchat-livechat/server/methods/closeRoom.js index 7ea442915d25..0030bf6ec116 100644 --- a/packages/rocketchat-livechat/server/methods/closeRoom.js +++ b/packages/rocketchat-livechat/server/methods/closeRoom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:closeRoom'(roomId, comment) { const userId = Meteor.userId(); diff --git a/packages/rocketchat-livechat/server/methods/facebook.js b/packages/rocketchat-livechat/server/methods/facebook.js index 7caa47d2e53d..2422d7e0c52c 100644 --- a/packages/rocketchat-livechat/server/methods/facebook.js +++ b/packages/rocketchat-livechat/server/methods/facebook.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import OmniChannel from '../lib/OmniChannel'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/methods/getAgentData.js b/packages/rocketchat-livechat/server/methods/getAgentData.js index 2bff59ab02ed..c8c8ca4d3d70 100644 --- a/packages/rocketchat-livechat/server/methods/getAgentData.js +++ b/packages/rocketchat-livechat/server/methods/getAgentData.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/methods/getAgentOverviewData.js b/packages/rocketchat-livechat/server/methods/getAgentOverviewData.js index 7b29855cf34a..5a83b4752d0f 100644 --- a/packages/rocketchat-livechat/server/methods/getAgentOverviewData.js +++ b/packages/rocketchat-livechat/server/methods/getAgentOverviewData.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:getAgentOverviewData'(options) { if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { diff --git a/packages/rocketchat-livechat/server/methods/getAnalyticsChartData.js b/packages/rocketchat-livechat/server/methods/getAnalyticsChartData.js index c6669abf2a09..70ef9452d4cf 100644 --- a/packages/rocketchat-livechat/server/methods/getAnalyticsChartData.js +++ b/packages/rocketchat-livechat/server/methods/getAnalyticsChartData.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:getAnalyticsChartData'(options) { if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { diff --git a/packages/rocketchat-livechat/server/methods/getAnalyticsOverviewData.js b/packages/rocketchat-livechat/server/methods/getAnalyticsOverviewData.js index a7a1e108c41b..5ef410f2791e 100644 --- a/packages/rocketchat-livechat/server/methods/getAnalyticsOverviewData.js +++ b/packages/rocketchat-livechat/server/methods/getAnalyticsOverviewData.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:getAnalyticsOverviewData'(options) { if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { diff --git a/packages/rocketchat-livechat/server/methods/getCustomFields.js b/packages/rocketchat-livechat/server/methods/getCustomFields.js index 95bff3afc8ca..6b2acf85594f 100644 --- a/packages/rocketchat-livechat/server/methods/getCustomFields.js +++ b/packages/rocketchat-livechat/server/methods/getCustomFields.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:getCustomFields'() { return RocketChat.models.LivechatCustomField.find().fetch(); diff --git a/packages/rocketchat-livechat/server/methods/getInitialData.js b/packages/rocketchat-livechat/server/methods/getInitialData.js index 1a04d8d9717a..d87f8ec3f07b 100644 --- a/packages/rocketchat-livechat/server/methods/getInitialData.js +++ b/packages/rocketchat-livechat/server/methods/getInitialData.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import LivechatVisitors from '../models/LivechatVisitors'; diff --git a/packages/rocketchat-livechat/server/methods/getNextAgent.js b/packages/rocketchat-livechat/server/methods/getNextAgent.js index da26ac6a3029..a6b1959a307d 100644 --- a/packages/rocketchat-livechat/server/methods/getNextAgent.js +++ b/packages/rocketchat-livechat/server/methods/getNextAgent.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:getNextAgent'({ token, department }) { check(token, String); diff --git a/packages/rocketchat-livechat/server/methods/loadHistory.js b/packages/rocketchat-livechat/server/methods/loadHistory.js index 1cd8309073ed..558a1de0fedf 100644 --- a/packages/rocketchat-livechat/server/methods/loadHistory.js +++ b/packages/rocketchat-livechat/server/methods/loadHistory.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/methods/loginByToken.js b/packages/rocketchat-livechat/server/methods/loginByToken.js index b086d820d737..1eaae13492bc 100644 --- a/packages/rocketchat-livechat/server/methods/loginByToken.js +++ b/packages/rocketchat-livechat/server/methods/loginByToken.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/methods/pageVisited.js b/packages/rocketchat-livechat/server/methods/pageVisited.js index b7f9cd25cb28..2bc5877ab62a 100644 --- a/packages/rocketchat-livechat/server/methods/pageVisited.js +++ b/packages/rocketchat-livechat/server/methods/pageVisited.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:pageVisited'(token, room, pageInfo) { RocketChat.Livechat.savePageHistory(token, room, pageInfo); diff --git a/packages/rocketchat-livechat/server/methods/registerGuest.js b/packages/rocketchat-livechat/server/methods/registerGuest.js index 41dc5b236801..ba9935bfec36 100644 --- a/packages/rocketchat-livechat/server/methods/registerGuest.js +++ b/packages/rocketchat-livechat/server/methods/registerGuest.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/methods/removeAgent.js b/packages/rocketchat-livechat/server/methods/removeAgent.js index 2af253980f32..cbb796778684 100644 --- a/packages/rocketchat-livechat/server/methods/removeAgent.js +++ b/packages/rocketchat-livechat/server/methods/removeAgent.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:removeAgent'(username) { if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { diff --git a/packages/rocketchat-livechat/server/methods/removeCustomField.js b/packages/rocketchat-livechat/server/methods/removeCustomField.js index 5c9ca572b2c7..c9968ba1fdb9 100644 --- a/packages/rocketchat-livechat/server/methods/removeCustomField.js +++ b/packages/rocketchat-livechat/server/methods/removeCustomField.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:removeCustomField'(_id) { if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { diff --git a/packages/rocketchat-livechat/server/methods/removeDepartment.js b/packages/rocketchat-livechat/server/methods/removeDepartment.js index d7fc5dd6d0e2..cfa0e454d8d6 100644 --- a/packages/rocketchat-livechat/server/methods/removeDepartment.js +++ b/packages/rocketchat-livechat/server/methods/removeDepartment.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:removeDepartment'(_id) { if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { diff --git a/packages/rocketchat-livechat/server/methods/removeManager.js b/packages/rocketchat-livechat/server/methods/removeManager.js index 7e3a414e27ea..202dccb01dd4 100644 --- a/packages/rocketchat-livechat/server/methods/removeManager.js +++ b/packages/rocketchat-livechat/server/methods/removeManager.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:removeManager'(username) { if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { diff --git a/packages/rocketchat-livechat/server/methods/removeRoom.js b/packages/rocketchat-livechat/server/methods/removeRoom.js index e95f6d7a3aac..81f753f8ccb8 100644 --- a/packages/rocketchat-livechat/server/methods/removeRoom.js +++ b/packages/rocketchat-livechat/server/methods/removeRoom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:removeRoom'(rid) { if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'remove-closed-livechat-rooms')) { diff --git a/packages/rocketchat-livechat/server/methods/removeTrigger.js b/packages/rocketchat-livechat/server/methods/removeTrigger.js index 6e76af37bce9..a6f8319c4284 100644 --- a/packages/rocketchat-livechat/server/methods/removeTrigger.js +++ b/packages/rocketchat-livechat/server/methods/removeTrigger.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:removeTrigger'(triggerId) { if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { diff --git a/packages/rocketchat-livechat/server/methods/returnAsInquiry.js b/packages/rocketchat-livechat/server/methods/returnAsInquiry.js index d00fb12fad2d..e82495dc8fee 100644 --- a/packages/rocketchat-livechat/server/methods/returnAsInquiry.js +++ b/packages/rocketchat-livechat/server/methods/returnAsInquiry.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:returnAsInquiry'(rid, departmentId) { if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-l-room')) { diff --git a/packages/rocketchat-livechat/server/methods/saveAppearance.js b/packages/rocketchat-livechat/server/methods/saveAppearance.js index ac79ae02301b..73c511412c84 100644 --- a/packages/rocketchat-livechat/server/methods/saveAppearance.js +++ b/packages/rocketchat-livechat/server/methods/saveAppearance.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:saveAppearance'(settings) { if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { diff --git a/packages/rocketchat-livechat/server/methods/saveCustomField.js b/packages/rocketchat-livechat/server/methods/saveCustomField.js index 67464c5acaf8..300b411ea334 100644 --- a/packages/rocketchat-livechat/server/methods/saveCustomField.js +++ b/packages/rocketchat-livechat/server/methods/saveCustomField.js @@ -1,4 +1,5 @@ /* eslint new-cap: [2, {"capIsNewExceptions": ["Match.ObjectIncluding", "Match.Optional"]}] */ +import { Meteor } from 'meteor/meteor'; Meteor.methods({ 'livechat:saveCustomField'(_id, customFieldData) { diff --git a/packages/rocketchat-livechat/server/methods/saveDepartment.js b/packages/rocketchat-livechat/server/methods/saveDepartment.js index 8700bee2372c..c9108870b6ca 100644 --- a/packages/rocketchat-livechat/server/methods/saveDepartment.js +++ b/packages/rocketchat-livechat/server/methods/saveDepartment.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:saveDepartment'(_id, departmentData, departmentAgents) { if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { diff --git a/packages/rocketchat-livechat/server/methods/saveInfo.js b/packages/rocketchat-livechat/server/methods/saveInfo.js index 023d69f16fe7..24b0c5404eeb 100644 --- a/packages/rocketchat-livechat/server/methods/saveInfo.js +++ b/packages/rocketchat-livechat/server/methods/saveInfo.js @@ -1,4 +1,5 @@ /* eslint new-cap: [2, {"capIsNewExceptions": ["Match.ObjectIncluding", "Match.Optional"]}] */ +import { Meteor } from 'meteor/meteor'; Meteor.methods({ 'livechat:saveInfo'(guestData, roomData) { diff --git a/packages/rocketchat-livechat/server/methods/saveIntegration.js b/packages/rocketchat-livechat/server/methods/saveIntegration.js index 23a26d52aefe..cf0fd16d9e45 100644 --- a/packages/rocketchat-livechat/server/methods/saveIntegration.js +++ b/packages/rocketchat-livechat/server/methods/saveIntegration.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/methods/saveOfficeHours.js b/packages/rocketchat-livechat/server/methods/saveOfficeHours.js index f7d6284e4024..945ca6192383 100644 --- a/packages/rocketchat-livechat/server/methods/saveOfficeHours.js +++ b/packages/rocketchat-livechat/server/methods/saveOfficeHours.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:saveOfficeHours'(day, start, finish, open) { RocketChat.models.LivechatOfficeHour.updateHours(day, start, finish, open); diff --git a/packages/rocketchat-livechat/server/methods/saveSurveyFeedback.js b/packages/rocketchat-livechat/server/methods/saveSurveyFeedback.js index 8cdd411154a3..01ff77fcd379 100644 --- a/packages/rocketchat-livechat/server/methods/saveSurveyFeedback.js +++ b/packages/rocketchat-livechat/server/methods/saveSurveyFeedback.js @@ -1,4 +1,5 @@ /* eslint new-cap: [2, {"capIsNewExceptions": ["Match.ObjectIncluding"]}] */ +import { Meteor } from 'meteor/meteor'; import LivechatVisitors from '../models/LivechatVisitors'; import _ from 'underscore'; diff --git a/packages/rocketchat-livechat/server/methods/saveTrigger.js b/packages/rocketchat-livechat/server/methods/saveTrigger.js index 183ab6704471..9ad08dbc5c57 100644 --- a/packages/rocketchat-livechat/server/methods/saveTrigger.js +++ b/packages/rocketchat-livechat/server/methods/saveTrigger.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:saveTrigger'(trigger) { if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { diff --git a/packages/rocketchat-livechat/server/methods/searchAgent.js b/packages/rocketchat-livechat/server/methods/searchAgent.js index 01f0c2cb8ebd..f2a752e0d151 100644 --- a/packages/rocketchat-livechat/server/methods/searchAgent.js +++ b/packages/rocketchat-livechat/server/methods/searchAgent.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/methods/sendFileLivechatMessage.js b/packages/rocketchat-livechat/server/methods/sendFileLivechatMessage.js index d9056982db2f..709dd92b4cf2 100644 --- a/packages/rocketchat-livechat/server/methods/sendFileLivechatMessage.js +++ b/packages/rocketchat-livechat/server/methods/sendFileLivechatMessage.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/methods/sendMessageLivechat.js b/packages/rocketchat-livechat/server/methods/sendMessageLivechat.js index 3a91744d43eb..3fbeeb07df11 100644 --- a/packages/rocketchat-livechat/server/methods/sendMessageLivechat.js +++ b/packages/rocketchat-livechat/server/methods/sendMessageLivechat.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/methods/sendOfflineMessage.js b/packages/rocketchat-livechat/server/methods/sendOfflineMessage.js index 59fb357478a4..f39d12b8db23 100644 --- a/packages/rocketchat-livechat/server/methods/sendOfflineMessage.js +++ b/packages/rocketchat-livechat/server/methods/sendOfflineMessage.js @@ -1,4 +1,5 @@ /* globals DDPRateLimiter */ +import { Meteor } from 'meteor/meteor'; Meteor.methods({ 'livechat:sendOfflineMessage'(data) { diff --git a/packages/rocketchat-livechat/server/methods/sendTranscript.js b/packages/rocketchat-livechat/server/methods/sendTranscript.js index 793a757f916b..7e0b02db570a 100644 --- a/packages/rocketchat-livechat/server/methods/sendTranscript.js +++ b/packages/rocketchat-livechat/server/methods/sendTranscript.js @@ -1,4 +1,5 @@ /* globals DDPRateLimiter */ +import { Meteor } from 'meteor/meteor'; Meteor.methods({ 'livechat:sendTranscript'(token, rid, email) { diff --git a/packages/rocketchat-livechat/server/methods/setCustomField.js b/packages/rocketchat-livechat/server/methods/setCustomField.js index 74460d492753..cc4ca09ba1f3 100644 --- a/packages/rocketchat-livechat/server/methods/setCustomField.js +++ b/packages/rocketchat-livechat/server/methods/setCustomField.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/methods/setDepartmentForVisitor.js b/packages/rocketchat-livechat/server/methods/setDepartmentForVisitor.js index 484a6193f27f..2c15a0b74ddc 100644 --- a/packages/rocketchat-livechat/server/methods/setDepartmentForVisitor.js +++ b/packages/rocketchat-livechat/server/methods/setDepartmentForVisitor.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/methods/startFileUploadRoom.js b/packages/rocketchat-livechat/server/methods/startFileUploadRoom.js index 88ecdda8a38a..3b41c65d17aa 100644 --- a/packages/rocketchat-livechat/server/methods/startFileUploadRoom.js +++ b/packages/rocketchat-livechat/server/methods/startFileUploadRoom.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/methods/startVideoCall.js b/packages/rocketchat-livechat/server/methods/startVideoCall.js index f9d60215f677..4904e255adad 100644 --- a/packages/rocketchat-livechat/server/methods/startVideoCall.js +++ b/packages/rocketchat-livechat/server/methods/startVideoCall.js @@ -1,4 +1,6 @@ /* eslint new-cap: [2, {"capIsNewExceptions": ["MD5"]}] */ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:startVideoCall'(roomId) { if (!Meteor.userId()) { diff --git a/packages/rocketchat-livechat/server/methods/takeInquiry.js b/packages/rocketchat-livechat/server/methods/takeInquiry.js index 18a784f0eede..680af9110f36 100644 --- a/packages/rocketchat-livechat/server/methods/takeInquiry.js +++ b/packages/rocketchat-livechat/server/methods/takeInquiry.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'livechat:takeInquiry'(inquiryId) { if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-l-room')) { diff --git a/packages/rocketchat-livechat/server/methods/transfer.js b/packages/rocketchat-livechat/server/methods/transfer.js index 3b89142bf450..c377ec7808fa 100644 --- a/packages/rocketchat-livechat/server/methods/transfer.js +++ b/packages/rocketchat-livechat/server/methods/transfer.js @@ -1,5 +1,6 @@ /* eslint new-cap: [2, {"capIsNewExceptions": ["Match.Optional"]}] */ +import { Meteor } from 'meteor/meteor'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/methods/webhookTest.js b/packages/rocketchat-livechat/server/methods/webhookTest.js index e6eaae3c49b6..27ce96c1ab03 100644 --- a/packages/rocketchat-livechat/server/methods/webhookTest.js +++ b/packages/rocketchat-livechat/server/methods/webhookTest.js @@ -1,4 +1,6 @@ /* globals HTTP */ +import { Meteor } from 'meteor/meteor'; + const postCatchError = Meteor.wrapAsync(function(url, options, resolve) { HTTP.post(url, options, function(err, res) { if (err) { diff --git a/packages/rocketchat-livechat/server/models/LivechatDepartmentAgents.js b/packages/rocketchat-livechat/server/models/LivechatDepartmentAgents.js index abbca57ab453..c22aecb6f9a2 100644 --- a/packages/rocketchat-livechat/server/models/LivechatDepartmentAgents.js +++ b/packages/rocketchat-livechat/server/models/LivechatDepartmentAgents.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; /** * Livechat Department model diff --git a/packages/rocketchat-livechat/server/models/LivechatExternalMessage.js b/packages/rocketchat-livechat/server/models/LivechatExternalMessage.js index 08dcf12781e4..6ee9937d7bca 100644 --- a/packages/rocketchat-livechat/server/models/LivechatExternalMessage.js +++ b/packages/rocketchat-livechat/server/models/LivechatExternalMessage.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + class LivechatExternalMessage extends RocketChat.models._Base { constructor() { super('livechat_external_message'); diff --git a/packages/rocketchat-livechat/server/models/LivechatVisitors.js b/packages/rocketchat-livechat/server/models/LivechatVisitors.js index 20d1a75de464..b1838bcc2371 100644 --- a/packages/rocketchat-livechat/server/models/LivechatVisitors.js +++ b/packages/rocketchat-livechat/server/models/LivechatVisitors.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-livechat/server/models/Rooms.js b/packages/rocketchat-livechat/server/models/Rooms.js index 40dd56908e9b..ad6fde31897e 100644 --- a/packages/rocketchat-livechat/server/models/Rooms.js +++ b/packages/rocketchat-livechat/server/models/Rooms.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; /** diff --git a/packages/rocketchat-livechat/server/models/Users.js b/packages/rocketchat-livechat/server/models/Users.js index 59350639c16f..4e8e624b4cd6 100644 --- a/packages/rocketchat-livechat/server/models/Users.js +++ b/packages/rocketchat-livechat/server/models/Users.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + /** * Sets an user as (non)operator * @param {string} _id - User's _id diff --git a/packages/rocketchat-livechat/server/models/indexes.js b/packages/rocketchat-livechat/server/models/indexes.js index 21cb6534284f..b707315cf180 100644 --- a/packages/rocketchat-livechat/server/models/indexes.js +++ b/packages/rocketchat-livechat/server/models/indexes.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.models.Rooms.tryEnsureIndex({ open: 1 }, { sparse: 1 }); RocketChat.models.Rooms.tryEnsureIndex({ departmentId: 1 }, { sparse: 1 }); diff --git a/packages/rocketchat-livechat/server/publications/customFields.js b/packages/rocketchat-livechat/server/publications/customFields.js index b01590fe0688..87b8af5f6c72 100644 --- a/packages/rocketchat-livechat/server/publications/customFields.js +++ b/packages/rocketchat-livechat/server/publications/customFields.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; Meteor.publish('livechat:customFields', function(_id) { diff --git a/packages/rocketchat-livechat/server/publications/departmentAgents.js b/packages/rocketchat-livechat/server/publications/departmentAgents.js index 47d30df37e18..806d6df1c5a3 100644 --- a/packages/rocketchat-livechat/server/publications/departmentAgents.js +++ b/packages/rocketchat-livechat/server/publications/departmentAgents.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('livechat:departmentAgents', function(departmentId) { if (!this.userId) { return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:departmentAgents' })); diff --git a/packages/rocketchat-livechat/server/publications/externalMessages.js b/packages/rocketchat-livechat/server/publications/externalMessages.js index 3cd8defdbac3..b124dbe5b448 100644 --- a/packages/rocketchat-livechat/server/publications/externalMessages.js +++ b/packages/rocketchat-livechat/server/publications/externalMessages.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('livechat:externalMessages', function(roomId) { return RocketChat.models.LivechatExternalMessage.findByRoomId(roomId); }); diff --git a/packages/rocketchat-livechat/server/publications/livechatAgents.js b/packages/rocketchat-livechat/server/publications/livechatAgents.js index 8849e5c77b6a..8356a2537ec0 100644 --- a/packages/rocketchat-livechat/server/publications/livechatAgents.js +++ b/packages/rocketchat-livechat/server/publications/livechatAgents.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('livechat:agents', function() { if (!this.userId) { return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:agents' })); diff --git a/packages/rocketchat-livechat/server/publications/livechatAppearance.js b/packages/rocketchat-livechat/server/publications/livechatAppearance.js index 1af99eaa8d98..c48eb1721e48 100644 --- a/packages/rocketchat-livechat/server/publications/livechatAppearance.js +++ b/packages/rocketchat-livechat/server/publications/livechatAppearance.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('livechat:appearance', function() { if (!this.userId) { return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:appearance' })); diff --git a/packages/rocketchat-livechat/server/publications/livechatDepartments.js b/packages/rocketchat-livechat/server/publications/livechatDepartments.js index c0036a030df1..81078804525c 100644 --- a/packages/rocketchat-livechat/server/publications/livechatDepartments.js +++ b/packages/rocketchat-livechat/server/publications/livechatDepartments.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('livechat:departments', function(_id) { if (!this.userId) { return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:agents' })); diff --git a/packages/rocketchat-livechat/server/publications/livechatInquiries.js b/packages/rocketchat-livechat/server/publications/livechatInquiries.js index 65757f72110a..84976c604d43 100644 --- a/packages/rocketchat-livechat/server/publications/livechatInquiries.js +++ b/packages/rocketchat-livechat/server/publications/livechatInquiries.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('livechat:inquiry', function() { if (!this.userId) { return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:inquiry' })); diff --git a/packages/rocketchat-livechat/server/publications/livechatIntegration.js b/packages/rocketchat-livechat/server/publications/livechatIntegration.js index eaf02b0df2e3..ef4805d2b1bf 100644 --- a/packages/rocketchat-livechat/server/publications/livechatIntegration.js +++ b/packages/rocketchat-livechat/server/publications/livechatIntegration.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('livechat:integration', function() { if (!this.userId) { return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:integration' })); diff --git a/packages/rocketchat-livechat/server/publications/livechatManagers.js b/packages/rocketchat-livechat/server/publications/livechatManagers.js index b6dae818d918..deccf1028394 100644 --- a/packages/rocketchat-livechat/server/publications/livechatManagers.js +++ b/packages/rocketchat-livechat/server/publications/livechatManagers.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('livechat:managers', function() { if (!this.userId) { return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:managers' })); diff --git a/packages/rocketchat-livechat/server/publications/livechatMonitoring.js b/packages/rocketchat-livechat/server/publications/livechatMonitoring.js index 95140dda2b51..6768d08c76ce 100644 --- a/packages/rocketchat-livechat/server/publications/livechatMonitoring.js +++ b/packages/rocketchat-livechat/server/publications/livechatMonitoring.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('livechat:monitoring', function(date) { if (!this.userId) { return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:monitoring' })); diff --git a/packages/rocketchat-livechat/server/publications/livechatOfficeHours.js b/packages/rocketchat-livechat/server/publications/livechatOfficeHours.js index 566a79012a71..79a9a4c6794d 100644 --- a/packages/rocketchat-livechat/server/publications/livechatOfficeHours.js +++ b/packages/rocketchat-livechat/server/publications/livechatOfficeHours.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('livechat:officeHour', function() { if (!RocketChat.authz.hasPermission(this.userId, 'view-l-room')) { return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:agents' })); diff --git a/packages/rocketchat-livechat/server/publications/livechatQueue.js b/packages/rocketchat-livechat/server/publications/livechatQueue.js index 3cce14f9ab1d..c40c33d7f377 100644 --- a/packages/rocketchat-livechat/server/publications/livechatQueue.js +++ b/packages/rocketchat-livechat/server/publications/livechatQueue.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('livechat:queue', function() { if (!this.userId) { return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:queue' })); diff --git a/packages/rocketchat-livechat/server/publications/livechatRooms.js b/packages/rocketchat-livechat/server/publications/livechatRooms.js index 075dbef562f5..df96866a2a30 100644 --- a/packages/rocketchat-livechat/server/publications/livechatRooms.js +++ b/packages/rocketchat-livechat/server/publications/livechatRooms.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('livechat:rooms', function(filter = {}, offset = 0, limit = 20) { if (!this.userId) { return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:rooms' })); diff --git a/packages/rocketchat-livechat/server/publications/livechatTriggers.js b/packages/rocketchat-livechat/server/publications/livechatTriggers.js index 3baeb011f402..6c21040fb489 100644 --- a/packages/rocketchat-livechat/server/publications/livechatTriggers.js +++ b/packages/rocketchat-livechat/server/publications/livechatTriggers.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('livechat:triggers', function(_id) { if (!this.userId) { return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:triggers' })); diff --git a/packages/rocketchat-livechat/server/publications/livechatVisitors.js b/packages/rocketchat-livechat/server/publications/livechatVisitors.js index ed5a34f0576f..0de54aeeff93 100644 --- a/packages/rocketchat-livechat/server/publications/livechatVisitors.js +++ b/packages/rocketchat-livechat/server/publications/livechatVisitors.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.publish('livechat:visitors', function(date) { diff --git a/packages/rocketchat-livechat/server/publications/visitorHistory.js b/packages/rocketchat-livechat/server/publications/visitorHistory.js index 36227a2215ca..0f03353f457d 100644 --- a/packages/rocketchat-livechat/server/publications/visitorHistory.js +++ b/packages/rocketchat-livechat/server/publications/visitorHistory.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('livechat:visitorHistory', function({ rid: roomId }) { if (!this.userId) { return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:visitorHistory' })); diff --git a/packages/rocketchat-livechat/server/publications/visitorInfo.js b/packages/rocketchat-livechat/server/publications/visitorInfo.js index b09b0d9dac8f..23022a1914a7 100644 --- a/packages/rocketchat-livechat/server/publications/visitorInfo.js +++ b/packages/rocketchat-livechat/server/publications/visitorInfo.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.publish('livechat:visitorInfo', function({ rid: roomId }) { diff --git a/packages/rocketchat-livechat/server/publications/visitorPageVisited.js b/packages/rocketchat-livechat/server/publications/visitorPageVisited.js index d74d343d90a5..dbbc3f4fe127 100644 --- a/packages/rocketchat-livechat/server/publications/visitorPageVisited.js +++ b/packages/rocketchat-livechat/server/publications/visitorPageVisited.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('livechat:visitorPageVisited', function({ rid: roomId }) { if (!this.userId) { diff --git a/packages/rocketchat-livechat/server/startup.js b/packages/rocketchat-livechat/server/startup.js index 9ef7139ec07a..5c44e0e25cfa 100644 --- a/packages/rocketchat-livechat/server/startup.js +++ b/packages/rocketchat-livechat/server/startup.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(() => { RocketChat.roomTypes.setRoomFind('l', (_id) => RocketChat.models.Rooms.findLivechatById(_id).fetch()); diff --git a/packages/rocketchat-livechat/server/unclosedLivechats.js b/packages/rocketchat-livechat/server/unclosedLivechats.js index d0212426fa04..19395d5be361 100644 --- a/packages/rocketchat-livechat/server/unclosedLivechats.js +++ b/packages/rocketchat-livechat/server/unclosedLivechats.js @@ -1,4 +1,5 @@ /* globals UserPresenceMonitor */ +import { Meteor } from 'meteor/meteor'; let agentsHandler; let monitorAgents = false; diff --git a/packages/rocketchat-livechat/server/visitorStatus.js b/packages/rocketchat-livechat/server/visitorStatus.js index 4c31c386e71c..611a6f00d5cc 100644 --- a/packages/rocketchat-livechat/server/visitorStatus.js +++ b/packages/rocketchat-livechat/server/visitorStatus.js @@ -1,4 +1,6 @@ /* globals UserPresenceEvents */ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(() => { UserPresenceEvents.on('setStatus', (session, status, metadata) => { if (metadata && metadata.visitor) { diff --git a/packages/rocketchat-livestream/client/oauth.js b/packages/rocketchat-livestream/client/oauth.js index c797e87fb29e..acc674a30b81 100644 --- a/packages/rocketchat-livestream/client/oauth.js +++ b/packages/rocketchat-livestream/client/oauth.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + export const close = (popup) => new Promise(function(resolve) { const checkInterval = setInterval(() => { if (popup.closed) { diff --git a/packages/rocketchat-livestream/client/tabBar.js b/packages/rocketchat-livestream/client/tabBar.js index 362e56cfbda8..d3efa341e945 100644 --- a/packages/rocketchat-livestream/client/tabBar.js +++ b/packages/rocketchat-livestream/client/tabBar.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { Tracker.autorun(function() { RocketChat.TabBar.removeButton('livestream'); diff --git a/packages/rocketchat-livestream/client/views/broadcastView.js b/packages/rocketchat-livestream/client/views/broadcastView.js index ca2705afa26f..9faa2e5b702d 100644 --- a/packages/rocketchat-livestream/client/views/broadcastView.js +++ b/packages/rocketchat-livestream/client/views/broadcastView.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + const getMedia = () => navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; const createAndConnect = (url) => { if (!'WebSocket' in window) { // eslint-disable-line no-negated-in-lhs diff --git a/packages/rocketchat-livestream/client/views/liveStreamTab.js b/packages/rocketchat-livestream/client/views/liveStreamTab.js index 104f6be88fc8..bcaa38181db5 100644 --- a/packages/rocketchat-livestream/client/views/liveStreamTab.js +++ b/packages/rocketchat-livestream/client/views/liveStreamTab.js @@ -1,4 +1,5 @@ /* globals popout */ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; import { auth } from '../oauth.js'; import { RocketChatAnnouncement } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-livestream/server/functions/saveStreamingOptions.js b/packages/rocketchat-livestream/server/functions/saveStreamingOptions.js index be0e655cd815..8699facf7238 100644 --- a/packages/rocketchat-livestream/server/functions/saveStreamingOptions.js +++ b/packages/rocketchat-livestream/server/functions/saveStreamingOptions.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.saveStreamingOptions = function(rid, options) { if (!Match.test(rid, String)) { throw new Meteor.Error('invalid-room', 'Invalid room', { diff --git a/packages/rocketchat-livestream/server/routes.js b/packages/rocketchat-livestream/server/routes.js index 9d9436333a43..07c43972fa7f 100644 --- a/packages/rocketchat-livestream/server/routes.js +++ b/packages/rocketchat-livestream/server/routes.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import google from 'googleapis'; const { OAuth2 } = google.auth; diff --git a/packages/rocketchat-livestream/server/settings.js b/packages/rocketchat-livestream/server/settings.js index 97177dc19099..9fc05da95eb1 100644 --- a/packages/rocketchat-livestream/server/settings.js +++ b/packages/rocketchat-livestream/server/settings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.settings.addGroup('LiveStream & Broadcasting', function() { diff --git a/packages/rocketchat-logger/client/viewLogs.js b/packages/rocketchat-logger/client/viewLogs.js index 30f674e231c2..fc12b7b50317 100644 --- a/packages/rocketchat-logger/client/viewLogs.js +++ b/packages/rocketchat-logger/client/viewLogs.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; this.stdout = new Mongo.Collection('stdout'); diff --git a/packages/rocketchat-logger/client/views/viewLogs.js b/packages/rocketchat-logger/client/views/viewLogs.js index 176805af9e97..b0ed5591b388 100644 --- a/packages/rocketchat-logger/client/views/viewLogs.js +++ b/packages/rocketchat-logger/client/views/viewLogs.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import moment from 'moment'; // TODO: remove this globals diff --git a/packages/rocketchat-logger/server/server.js b/packages/rocketchat-logger/server/server.js index dc519f8d097c..608d62a30d03 100644 --- a/packages/rocketchat-logger/server/server.js +++ b/packages/rocketchat-logger/server/server.js @@ -1,4 +1,5 @@ /* globals EventEmitter LoggerManager SystemLogger Log*/ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-mail-messages/client/router.js b/packages/rocketchat-mail-messages/client/router.js index b4a49f31f36d..a9a4c21e6265 100644 --- a/packages/rocketchat-mail-messages/client/router.js +++ b/packages/rocketchat-mail-messages/client/router.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + FlowRouter.route('/mailer', { name: 'mailer', action() { diff --git a/packages/rocketchat-mail-messages/client/views/mailer.js b/packages/rocketchat-mail-messages/client/views/mailer.js index aaf4f2fdd50e..cb9abc1f3abe 100644 --- a/packages/rocketchat-mail-messages/client/views/mailer.js +++ b/packages/rocketchat-mail-messages/client/views/mailer.js @@ -1,4 +1,6 @@ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; + Template.mailer.helpers({ fromEmail() { return RocketChat.settings.get('From_Email'); diff --git a/packages/rocketchat-mail-messages/server/functions/sendMail.js b/packages/rocketchat-mail-messages/server/functions/sendMail.js index 5e671a51365f..fa82ec2155f3 100644 --- a/packages/rocketchat-mail-messages/server/functions/sendMail.js +++ b/packages/rocketchat-mail-messages/server/functions/sendMail.js @@ -1,4 +1,5 @@ /* globals */ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; import * as Mailer from 'meteor/rocketchat:mailer'; diff --git a/packages/rocketchat-mail-messages/server/methods/sendMail.js b/packages/rocketchat-mail-messages/server/methods/sendMail.js index f40aebd1469b..890e84d5f685 100644 --- a/packages/rocketchat-mail-messages/server/methods/sendMail.js +++ b/packages/rocketchat-mail-messages/server/methods/sendMail.js @@ -1,4 +1,6 @@ /* globals Mailer */ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'Mailer.sendMail'(from, subject, body, dryrun, query) { const userId = Meteor.userId(); diff --git a/packages/rocketchat-mail-messages/server/methods/unsubscribe.js b/packages/rocketchat-mail-messages/server/methods/unsubscribe.js index 788c0b3d0c64..dfbb586f5773 100644 --- a/packages/rocketchat-mail-messages/server/methods/unsubscribe.js +++ b/packages/rocketchat-mail-messages/server/methods/unsubscribe.js @@ -1,4 +1,6 @@ /* globals Mailer */ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'Mailer:unsubscribe'(_id, createdAt) { return Mailer.unsubscribe(_id, createdAt); diff --git a/packages/rocketchat-mail-messages/server/startup.js b/packages/rocketchat-mail-messages/server/startup.js index 2f0105eb31e2..26c84b5d37af 100644 --- a/packages/rocketchat-mail-messages/server/startup.js +++ b/packages/rocketchat-mail-messages/server/startup.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { return RocketChat.models.Permissions.upsert('access-mailer', { $setOnInsert: { diff --git a/packages/rocketchat-mailer/server/api.js b/packages/rocketchat-mailer/server/api.js index 1a3ef0669619..1eb6ae07ec92 100644 --- a/packages/rocketchat-mailer/server/api.js +++ b/packages/rocketchat-mailer/server/api.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; import juice from 'juice'; diff --git a/packages/rocketchat-mapview/server/settings.js b/packages/rocketchat-mapview/server/settings.js index b79cea6df646..185a2c6c7818 100644 --- a/packages/rocketchat-mapview/server/settings.js +++ b/packages/rocketchat-mapview/server/settings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.settings.add('MapView_Enabled', false, { type: 'boolean', group: 'Message', section: 'Google Maps', public: true, i18nLabel: 'MapView_Enabled', i18nDescription: 'MapView_Enabled_Description' }); return RocketChat.settings.add('MapView_GMapsAPIKey', '', { type: 'string', group: 'Message', section: 'Google Maps', public: true, i18nLabel: 'MapView_GMapsAPIKey', i18nDescription: 'MapView_GMapsAPIKey_Description' }); diff --git a/packages/rocketchat-mentions-flextab/client/actionButton.js b/packages/rocketchat-mentions-flextab/client/actionButton.js index 67a4df2af2ca..c6c55d355077 100644 --- a/packages/rocketchat-mentions-flextab/client/actionButton.js +++ b/packages/rocketchat-mentions-flextab/client/actionButton.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.MessageAction.addButton({ id: 'jump-to-message', diff --git a/packages/rocketchat-mentions-flextab/client/tabBar.js b/packages/rocketchat-mentions-flextab/client/tabBar.js index 74816a1d4aa0..619c5dc51ae1 100644 --- a/packages/rocketchat-mentions-flextab/client/tabBar.js +++ b/packages/rocketchat-mentions-flextab/client/tabBar.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { return RocketChat.TabBar.addButton({ groups: ['channel', 'group'], diff --git a/packages/rocketchat-mentions-flextab/server/publications/mentionedMessages.js b/packages/rocketchat-mentions-flextab/server/publications/mentionedMessages.js index d6e50dc23f87..cbd7eeab1109 100644 --- a/packages/rocketchat-mentions-flextab/server/publications/mentionedMessages.js +++ b/packages/rocketchat-mentions-flextab/server/publications/mentionedMessages.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('mentionedMessages', function(rid, limit = 50) { if (!this.userId) { return this.ready(); diff --git a/packages/rocketchat-mentions/client/client.js b/packages/rocketchat-mentions/client/client.js index fe1329f75983..84b4a6b9fe7e 100644 --- a/packages/rocketchat-mentions/client/client.js +++ b/packages/rocketchat-mentions/client/client.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import Mentions from '../Mentions'; const MentionsClient = new Mentions({ pattern() { diff --git a/packages/rocketchat-mentions/server/methods/getUserMentionsByChannel.js b/packages/rocketchat-mentions/server/methods/getUserMentionsByChannel.js index 1d1701d98afa..2cf9d29b0d7e 100644 --- a/packages/rocketchat-mentions/server/methods/getUserMentionsByChannel.js +++ b/packages/rocketchat-mentions/server/methods/getUserMentionsByChannel.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ getUserMentionsByChannel({ roomId, options }) { check(roomId, String); diff --git a/packages/rocketchat-mentions/server/server.js b/packages/rocketchat-mentions/server/server.js index ea491b619701..9184d47b4d75 100644 --- a/packages/rocketchat-mentions/server/server.js +++ b/packages/rocketchat-mentions/server/server.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import MentionsServer from './Mentions'; diff --git a/packages/rocketchat-message-attachments/client/messageAttachment.js b/packages/rocketchat-message-attachments/client/messageAttachment.js index 49081a449acf..b4a504bbce12 100644 --- a/packages/rocketchat-message-attachments/client/messageAttachment.js +++ b/packages/rocketchat-message-attachments/client/messageAttachment.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { DateFormat } from 'meteor/rocketchat:lib'; import { fixCordova } from 'meteor/rocketchat:lazy-load'; const colors = { diff --git a/packages/rocketchat-message-mark-as-unread/client/actionButton.js b/packages/rocketchat-message-mark-as-unread/client/actionButton.js index f540565ef53f..f5b610396fea 100644 --- a/packages/rocketchat-message-mark-as-unread/client/actionButton.js +++ b/packages/rocketchat-message-mark-as-unread/client/actionButton.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(() => { RocketChat.MessageAction.addButton({ id: 'mark-message-as-unread', diff --git a/packages/rocketchat-message-mark-as-unread/server/unreadMessages.js b/packages/rocketchat-message-mark-as-unread/server/unreadMessages.js index 02a7ff4919f1..26d2f7c4df93 100644 --- a/packages/rocketchat-message-mark-as-unread/server/unreadMessages.js +++ b/packages/rocketchat-message-mark-as-unread/server/unreadMessages.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import logger from './logger'; Meteor.methods({ unreadMessages(firstUnreadMessage, room) { diff --git a/packages/rocketchat-message-pin/client/actionButton.js b/packages/rocketchat-message-pin/client/actionButton.js index 98893067e8e4..49e1d977810d 100644 --- a/packages/rocketchat-message-pin/client/actionButton.js +++ b/packages/rocketchat-message-pin/client/actionButton.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; Meteor.startup(function() { diff --git a/packages/rocketchat-message-pin/client/messageType.js b/packages/rocketchat-message-pin/client/messageType.js index 5e798020e6d6..05e050303f22 100644 --- a/packages/rocketchat-message-pin/client/messageType.js +++ b/packages/rocketchat-message-pin/client/messageType.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.MessageTypes.registerType({ id: 'message_pinned', diff --git a/packages/rocketchat-message-pin/client/pinMessage.js b/packages/rocketchat-message-pin/client/pinMessage.js index b5d2881d4045..890b28b7f420 100644 --- a/packages/rocketchat-message-pin/client/pinMessage.js +++ b/packages/rocketchat-message-pin/client/pinMessage.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ pinMessage(message) { if (!Meteor.userId()) { diff --git a/packages/rocketchat-message-pin/client/tabBar.js b/packages/rocketchat-message-pin/client/tabBar.js index 5a7dbeb194b2..fccd92eb2a3d 100644 --- a/packages/rocketchat-message-pin/client/tabBar.js +++ b/packages/rocketchat-message-pin/client/tabBar.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { return Tracker.autorun(function() { if (RocketChat.settings.get('Message_AllowPinning')) { diff --git a/packages/rocketchat-message-pin/server/publications/pinnedMessages.js b/packages/rocketchat-message-pin/server/publications/pinnedMessages.js index 9606db2a9d54..bdf8e062bed0 100644 --- a/packages/rocketchat-message-pin/server/publications/pinnedMessages.js +++ b/packages/rocketchat-message-pin/server/publications/pinnedMessages.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('pinnedMessages', function(rid, limit = 50) { if (!this.userId) { return this.ready(); diff --git a/packages/rocketchat-message-pin/server/settings.js b/packages/rocketchat-message-pin/server/settings.js index eccfef09bfad..10a4d2feb3db 100644 --- a/packages/rocketchat-message-pin/server/settings.js +++ b/packages/rocketchat-message-pin/server/settings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.settings.add('Message_AllowPinning', true, { type: 'boolean', diff --git a/packages/rocketchat-message-pin/server/startup/indexes.js b/packages/rocketchat-message-pin/server/startup/indexes.js index c2b68656d1c3..b63862c64bcd 100644 --- a/packages/rocketchat-message-pin/server/startup/indexes.js +++ b/packages/rocketchat-message-pin/server/startup/indexes.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { return Meteor.defer(function() { return RocketChat.models.Messages.tryEnsureIndex({ diff --git a/packages/rocketchat-message-snippet/client/actionButton.js b/packages/rocketchat-message-snippet/client/actionButton.js index 473390600d20..f3b0023ab160 100644 --- a/packages/rocketchat-message-snippet/client/actionButton.js +++ b/packages/rocketchat-message-snippet/client/actionButton.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.MessageAction.addButton({ id: 'snippeted-message', diff --git a/packages/rocketchat-message-snippet/client/messageType.js b/packages/rocketchat-message-snippet/client/messageType.js index 78a5210f4e2b..ce827b99eb76 100644 --- a/packages/rocketchat-message-snippet/client/messageType.js +++ b/packages/rocketchat-message-snippet/client/messageType.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; Meteor.startup(function() { diff --git a/packages/rocketchat-message-snippet/client/page/snippetPage.js b/packages/rocketchat-message-snippet/client/page/snippetPage.js index a5242ccb3f06..dbbd77140588 100644 --- a/packages/rocketchat-message-snippet/client/page/snippetPage.js +++ b/packages/rocketchat-message-snippet/client/page/snippetPage.js @@ -1,4 +1,5 @@ /* global SnippetedMessages */ +import { Meteor } from 'meteor/meteor'; import { DateFormat } from 'meteor/rocketchat:lib'; Template.snippetPage.helpers({ diff --git a/packages/rocketchat-message-snippet/client/snippetMessage.js b/packages/rocketchat-message-snippet/client/snippetMessage.js index b0a99871d0df..28da80d4eed8 100644 --- a/packages/rocketchat-message-snippet/client/snippetMessage.js +++ b/packages/rocketchat-message-snippet/client/snippetMessage.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ snippetMessage(message) { if (typeof Meteor.userId() === 'undefined' || Meteor.userId() === null) { diff --git a/packages/rocketchat-message-snippet/client/tabBar/tabBar.js b/packages/rocketchat-message-snippet/client/tabBar/tabBar.js index c216c164afb8..3c7763d409b4 100644 --- a/packages/rocketchat-message-snippet/client/tabBar/tabBar.js +++ b/packages/rocketchat-message-snippet/client/tabBar/tabBar.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { Tracker.autorun(function() { if (RocketChat.settings.get('Message_AllowSnippeting')) { diff --git a/packages/rocketchat-message-snippet/server/methods/snippetMessage.js b/packages/rocketchat-message-snippet/server/methods/snippetMessage.js index bf4cf3156f43..e7a373cb66a0 100644 --- a/packages/rocketchat-message-snippet/server/methods/snippetMessage.js +++ b/packages/rocketchat-message-snippet/server/methods/snippetMessage.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ snippetMessage(message, filename) { if (Meteor.userId() == null) { diff --git a/packages/rocketchat-message-snippet/server/publications/snippetedMessage.js b/packages/rocketchat-message-snippet/server/publications/snippetedMessage.js index 7a5238292c4f..3143438f8a3d 100644 --- a/packages/rocketchat-message-snippet/server/publications/snippetedMessage.js +++ b/packages/rocketchat-message-snippet/server/publications/snippetedMessage.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('snippetedMessage', function(_id) { if (typeof this.userId === 'undefined' || this.userId === null) { return this.ready(); diff --git a/packages/rocketchat-message-snippet/server/publications/snippetedMessagesByRoom.js b/packages/rocketchat-message-snippet/server/publications/snippetedMessagesByRoom.js index fa5d4ac25ef7..629c44170032 100644 --- a/packages/rocketchat-message-snippet/server/publications/snippetedMessagesByRoom.js +++ b/packages/rocketchat-message-snippet/server/publications/snippetedMessagesByRoom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('snippetedMessages', function(rid, limit = 50) { if (typeof this.userId === 'undefined' || this.userId === null) { return this.ready(); diff --git a/packages/rocketchat-message-snippet/server/startup/settings.js b/packages/rocketchat-message-snippet/server/startup/settings.js index a147ab3d8a11..cbe192ff9543 100644 --- a/packages/rocketchat-message-snippet/server/startup/settings.js +++ b/packages/rocketchat-message-snippet/server/startup/settings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.settings.add('Message_AllowSnippeting', false, { type: 'boolean', diff --git a/packages/rocketchat-message-star/client/actionButton.js b/packages/rocketchat-message-star/client/actionButton.js index 5ed9dcb4ab34..cd526d5c69ba 100644 --- a/packages/rocketchat-message-star/client/actionButton.js +++ b/packages/rocketchat-message-star/client/actionButton.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-message-star/client/starMessage.js b/packages/rocketchat-message-star/client/starMessage.js index a7eaa16ab4bf..d476d7fb6d4e 100644 --- a/packages/rocketchat-message-star/client/starMessage.js +++ b/packages/rocketchat-message-star/client/starMessage.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ starMessage(message) { if (!Meteor.userId()) { diff --git a/packages/rocketchat-message-star/client/tabBar.js b/packages/rocketchat-message-star/client/tabBar.js index cee7e2134f69..11c82757e402 100644 --- a/packages/rocketchat-message-star/client/tabBar.js +++ b/packages/rocketchat-message-star/client/tabBar.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.TabBar.addButton({ groups: ['channel', 'group', 'direct'], diff --git a/packages/rocketchat-message-star/server/publications/starredMessages.js b/packages/rocketchat-message-star/server/publications/starredMessages.js index 44d2a530a8dd..5f74f33a3c77 100644 --- a/packages/rocketchat-message-star/server/publications/starredMessages.js +++ b/packages/rocketchat-message-star/server/publications/starredMessages.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('starredMessages', function(rid, limit = 50) { if (!this.userId) { return this.ready(); diff --git a/packages/rocketchat-message-star/server/settings.js b/packages/rocketchat-message-star/server/settings.js index a28663389bf8..1bdd83841f57 100644 --- a/packages/rocketchat-message-star/server/settings.js +++ b/packages/rocketchat-message-star/server/settings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { return RocketChat.settings.add('Message_AllowStarring', true, { type: 'boolean', diff --git a/packages/rocketchat-message-star/server/starMessage.js b/packages/rocketchat-message-star/server/starMessage.js index 1bacf3673cb9..c1b584e313f2 100644 --- a/packages/rocketchat-message-star/server/starMessage.js +++ b/packages/rocketchat-message-star/server/starMessage.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ starMessage(message) { if (!Meteor.userId()) { diff --git a/packages/rocketchat-message-star/server/startup/indexes.js b/packages/rocketchat-message-star/server/startup/indexes.js index 7b2a6e5e06f3..cf66635a235b 100644 --- a/packages/rocketchat-message-star/server/startup/indexes.js +++ b/packages/rocketchat-message-star/server/startup/indexes.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { return Meteor.defer(function() { return RocketChat.models.Messages.tryEnsureIndex({ diff --git a/packages/rocketchat-migrations/migrations.js b/packages/rocketchat-migrations/migrations.js index 4cc64ab8bae1..0d5e50581142 100644 --- a/packages/rocketchat-migrations/migrations.js +++ b/packages/rocketchat-migrations/migrations.js @@ -1,5 +1,6 @@ /* eslint no-use-before-define:0 */ /* globals Log*/ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-nrr/nrr.js b/packages/rocketchat-nrr/nrr.js index 284beafc7256..8376a6425869 100644 --- a/packages/rocketchat-nrr/nrr.js +++ b/packages/rocketchat-nrr/nrr.js @@ -1,5 +1,6 @@ /* eslint new-cap:0 */ +import { Meteor } from 'meteor/meteor'; import { Template } from 'meteor/templating'; import { Blaze } from 'meteor/blaze'; import { HTML } from 'meteor/htmljs'; diff --git a/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.js b/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.js index fea5989cc9f3..a443d6c1ffa3 100644 --- a/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.js +++ b/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.js @@ -1,4 +1,6 @@ /* globals ChatOAuthApps */ + +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; Template.oauthApp.onCreated(function() { diff --git a/packages/rocketchat-oauth2-server-config/admin/server/methods/addOAuthApp.js b/packages/rocketchat-oauth2-server-config/admin/server/methods/addOAuthApp.js index 20ef0cdb9c6e..67a2d90a3e63 100644 --- a/packages/rocketchat-oauth2-server-config/admin/server/methods/addOAuthApp.js +++ b/packages/rocketchat-oauth2-server-config/admin/server/methods/addOAuthApp.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.methods({ diff --git a/packages/rocketchat-oauth2-server-config/admin/server/methods/deleteOAuthApp.js b/packages/rocketchat-oauth2-server-config/admin/server/methods/deleteOAuthApp.js index 7d2d95099ee2..b9baddc7ee55 100644 --- a/packages/rocketchat-oauth2-server-config/admin/server/methods/deleteOAuthApp.js +++ b/packages/rocketchat-oauth2-server-config/admin/server/methods/deleteOAuthApp.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ deleteOAuthApp(applicationId) { if (!RocketChat.authz.hasPermission(this.userId, 'manage-oauth-apps')) { diff --git a/packages/rocketchat-oauth2-server-config/admin/server/methods/updateOAuthApp.js b/packages/rocketchat-oauth2-server-config/admin/server/methods/updateOAuthApp.js index b24e3787d84d..4e2813f52dc3 100644 --- a/packages/rocketchat-oauth2-server-config/admin/server/methods/updateOAuthApp.js +++ b/packages/rocketchat-oauth2-server-config/admin/server/methods/updateOAuthApp.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.methods({ diff --git a/packages/rocketchat-oauth2-server-config/admin/server/publications/oauthApps.js b/packages/rocketchat-oauth2-server-config/admin/server/publications/oauthApps.js index 33cc5f5ff955..f982776b1d43 100644 --- a/packages/rocketchat-oauth2-server-config/admin/server/publications/oauthApps.js +++ b/packages/rocketchat-oauth2-server-config/admin/server/publications/oauthApps.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('oauthApps', function() { if (!this.userId) { return this.ready(); diff --git a/packages/rocketchat-oauth2-server-config/oauth/client/oauth2-client.js b/packages/rocketchat-oauth2-server-config/oauth/client/oauth2-client.js index ba40305b5fc1..0955de0b3e70 100644 --- a/packages/rocketchat-oauth2-server-config/oauth/client/oauth2-client.js +++ b/packages/rocketchat-oauth2-server-config/oauth/client/oauth2-client.js @@ -1,5 +1,7 @@ // @ChatOAuthApps = new Mongo.Collection 'rocketchat_oauth_apps' /* globals ChatOAuthApps */ +import { Meteor } from 'meteor/meteor'; + FlowRouter.route('/oauth/authorize', { action(params, queryParams) { BlazeLayout.render('main', { diff --git a/packages/rocketchat-oauth2-server-config/oauth/server/oauth2-server.js b/packages/rocketchat-oauth2-server-config/oauth/server/oauth2-server.js index 4c6ee2dba9d0..fa1b150a5c09 100644 --- a/packages/rocketchat-oauth2-server-config/oauth/server/oauth2-server.js +++ b/packages/rocketchat-oauth2-server-config/oauth/server/oauth2-server.js @@ -1,4 +1,5 @@ /* global OAuth2Server */ +import { Meteor } from 'meteor/meteor'; const oauth2server = new OAuth2Server({ accessTokensCollectionName: 'rocketchat_oauth_access_tokens', diff --git a/packages/rocketchat-oembed/client/oembedAudioWidget.js b/packages/rocketchat-oembed/client/oembedAudioWidget.js index 9b4b997cba09..d315532323a9 100644 --- a/packages/rocketchat-oembed/client/oembedAudioWidget.js +++ b/packages/rocketchat-oembed/client/oembedAudioWidget.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Template.oembedAudioWidget.helpers({ collapsed() { if (this.collapsed) { diff --git a/packages/rocketchat-oembed/client/oembedFrameWidget.js b/packages/rocketchat-oembed/client/oembedFrameWidget.js index 59eabfe5d26e..e6a084b6c803 100644 --- a/packages/rocketchat-oembed/client/oembedFrameWidget.js +++ b/packages/rocketchat-oembed/client/oembedFrameWidget.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Template.oembedFrameWidget.helpers({ collapsed() { if (this.collapsed) { diff --git a/packages/rocketchat-oembed/client/oembedImageWidget.js b/packages/rocketchat-oembed/client/oembedImageWidget.js index a9e6f994c6a1..6f5b5fc1f8e7 100644 --- a/packages/rocketchat-oembed/client/oembedImageWidget.js +++ b/packages/rocketchat-oembed/client/oembedImageWidget.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Template.oembedImageWidget.helpers({ loadImage() { if (RocketChat.getUserPreference(Meteor.userId(), 'autoImageLoad') === false && this.downloadImages == null) { diff --git a/packages/rocketchat-oembed/client/oembedSandstormGrain.js b/packages/rocketchat-oembed/client/oembedSandstormGrain.js index f99fab7c693a..385279f66d8b 100644 --- a/packages/rocketchat-oembed/client/oembedSandstormGrain.js +++ b/packages/rocketchat-oembed/client/oembedSandstormGrain.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Template.oembedSandstormGrain.helpers({ token() { return this.meta.sandstorm.grain.token; diff --git a/packages/rocketchat-oembed/client/oembedUrlWidget.js b/packages/rocketchat-oembed/client/oembedUrlWidget.js index c8abef9ef4c3..d814522b0720 100644 --- a/packages/rocketchat-oembed/client/oembedUrlWidget.js +++ b/packages/rocketchat-oembed/client/oembedUrlWidget.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; const getTitle = function(self) { diff --git a/packages/rocketchat-oembed/client/oembedVideoWidget.js b/packages/rocketchat-oembed/client/oembedVideoWidget.js index 456b99b0dd05..77fac8d1621d 100644 --- a/packages/rocketchat-oembed/client/oembedVideoWidget.js +++ b/packages/rocketchat-oembed/client/oembedVideoWidget.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + const getTitle = function(self) { if (self.meta == null) { return; diff --git a/packages/rocketchat-oembed/client/oembedYoutubeWidget.js b/packages/rocketchat-oembed/client/oembedYoutubeWidget.js index e61b01211f36..15f019843134 100644 --- a/packages/rocketchat-oembed/client/oembedYoutubeWidget.js +++ b/packages/rocketchat-oembed/client/oembedYoutubeWidget.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Template.oembedYoutubeWidget.helpers({ collapsed() { if (this.collapsed) { diff --git a/packages/rocketchat-oembed/server/jumpToMessage.js b/packages/rocketchat-oembed/server/jumpToMessage.js index 10f877c33791..3dda81d070ce 100644 --- a/packages/rocketchat-oembed/server/jumpToMessage.js +++ b/packages/rocketchat-oembed/server/jumpToMessage.js @@ -1,4 +1,5 @@ /* globals getAvatarUrlFromUsername */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import URL from 'url'; import QueryString from 'querystring'; diff --git a/packages/rocketchat-oembed/server/server.js b/packages/rocketchat-oembed/server/server.js index b9c30bcce64c..b54b2a5ab754 100644 --- a/packages/rocketchat-oembed/server/server.js +++ b/packages/rocketchat-oembed/server/server.js @@ -1,4 +1,5 @@ /* globals HTTPInternals, changeCase */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import URL from 'url'; import querystring from 'querystring'; diff --git a/packages/rocketchat-otr/client/rocketchat.otr.js b/packages/rocketchat-otr/client/rocketchat.otr.js index 09df70ba9060..b4abfbae2e71 100644 --- a/packages/rocketchat-otr/client/rocketchat.otr.js +++ b/packages/rocketchat-otr/client/rocketchat.otr.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + class OTR { constructor() { this.enabled = new ReactiveVar(false); diff --git a/packages/rocketchat-otr/client/rocketchat.otr.room.js b/packages/rocketchat-otr/client/rocketchat.otr.room.js index 792a25d45a67..12d737369c4c 100644 --- a/packages/rocketchat-otr/client/rocketchat.otr.room.js +++ b/packages/rocketchat-otr/client/rocketchat.otr.room.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import toastr from 'toastr'; /* globals crypto */ diff --git a/packages/rocketchat-otr/client/tabBar.js b/packages/rocketchat-otr/client/tabBar.js index ee40389e8a17..42806dd4a2e6 100644 --- a/packages/rocketchat-otr/client/tabBar.js +++ b/packages/rocketchat-otr/client/tabBar.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { Tracker.autorun(function() { if (RocketChat.settings.get('OTR_Enable') && window.crypto) { diff --git a/packages/rocketchat-otr/client/views/otrFlexTab.js b/packages/rocketchat-otr/client/views/otrFlexTab.js index 28712ff3205e..ed9ab087b82c 100644 --- a/packages/rocketchat-otr/client/views/otrFlexTab.js +++ b/packages/rocketchat-otr/client/views/otrFlexTab.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Template.otrFlexTab.helpers({ otrAvailable() { return RocketChat.OTR && RocketChat.OTR.isEnabled(); diff --git a/packages/rocketchat-otr/server/methods/deleteOldOTRMessages.js b/packages/rocketchat-otr/server/methods/deleteOldOTRMessages.js index 0ad0dd3fc02e..4a9f150541f6 100644 --- a/packages/rocketchat-otr/server/methods/deleteOldOTRMessages.js +++ b/packages/rocketchat-otr/server/methods/deleteOldOTRMessages.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ deleteOldOTRMessages(roomId) { if (!Meteor.userId()) { diff --git a/packages/rocketchat-otr/server/methods/updateOTRAck.js b/packages/rocketchat-otr/server/methods/updateOTRAck.js index 776e78a1bd99..4d09c1efda90 100644 --- a/packages/rocketchat-otr/server/methods/updateOTRAck.js +++ b/packages/rocketchat-otr/server/methods/updateOTRAck.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ updateOTRAck(_id, ack) { if (!Meteor.userId()) { diff --git a/packages/rocketchat-push-notifications/client/tabBar.js b/packages/rocketchat-push-notifications/client/tabBar.js index 4a287651a3e7..075fdc4ad192 100644 --- a/packages/rocketchat-push-notifications/client/tabBar.js +++ b/packages/rocketchat-push-notifications/client/tabBar.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.TabBar.addButton({ groups: ['channel', 'group', 'direct'], diff --git a/packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.js b/packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.js index a91b18f5db3b..80f1ee3a2b0e 100644 --- a/packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.js +++ b/packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.js @@ -1,4 +1,5 @@ /* globals ChatSubscription popover */ +import { Meteor } from 'meteor/meteor'; const notificationLabels = { all: 'All_messages', diff --git a/packages/rocketchat-reactions/client/init.js b/packages/rocketchat-reactions/client/init.js index b5177799a857..0ecbc81c3f41 100644 --- a/packages/rocketchat-reactions/client/init.js +++ b/packages/rocketchat-reactions/client/init.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Template.room.events({ 'click .add-reaction, click [data-message-action="reaction-message"]'(event) { event.preventDefault(); diff --git a/packages/rocketchat-reactions/client/methods/setReaction.js b/packages/rocketchat-reactions/client/methods/setReaction.js index 28a626f645a6..b00d0551c802 100644 --- a/packages/rocketchat-reactions/client/methods/setReaction.js +++ b/packages/rocketchat-reactions/client/methods/setReaction.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.methods({ diff --git a/packages/rocketchat-reactions/setReaction.js b/packages/rocketchat-reactions/setReaction.js index 807ecdcb336a..9f915a082d39 100644 --- a/packages/rocketchat-reactions/setReaction.js +++ b/packages/rocketchat-reactions/setReaction.js @@ -1,4 +1,5 @@ /* globals msgStream */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; const removeUserReaction = (message, reaction, username) => { diff --git a/packages/rocketchat-retention-policy/server/cronPruneMessages.js b/packages/rocketchat-retention-policy/server/cronPruneMessages.js index 6aecf573ca05..10688adcc2e7 100644 --- a/packages/rocketchat-retention-policy/server/cronPruneMessages.js +++ b/packages/rocketchat-retention-policy/server/cronPruneMessages.js @@ -1,4 +1,5 @@ /* globals SyncedCron */ +import { Meteor } from 'meteor/meteor'; let types = []; diff --git a/packages/rocketchat-sandstorm/client/powerboxListener.js b/packages/rocketchat-sandstorm/client/powerboxListener.js index 307b3c6b8746..86a67456000d 100644 --- a/packages/rocketchat-sandstorm/client/powerboxListener.js +++ b/packages/rocketchat-sandstorm/client/powerboxListener.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.Sandstorm = RocketChat.Sandstorm || {}; RocketChat.Sandstorm.request = function() {}; diff --git a/packages/rocketchat-sandstorm/client/setPath.js b/packages/rocketchat-sandstorm/client/setPath.js index 004ab4cee8ea..92e374cca5e6 100644 --- a/packages/rocketchat-sandstorm/client/setPath.js +++ b/packages/rocketchat-sandstorm/client/setPath.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + function updateSandstormMetaData(msg) { return window.parent.postMessage(msg, '*'); } diff --git a/packages/rocketchat-sandstorm/server/events.js b/packages/rocketchat-sandstorm/server/events.js index e7a1c968918d..6666d67cce04 100644 --- a/packages/rocketchat-sandstorm/server/events.js +++ b/packages/rocketchat-sandstorm/server/events.js @@ -1,5 +1,5 @@ /* globals getHttpBridge, waitPromise */ - +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; RocketChat.Sandstorm.notify = function() {}; diff --git a/packages/rocketchat-sandstorm/server/powerbox.js b/packages/rocketchat-sandstorm/server/powerbox.js index 16aa28a346ce..32a70f532bba 100644 --- a/packages/rocketchat-sandstorm/server/powerbox.js +++ b/packages/rocketchat-sandstorm/server/powerbox.js @@ -1,5 +1,6 @@ /* globals getHttpBridge, waitPromise */ +import { Meteor } from 'meteor/meteor'; RocketChat.Sandstorm.offerUiView = function() {}; if (process.env.SANDSTORM === '1') { diff --git a/packages/rocketchat-search/client/provider/result.js b/packages/rocketchat-search/client/provider/result.js index dfabcf802d34..ecaff5beb7ac 100644 --- a/packages/rocketchat-search/client/provider/result.js +++ b/packages/rocketchat-search/client/provider/result.js @@ -1,4 +1,5 @@ /* globals FlowRouter, RoomHistoryManager */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.startup(function() { diff --git a/packages/rocketchat-search/client/search/search.js b/packages/rocketchat-search/client/search/search.js index de1c8300c919..2bd250f5d0e8 100644 --- a/packages/rocketchat-search/client/search/search.js +++ b/packages/rocketchat-search/client/search/search.js @@ -1,4 +1,5 @@ /* globals ReactiveVar, TAPi18n */ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; import _ from 'underscore'; diff --git a/packages/rocketchat-search/server/provider/defaultProvider.js b/packages/rocketchat-search/server/provider/defaultProvider.js index 808ace67aa21..2b28cc6cbbc0 100644 --- a/packages/rocketchat-search/server/provider/defaultProvider.js +++ b/packages/rocketchat-search/server/provider/defaultProvider.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { searchProviderService } from '../service/providerService'; import SearchProvider from '../model/provider'; diff --git a/packages/rocketchat-search/server/service/providerService.js b/packages/rocketchat-search/server/service/providerService.js index 701d34961b5f..78d893f092eb 100644 --- a/packages/rocketchat-search/server/service/providerService.js +++ b/packages/rocketchat-search/server/service/providerService.js @@ -1,4 +1,5 @@ /* globals RocketChat */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import { validationService } from '../service/validationService'; diff --git a/packages/rocketchat-search/server/service/validationService.js b/packages/rocketchat-search/server/service/validationService.js index e39e0e1efc40..ab74cea615a3 100644 --- a/packages/rocketchat-search/server/service/validationService.js +++ b/packages/rocketchat-search/server/service/validationService.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import SearchLogger from '../logger/logger'; class ValidationService { diff --git a/packages/rocketchat-setup-wizard/client/final.js b/packages/rocketchat-setup-wizard/client/final.js index db9870cd55ef..79f4a06fd392 100644 --- a/packages/rocketchat-setup-wizard/client/final.js +++ b/packages/rocketchat-setup-wizard/client/final.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Template.setupWizardFinal.onCreated(function() { const isSetupWizardDone = localStorage.getItem('wizardFinal'); if (isSetupWizardDone === null) { diff --git a/packages/rocketchat-setup-wizard/client/setupWizard.js b/packages/rocketchat-setup-wizard/client/setupWizard.js index 33119a940ce4..5f125d927bfe 100644 --- a/packages/rocketchat-setup-wizard/client/setupWizard.js +++ b/packages/rocketchat-setup-wizard/client/setupWizard.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + const cannotSetup = () => { const showSetupWizard = RocketChat.settings.get('Show_Setup_Wizard'); if (!showSetupWizard) { diff --git a/packages/rocketchat-setup-wizard/server/getSetupWizardParameters.js b/packages/rocketchat-setup-wizard/server/getSetupWizardParameters.js index 8e53d48a3196..664e00bbeca1 100644 --- a/packages/rocketchat-setup-wizard/server/getSetupWizardParameters.js +++ b/packages/rocketchat-setup-wizard/server/getSetupWizardParameters.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ getSetupWizardParameters() { const userId = Meteor.userId(); diff --git a/packages/rocketchat-slackbridge/server/RocketAdapter.js b/packages/rocketchat-slackbridge/server/RocketAdapter.js index 51f506e58376..699557d87958 100644 --- a/packages/rocketchat-slackbridge/server/RocketAdapter.js +++ b/packages/rocketchat-slackbridge/server/RocketAdapter.js @@ -1,5 +1,6 @@ /* globals logger*/ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; export default class RocketAdapter { diff --git a/packages/rocketchat-slackbridge/server/settings.js b/packages/rocketchat-slackbridge/server/settings.js index 3105c6410fd1..7414f7d08f00 100644 --- a/packages/rocketchat-slackbridge/server/settings.js +++ b/packages/rocketchat-slackbridge/server/settings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.settings.addGroup('SlackBridge', function() { this.add('SlackBridge_Enabled', false, { diff --git a/packages/rocketchat-slackbridge/server/slackbridge_import.server.js b/packages/rocketchat-slackbridge/server/slackbridge_import.server.js index 3e7cd0a27503..53b2d66cd6c5 100644 --- a/packages/rocketchat-slackbridge/server/slackbridge_import.server.js +++ b/packages/rocketchat-slackbridge/server/slackbridge_import.server.js @@ -1,4 +1,6 @@ /* globals msgStream */ +import { Meteor } from 'meteor/meteor'; + function SlackBridgeImport(command, params, item) { if (command !== 'slackbridge-import' || !Match.test(params, String)) { return; diff --git a/packages/rocketchat-slashcommand-asciiarts/gimme.js b/packages/rocketchat-slashcommand-asciiarts/gimme.js index 0c2b144e59ab..31477780a4e0 100644 --- a/packages/rocketchat-slashcommand-asciiarts/gimme.js +++ b/packages/rocketchat-slashcommand-asciiarts/gimme.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; /* * Gimme is a named function that will replace /gimme commands * @param {Object} message - The message object diff --git a/packages/rocketchat-slashcommand-asciiarts/lenny.js b/packages/rocketchat-slashcommand-asciiarts/lenny.js index f6a076d4a95b..1563524021a2 100644 --- a/packages/rocketchat-slashcommand-asciiarts/lenny.js +++ b/packages/rocketchat-slashcommand-asciiarts/lenny.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; /* * Lenny is a named function that will replace /lenny commands * @param {Object} message - The message object diff --git a/packages/rocketchat-slashcommand-asciiarts/shrug.js b/packages/rocketchat-slashcommand-asciiarts/shrug.js index ebf7ce99011d..672284780f3f 100644 --- a/packages/rocketchat-slashcommand-asciiarts/shrug.js +++ b/packages/rocketchat-slashcommand-asciiarts/shrug.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; /* * Shrug is a named function that will replace /shrug commands * @param {Object} message - The message object diff --git a/packages/rocketchat-slashcommand-asciiarts/tableflip.js b/packages/rocketchat-slashcommand-asciiarts/tableflip.js index 089190859ea0..56a9f859c48d 100644 --- a/packages/rocketchat-slashcommand-asciiarts/tableflip.js +++ b/packages/rocketchat-slashcommand-asciiarts/tableflip.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; /* * Tableflip is a named function that will replace /Tableflip commands * @param {Object} message - The message object diff --git a/packages/rocketchat-slashcommand-asciiarts/unflip.js b/packages/rocketchat-slashcommand-asciiarts/unflip.js index 43ecce05cd1b..6bedc8273c4c 100644 --- a/packages/rocketchat-slashcommand-asciiarts/unflip.js +++ b/packages/rocketchat-slashcommand-asciiarts/unflip.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; /* * Unflip is a named function that will replace /unflip commands * @param {Object} message - The message object diff --git a/packages/rocketchat-slashcommands-archiveroom/server/server.js b/packages/rocketchat-slashcommands-archiveroom/server/server.js index f3c49b46957b..eb1da38b51eb 100644 --- a/packages/rocketchat-slashcommands-archiveroom/server/server.js +++ b/packages/rocketchat-slashcommands-archiveroom/server/server.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + function Archive(command, params, item) { if (command !== 'archive' || !Match.test(params, String)) { return; diff --git a/packages/rocketchat-slashcommands-create/server/server.js b/packages/rocketchat-slashcommands-create/server/server.js index f4720daaf528..29cf5b092ca8 100644 --- a/packages/rocketchat-slashcommands-create/server/server.js +++ b/packages/rocketchat-slashcommands-create/server/server.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + function Create(command, params, item) { function getParams(str) { const regex = /(--(\w+))+/g; diff --git a/packages/rocketchat-slashcommands-help/server.js b/packages/rocketchat-slashcommands-help/server.js index 7c0ed451595a..d615e0031256 100644 --- a/packages/rocketchat-slashcommands-help/server.js +++ b/packages/rocketchat-slashcommands-help/server.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; /* * Help is a named function that will replace /join commands diff --git a/packages/rocketchat-slashcommands-hide/server/hide.js b/packages/rocketchat-slashcommands-hide/server/hide.js index 8462d8b91b53..1bb27d335f77 100644 --- a/packages/rocketchat-slashcommands-hide/server/hide.js +++ b/packages/rocketchat-slashcommands-hide/server/hide.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; /* * Hide is a named function that will replace /hide commands diff --git a/packages/rocketchat-slashcommands-invite/server/server.js b/packages/rocketchat-slashcommands-invite/server/server.js index 4203ad8cef64..3769ae5fa1fa 100644 --- a/packages/rocketchat-slashcommands-invite/server/server.js +++ b/packages/rocketchat-slashcommands-invite/server/server.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; /* * Invite is a named function that will replace /invite commands diff --git a/packages/rocketchat-slashcommands-inviteall/server/server.js b/packages/rocketchat-slashcommands-inviteall/server/server.js index d54f95b1515b..eafe53dc86b1 100644 --- a/packages/rocketchat-slashcommands-inviteall/server/server.js +++ b/packages/rocketchat-slashcommands-inviteall/server/server.js @@ -2,6 +2,7 @@ * Invite is a named function that will replace /invite commands * @param {Object} message - The message object */ +import { Meteor } from 'meteor/meteor'; function inviteAll(type) { return function inviteAll(command, params, item) { diff --git a/packages/rocketchat-slashcommands-join/server/server.js b/packages/rocketchat-slashcommands-join/server/server.js index b94a949c0732..ba1a2f1a2238 100644 --- a/packages/rocketchat-slashcommands-join/server/server.js +++ b/packages/rocketchat-slashcommands-join/server/server.js @@ -3,7 +3,7 @@ * Join is a named function that will replace /join commands * @param {Object} message - The message object */ - +import { Meteor } from 'meteor/meteor'; RocketChat.slashCommands.add('join', function Join(command, params, item) { diff --git a/packages/rocketchat-slashcommands-kick/server/server.js b/packages/rocketchat-slashcommands-kick/server/server.js index c0c3e78c5687..47c632778e0a 100644 --- a/packages/rocketchat-slashcommands-kick/server/server.js +++ b/packages/rocketchat-slashcommands-kick/server/server.js @@ -1,5 +1,6 @@ // Kick is a named function that will replace /kick commands +import { Meteor } from 'meteor/meteor'; const Kick = function(command, params, { rid }) { if (command !== 'kick' || !Match.test(params, String)) { diff --git a/packages/rocketchat-slashcommands-leave/leave.js b/packages/rocketchat-slashcommands-leave/leave.js index e29efa8868ac..9334fff969c4 100644 --- a/packages/rocketchat-slashcommands-leave/leave.js +++ b/packages/rocketchat-slashcommands-leave/leave.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; /* * Leave is a named function that will replace /leave commands diff --git a/packages/rocketchat-slashcommands-me/me.js b/packages/rocketchat-slashcommands-me/me.js index 4489833ced4b..bc6423fa757b 100644 --- a/packages/rocketchat-slashcommands-me/me.js +++ b/packages/rocketchat-slashcommands-me/me.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; /* diff --git a/packages/rocketchat-slashcommands-msg/server.js b/packages/rocketchat-slashcommands-msg/server.js index 01bbd6b925a0..55693a1d69ff 100644 --- a/packages/rocketchat-slashcommands-msg/server.js +++ b/packages/rocketchat-slashcommands-msg/server.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; /* * Msg is a named function that will replace /msg commands diff --git a/packages/rocketchat-slashcommands-mute/server/mute.js b/packages/rocketchat-slashcommands-mute/server/mute.js index 4894b884d160..dde77211d543 100644 --- a/packages/rocketchat-slashcommands-mute/server/mute.js +++ b/packages/rocketchat-slashcommands-mute/server/mute.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; /* * Mute is a named function that will replace /mute commands diff --git a/packages/rocketchat-slashcommands-mute/server/unmute.js b/packages/rocketchat-slashcommands-mute/server/unmute.js index 7282b69d66bf..150eacd10592 100644 --- a/packages/rocketchat-slashcommands-mute/server/unmute.js +++ b/packages/rocketchat-slashcommands-mute/server/unmute.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; /* * Unmute is a named function that will replace /unmute commands diff --git a/packages/rocketchat-slashcommands-open/client/client.js b/packages/rocketchat-slashcommands-open/client/client.js index fc05bc8fafdb..2491ef010716 100644 --- a/packages/rocketchat-slashcommands-open/client/client.js +++ b/packages/rocketchat-slashcommands-open/client/client.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + function Open(command, params /* , item*/) { const dict = { '#': ['c', 'p'], diff --git a/packages/rocketchat-slashcommands-topic/topic.js b/packages/rocketchat-slashcommands-topic/topic.js index f68870d06a1f..4e45c94e1243 100644 --- a/packages/rocketchat-slashcommands-topic/topic.js +++ b/packages/rocketchat-slashcommands-topic/topic.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + /* * Join is a named function that will replace /topic commands * @param {Object} message - The message object diff --git a/packages/rocketchat-slashcommands-unarchiveroom/server/server.js b/packages/rocketchat-slashcommands-unarchiveroom/server/server.js index 96f762eceee4..c1847f1ec0b7 100644 --- a/packages/rocketchat-slashcommands-unarchiveroom/server/server.js +++ b/packages/rocketchat-slashcommands-unarchiveroom/server/server.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + function Unarchive(command, params, item) { if (command !== 'unarchive' || !Match.test(params, String)) { return; diff --git a/packages/rocketchat-smarsh-connector/server/functions/generateEml.js b/packages/rocketchat-smarsh-connector/server/functions/generateEml.js index 515ca33d5251..2fd90a1f455f 100644 --- a/packages/rocketchat-smarsh-connector/server/functions/generateEml.js +++ b/packages/rocketchat-smarsh-connector/server/functions/generateEml.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import moment from 'moment'; import 'moment-timezone'; diff --git a/packages/rocketchat-smarsh-connector/server/startup.js b/packages/rocketchat-smarsh-connector/server/startup.js index b324b093670b..22a1c879cfc3 100644 --- a/packages/rocketchat-smarsh-connector/server/startup.js +++ b/packages/rocketchat-smarsh-connector/server/startup.js @@ -1,4 +1,5 @@ /* globals SyncedCron */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; const smarshJobName = 'Smarsh EML Connector'; diff --git a/packages/rocketchat-sms/SMS.js b/packages/rocketchat-sms/SMS.js index 60cfd7dbfeb8..42021bee8005 100644 --- a/packages/rocketchat-sms/SMS.js +++ b/packages/rocketchat-sms/SMS.js @@ -1,4 +1,6 @@ /* globals RocketChat */ +import { Meteor } from 'meteor/meteor'; + RocketChat.SMS = { enabled: false, services: {}, diff --git a/packages/rocketchat-sms/settings.js b/packages/rocketchat-sms/settings.js index 9c91346d8355..e91f6e8e6178 100644 --- a/packages/rocketchat-sms/settings.js +++ b/packages/rocketchat-sms/settings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.settings.addGroup('SMS', function() { this.add('SMS_Enabled', false, { diff --git a/packages/rocketchat-statistics/server/functions/get.js b/packages/rocketchat-statistics/server/functions/get.js index 372aac151799..c9dd5d2f590e 100644 --- a/packages/rocketchat-statistics/server/functions/get.js +++ b/packages/rocketchat-statistics/server/functions/get.js @@ -1,4 +1,5 @@ /* global InstanceStatus, MongoInternals */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import os from 'os'; import LivechatVisitors from 'meteor/rocketchat:livechat/server/models/LivechatVisitors'; diff --git a/packages/rocketchat-statistics/server/methods/getStatistics.js b/packages/rocketchat-statistics/server/methods/getStatistics.js index 903125471832..9694eac257c6 100644 --- a/packages/rocketchat-statistics/server/methods/getStatistics.js +++ b/packages/rocketchat-statistics/server/methods/getStatistics.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ getStatistics(refresh) { if (!Meteor.userId()) { diff --git a/packages/rocketchat-theme/server/server.js b/packages/rocketchat-theme/server/server.js index 61325fcf3f98..b2a6d8a5708b 100644 --- a/packages/rocketchat-theme/server/server.js +++ b/packages/rocketchat-theme/server/server.js @@ -1,5 +1,6 @@ /* globals WebAppHashing */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import less from 'less'; import Autoprefixer from 'less-plugin-autoprefix'; diff --git a/packages/rocketchat-token-login/client/login_token_client.js b/packages/rocketchat-token-login/client/login_token_client.js index 051e51d80ad9..9a850e3efe7c 100644 --- a/packages/rocketchat-token-login/client/login_token_client.js +++ b/packages/rocketchat-token-login/client/login_token_client.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.loginWithLoginToken = function(token) { Accounts.callLoginMethod({ methodArguments: [{ diff --git a/packages/rocketchat-token-login/server/login_token_server.js b/packages/rocketchat-token-login/server/login_token_server.js index d3a20126d71c..d46fe4a05ca6 100644 --- a/packages/rocketchat-token-login/server/login_token_server.js +++ b/packages/rocketchat-token-login/server/login_token_server.js @@ -1,4 +1,5 @@ /* globals Accounts */ +import { Meteor } from 'meteor/meteor'; Accounts.registerLoginHandler('login-token', function(result) { if (!result.loginToken) { diff --git a/packages/rocketchat-tokenpass/client/roomType.js b/packages/rocketchat-tokenpass/client/roomType.js index 71aa74ae91e9..314401959b42 100644 --- a/packages/rocketchat-tokenpass/client/roomType.js +++ b/packages/rocketchat-tokenpass/client/roomType.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { RoomTypeConfig } from 'meteor/rocketchat:lib'; class TokenPassRoomType extends RoomTypeConfig { diff --git a/packages/rocketchat-tokenpass/client/startup.js b/packages/rocketchat-tokenpass/client/startup.js index a878e904b628..8416a26634ed 100644 --- a/packages/rocketchat-tokenpass/client/startup.js +++ b/packages/rocketchat-tokenpass/client/startup.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.ChannelSettings.addOption({ group: ['room'], diff --git a/packages/rocketchat-tokenpass/client/tokenChannelsList.js b/packages/rocketchat-tokenpass/client/tokenChannelsList.js index 0044bb156aeb..44b33d61d5e3 100644 --- a/packages/rocketchat-tokenpass/client/tokenChannelsList.js +++ b/packages/rocketchat-tokenpass/client/tokenChannelsList.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Template.tokenChannelsList.helpers({ rooms() { return Template.instance().tokenpassRooms.get().filter((room) => RocketChat.models.Subscriptions.find({ rid: room._id }).count() === 0); diff --git a/packages/rocketchat-tokenpass/client/tokenpassChannelSettings.js b/packages/rocketchat-tokenpass/client/tokenpassChannelSettings.js index 0ea2a595a902..39e1f5ff5e0d 100644 --- a/packages/rocketchat-tokenpass/client/tokenpassChannelSettings.js +++ b/packages/rocketchat-tokenpass/client/tokenpassChannelSettings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Template.channelSettings__tokenpass.helpers({ addDisabled() { const { balance, token } = Template.instance(); diff --git a/packages/rocketchat-tokenpass/common.js b/packages/rocketchat-tokenpass/common.js index 245d102d2cd6..26f41eb15b8f 100644 --- a/packages/rocketchat-tokenpass/common.js +++ b/packages/rocketchat-tokenpass/common.js @@ -1,4 +1,5 @@ /* global CustomOAuth */ +import { Meteor } from 'meteor/meteor'; const config = { serverURL: '', diff --git a/packages/rocketchat-tokenpass/server/cronRemoveUsers.js b/packages/rocketchat-tokenpass/server/cronRemoveUsers.js index f8540c089bda..f94102506944 100644 --- a/packages/rocketchat-tokenpass/server/cronRemoveUsers.js +++ b/packages/rocketchat-tokenpass/server/cronRemoveUsers.js @@ -1,4 +1,6 @@ /* globals SyncedCron */ +import { Meteor } from 'meteor/meteor'; + function removeUsersFromTokenChannels() { const rooms = {}; diff --git a/packages/rocketchat-tokenpass/server/functions/getProtectedTokenpassBalances.js b/packages/rocketchat-tokenpass/server/functions/getProtectedTokenpassBalances.js index 7a8c440c4ed2..ea2cc40c4f5e 100644 --- a/packages/rocketchat-tokenpass/server/functions/getProtectedTokenpassBalances.js +++ b/packages/rocketchat-tokenpass/server/functions/getProtectedTokenpassBalances.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + let userAgent = 'Meteor'; if (Meteor.release) { userAgent += `/${ Meteor.release }`; } diff --git a/packages/rocketchat-tokenpass/server/functions/getPublicTokenpassBalances.js b/packages/rocketchat-tokenpass/server/functions/getPublicTokenpassBalances.js index 719b58f66aad..c58e80e2ea80 100644 --- a/packages/rocketchat-tokenpass/server/functions/getPublicTokenpassBalances.js +++ b/packages/rocketchat-tokenpass/server/functions/getPublicTokenpassBalances.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + let userAgent = 'Meteor'; if (Meteor.release) { userAgent += `/${ Meteor.release }`; } diff --git a/packages/rocketchat-tokenpass/server/functions/saveRoomTokens.js b/packages/rocketchat-tokenpass/server/functions/saveRoomTokens.js index 0a61985aea9c..a90272f48c02 100644 --- a/packages/rocketchat-tokenpass/server/functions/saveRoomTokens.js +++ b/packages/rocketchat-tokenpass/server/functions/saveRoomTokens.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.saveRoomTokenpass = function(rid, tokenpass) { if (!Match.test(rid, String)) { throw new Meteor.Error('invalid-room', 'Invalid room', { diff --git a/packages/rocketchat-tokenpass/server/functions/saveRoomTokensMinimumBalance.js b/packages/rocketchat-tokenpass/server/functions/saveRoomTokensMinimumBalance.js index 3012197cc109..8600eae78970 100644 --- a/packages/rocketchat-tokenpass/server/functions/saveRoomTokensMinimumBalance.js +++ b/packages/rocketchat-tokenpass/server/functions/saveRoomTokensMinimumBalance.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; RocketChat.saveRoomTokensMinimumBalance = function(rid, roomTokensMinimumBalance) { diff --git a/packages/rocketchat-tokenpass/server/methods/findTokenChannels.js b/packages/rocketchat-tokenpass/server/methods/findTokenChannels.js index c46915d3ee55..926c80715b27 100644 --- a/packages/rocketchat-tokenpass/server/methods/findTokenChannels.js +++ b/packages/rocketchat-tokenpass/server/methods/findTokenChannels.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ findTokenChannels() { if (!Meteor.userId()) { diff --git a/packages/rocketchat-tokenpass/server/methods/getChannelTokenpass.js b/packages/rocketchat-tokenpass/server/methods/getChannelTokenpass.js index da0928da8132..ae4d8e14ef31 100644 --- a/packages/rocketchat-tokenpass/server/methods/getChannelTokenpass.js +++ b/packages/rocketchat-tokenpass/server/methods/getChannelTokenpass.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ getChannelTokenpass(rid) { check(rid, String); diff --git a/packages/rocketchat-tokenpass/server/models/indexes.js b/packages/rocketchat-tokenpass/server/models/indexes.js index d438b667bead..63feff4a12a8 100644 --- a/packages/rocketchat-tokenpass/server/models/indexes.js +++ b/packages/rocketchat-tokenpass/server/models/indexes.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.models.Rooms.tryEnsureIndex({ 'tokenpass.tokens.token': 1 }); }); diff --git a/packages/rocketchat-tokenpass/server/startup.js b/packages/rocketchat-tokenpass/server/startup.js index 19b3d89938a8..97800dc2b274 100644 --- a/packages/rocketchat-tokenpass/server/startup.js +++ b/packages/rocketchat-tokenpass/server/startup.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.settings.addGroup('OAuth', function() { this.section('Tokenpass', function() { const enableQuery = { diff --git a/packages/rocketchat-ui-account/client/accountIntegrations.js b/packages/rocketchat-ui-account/client/accountIntegrations.js index 1a4185294e36..1ae306dca61c 100644 --- a/packages/rocketchat-ui-account/client/accountIntegrations.js +++ b/packages/rocketchat-ui-account/client/accountIntegrations.js @@ -1,5 +1,6 @@ /* global */ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; Template.accountIntegrations.helpers({ diff --git a/packages/rocketchat-ui-account/client/avatar/avatar.js b/packages/rocketchat-ui-account/client/avatar/avatar.js index 51f8c69b30de..ecfc3de4c4d8 100644 --- a/packages/rocketchat-ui-account/client/avatar/avatar.js +++ b/packages/rocketchat-ui-account/client/avatar/avatar.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Template.avatar.helpers({ src() { let { url } = Template.instance().data; diff --git a/packages/rocketchat-ui-account/client/avatar/prompt.js b/packages/rocketchat-ui-account/client/avatar/prompt.js index 5722aa7d18f3..d4c8965d1772 100644 --- a/packages/rocketchat-ui-account/client/avatar/prompt.js +++ b/packages/rocketchat-ui-account/client/avatar/prompt.js @@ -1,5 +1,6 @@ /* globals fileUploadHandler */ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; import toastr from 'toastr'; import mime from 'mime-type/with-db'; diff --git a/packages/rocketchat-ui-admin/client/adminInfo.js b/packages/rocketchat-ui-admin/client/adminInfo.js index 75b7fcfdc1a9..70877e0b428c 100644 --- a/packages/rocketchat-ui-admin/client/adminInfo.js +++ b/packages/rocketchat-ui-admin/client/adminInfo.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-ui-admin/client/rooms/channelSettingsDefault.js b/packages/rocketchat-ui-admin/client/rooms/channelSettingsDefault.js index 63c30c5f58c0..1c1267cb99cf 100644 --- a/packages/rocketchat-ui-admin/client/rooms/channelSettingsDefault.js +++ b/packages/rocketchat-ui-admin/client/rooms/channelSettingsDefault.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; /* globals AdminChatRoom */ diff --git a/packages/rocketchat-ui-admin/client/users/adminInviteUser.js b/packages/rocketchat-ui-admin/client/users/adminInviteUser.js index 58f580721e8e..2fd4239fadad 100644 --- a/packages/rocketchat-ui-admin/client/users/adminInviteUser.js +++ b/packages/rocketchat-ui-admin/client/users/adminInviteUser.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-admin/client/users/adminUsers.js b/packages/rocketchat-ui-admin/client/users/adminUsers.js index 62c1f9fbf763..5bc453f3309c 100644 --- a/packages/rocketchat-ui-admin/client/users/adminUsers.js +++ b/packages/rocketchat-ui-admin/client/users/adminUsers.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-admin/publications/adminRooms.js b/packages/rocketchat-ui-admin/publications/adminRooms.js index e1e651a26d29..197b92748bd4 100644 --- a/packages/rocketchat-ui-admin/publications/adminRooms.js +++ b/packages/rocketchat-ui-admin/publications/adminRooms.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-clean-history/client/lib/startup.js b/packages/rocketchat-ui-clean-history/client/lib/startup.js index c5db98fe85d0..f1a790d5a0b6 100644 --- a/packages/rocketchat-ui-clean-history/client/lib/startup.js +++ b/packages/rocketchat-ui-clean-history/client/lib/startup.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(() => { RocketChat.TabBar.addButton({ groups: ['channel', 'group', 'direct'], diff --git a/packages/rocketchat-ui-flextab/client/flexTabBar.js b/packages/rocketchat-ui-flextab/client/flexTabBar.js index c5fcec654db2..19615939a7e1 100644 --- a/packages/rocketchat-ui-flextab/client/flexTabBar.js +++ b/packages/rocketchat-ui-flextab/client/flexTabBar.js @@ -1,4 +1,5 @@ /* globals popover */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; const commonHelpers = { diff --git a/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js b/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js index bca76cbe4b27..731728f731fe 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js +++ b/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; const acEvents = { diff --git a/packages/rocketchat-ui-flextab/client/tabs/membersList.js b/packages/rocketchat-ui-flextab/client/tabs/membersList.js index f385395f4011..16ebe40bb050 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/membersList.js +++ b/packages/rocketchat-ui-flextab/client/tabs/membersList.js @@ -1,4 +1,5 @@ /* globals WebRTC popover isRtl */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import { getActions } from './userActions'; diff --git a/packages/rocketchat-ui-flextab/client/tabs/userEdit.js b/packages/rocketchat-ui-flextab/client/tabs/userEdit.js index de234edb3f9c..a2d08f6f92d7 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/userEdit.js +++ b/packages/rocketchat-ui-flextab/client/tabs/userEdit.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-flextab/client/tabs/userInfo.js b/packages/rocketchat-ui-flextab/client/tabs/userInfo.js index cfd4295d951e..4b00bf993dac 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/userInfo.js +++ b/packages/rocketchat-ui-flextab/client/tabs/userInfo.js @@ -1,4 +1,5 @@ /* globals RoomRoles UserRoles popover */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-ui-login/client/login/services.js b/packages/rocketchat-ui-login/client/login/services.js index 824b648d0d19..77a60249a6b3 100644 --- a/packages/rocketchat-ui-login/client/login/services.js +++ b/packages/rocketchat-ui-login/client/login/services.js @@ -1,4 +1,5 @@ /* globals CustomOAuth */ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-login/client/reset-password/resetPassword.js b/packages/rocketchat-ui-login/client/reset-password/resetPassword.js index f5fe6b12420a..2406d3a0b8d2 100644 --- a/packages/rocketchat-ui-login/client/reset-password/resetPassword.js +++ b/packages/rocketchat-ui-login/client/reset-password/resetPassword.js @@ -1,4 +1,6 @@ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; + Template.resetPassword.helpers({ requirePasswordChange() { const user = Meteor.user(); diff --git a/packages/rocketchat-ui-login/client/username/username.js b/packages/rocketchat-ui-login/client/username/username.js index b5c14f856f68..aa5bd4a5df51 100644 --- a/packages/rocketchat-ui-login/client/username/username.js +++ b/packages/rocketchat-ui-login/client/username/username.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Template.username.onCreated(function() { diff --git a/packages/rocketchat-ui-master/server/inject.js b/packages/rocketchat-ui-master/server/inject.js index 4cce5a5367df..fffa2d89526e 100644 --- a/packages/rocketchat-ui-master/server/inject.js +++ b/packages/rocketchat-ui-master/server/inject.js @@ -1,4 +1,5 @@ /* globals Inject */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-message/client/popup/messagePopup.js b/packages/rocketchat-ui-message/client/popup/messagePopup.js index 0381e2c9343a..94c9c845e4d5 100644 --- a/packages/rocketchat-ui-message/client/popup/messagePopup.js +++ b/packages/rocketchat-ui-message/client/popup/messagePopup.js @@ -2,6 +2,7 @@ // This is not supposed to be a complete list // it is just to improve readability in this file +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import { lazyloadtick } from 'meteor/rocketchat:lazy-load'; diff --git a/packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js b/packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js index de5b044d7c80..f190d998ea52 100644 --- a/packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js +++ b/packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js @@ -1,5 +1,6 @@ /* globals toolbarSearch */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; const keys = { diff --git a/packages/rocketchat-ui-message/startup/messageBoxActions.js b/packages/rocketchat-ui-message/startup/messageBoxActions.js index 2ae027e42a98..dc2daaff3b71 100644 --- a/packages/rocketchat-ui-message/startup/messageBoxActions.js +++ b/packages/rocketchat-ui-message/startup/messageBoxActions.js @@ -1,5 +1,6 @@ /* globals fileUpload device modal */ +import { Meteor } from 'meteor/meteor'; import mime from 'mime-type/with-db'; import { VRecDialog } from 'meteor/rocketchat:ui-vrecord'; diff --git a/packages/rocketchat-ui-sidenav/client/createCombinedFlex.js b/packages/rocketchat-ui-sidenav/client/createCombinedFlex.js index fa6813f0b97e..9e196372e80d 100644 --- a/packages/rocketchat-ui-sidenav/client/createCombinedFlex.js +++ b/packages/rocketchat-ui-sidenav/client/createCombinedFlex.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Template.createCombinedFlex.helpers({ diff --git a/packages/rocketchat-ui-sidenav/client/listChannelsFlex.js b/packages/rocketchat-ui-sidenav/client/listChannelsFlex.js index 0aa4d380f0c3..ce95e7eff142 100644 --- a/packages/rocketchat-ui-sidenav/client/listChannelsFlex.js +++ b/packages/rocketchat-ui-sidenav/client/listChannelsFlex.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-sidenav/client/listCombinedFlex.js b/packages/rocketchat-ui-sidenav/client/listCombinedFlex.js index e7eac3614d47..4cfcd6f1d6b1 100644 --- a/packages/rocketchat-ui-sidenav/client/listCombinedFlex.js +++ b/packages/rocketchat-ui-sidenav/client/listCombinedFlex.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-sidenav/client/roomList.js b/packages/rocketchat-ui-sidenav/client/roomList.js index 085700cb3631..c25669a019b2 100644 --- a/packages/rocketchat-ui-sidenav/client/roomList.js +++ b/packages/rocketchat-ui-sidenav/client/roomList.js @@ -1,4 +1,5 @@ /* globals RocketChat */ +import { Meteor } from 'meteor/meteor'; import { UiTextContext } from 'meteor/rocketchat:lib'; Template.roomList.helpers({ diff --git a/packages/rocketchat-ui-sidenav/client/sideNav.js b/packages/rocketchat-ui-sidenav/client/sideNav.js index df7c955c9e63..6d752fc05569 100644 --- a/packages/rocketchat-ui-sidenav/client/sideNav.js +++ b/packages/rocketchat-ui-sidenav/client/sideNav.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { lazyloadtick } from 'meteor/rocketchat:lazy-load'; /* globals menu*/ diff --git a/packages/rocketchat-ui-sidenav/client/sidebarHeader.js b/packages/rocketchat-ui-sidenav/client/sidebarHeader.js index f077a2c12cc6..1707830d0ecc 100644 --- a/packages/rocketchat-ui-sidenav/client/sidebarHeader.js +++ b/packages/rocketchat-ui-sidenav/client/sidebarHeader.js @@ -1,4 +1,6 @@ /* globals popover menu */ +import { Meteor } from 'meteor/meteor'; + const setStatus = (status) => { AccountBox.setStatus(status); RocketChat.callbacks.run('userStatusManuallySet', status); diff --git a/packages/rocketchat-ui-sidenav/client/sidebarItem.js b/packages/rocketchat-ui-sidenav/client/sidebarItem.js index 3ea87245b6fd..6de33f88e5aa 100644 --- a/packages/rocketchat-ui-sidenav/client/sidebarItem.js +++ b/packages/rocketchat-ui-sidenav/client/sidebarItem.js @@ -1,4 +1,5 @@ /* globals menu popover renderMessageBody */ +import { Meteor } from 'meteor/meteor'; import moment from 'moment'; Template.sidebarItem.helpers({ diff --git a/packages/rocketchat-ui-sidenav/client/sortlist.js b/packages/rocketchat-ui-sidenav/client/sortlist.js index b887f536d37f..9b083c6e6e5c 100644 --- a/packages/rocketchat-ui-sidenav/client/sortlist.js +++ b/packages/rocketchat-ui-sidenav/client/sortlist.js @@ -1,4 +1,5 @@ /* globals popover */ +import { Meteor } from 'meteor/meteor'; const checked = function(prop, field) { const userId = Meteor.userId(); diff --git a/packages/rocketchat-ui-sidenav/client/toolbar.js b/packages/rocketchat-ui-sidenav/client/toolbar.js index 3a0e31c92df0..93c04d84b97a 100644 --- a/packages/rocketchat-ui-sidenav/client/toolbar.js +++ b/packages/rocketchat-ui-sidenav/client/toolbar.js @@ -1,5 +1,6 @@ /* global menu */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; let isLoading; diff --git a/packages/rocketchat-ui/client/components/header/header.js b/packages/rocketchat-ui/client/components/header/header.js index afa981c48cfb..325f83b0b8cc 100644 --- a/packages/rocketchat-ui/client/components/header/header.js +++ b/packages/rocketchat-ui/client/components/header/header.js @@ -1,4 +1,5 @@ /* globals fireGlobalEvent*/ +import { Meteor } from 'meteor/meteor'; const isSubscribed = (_id) => ChatSubscription.find({ rid: _id }).count() > 0; diff --git a/packages/rocketchat-ui/client/lib/RoomHistoryManager.js b/packages/rocketchat-ui/client/lib/RoomHistoryManager.js index 71c2acd7a39e..0281fb645be6 100644 --- a/packages/rocketchat-ui/client/lib/RoomHistoryManager.js +++ b/packages/rocketchat-ui/client/lib/RoomHistoryManager.js @@ -1,4 +1,5 @@ /* globals readMessage UserRoles RoomRoles*/ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; export const upsertMessage = ({ msg, subscription }) => { diff --git a/packages/rocketchat-ui/client/lib/accountBox.js b/packages/rocketchat-ui/client/lib/accountBox.js index b67533de1012..94bb707186bc 100644 --- a/packages/rocketchat-ui/client/lib/accountBox.js +++ b/packages/rocketchat-ui/client/lib/accountBox.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; this.AccountBox = (function() { diff --git a/packages/rocketchat-ui/client/lib/accounts.js b/packages/rocketchat-ui/client/lib/accounts.js index 681a42ec81e7..5380b57034d3 100644 --- a/packages/rocketchat-ui/client/lib/accounts.js +++ b/packages/rocketchat-ui/client/lib/accounts.js @@ -1,4 +1,6 @@ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; + Accounts.onEmailVerificationLink(function(token, done) { Accounts.verifyEmail(token, function(error) { if (error == null) { diff --git a/packages/rocketchat-ui/client/lib/codeMirror/codeMirrorComponent.js b/packages/rocketchat-ui/client/lib/codeMirror/codeMirrorComponent.js index 74f5be911eef..a8875e37bbfd 100644 --- a/packages/rocketchat-ui/client/lib/codeMirror/codeMirrorComponent.js +++ b/packages/rocketchat-ui/client/lib/codeMirror/codeMirrorComponent.js @@ -1,6 +1,7 @@ /* global CodeMirrors */ CodeMirrors = {}; +import { Meteor } from 'meteor/meteor'; import 'codemirror/lib/codemirror.css'; import CodeMirror from 'codemirror/lib/codemirror.js'; diff --git a/packages/rocketchat-ui/client/lib/collections.js b/packages/rocketchat-ui/client/lib/collections.js index b5d469677ec2..fd04ac7b2e61 100644 --- a/packages/rocketchat-ui/client/lib/collections.js +++ b/packages/rocketchat-ui/client/lib/collections.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; this.ChatMessage = new Mongo.Collection(null); diff --git a/packages/rocketchat-ui/client/lib/cordova/facebook-login.js b/packages/rocketchat-ui/client/lib/cordova/facebook-login.js index 5e7c635c85ad..51707369695a 100644 --- a/packages/rocketchat-ui/client/lib/cordova/facebook-login.js +++ b/packages/rocketchat-ui/client/lib/cordova/facebook-login.js @@ -1,4 +1,6 @@ /* globals facebookConnectPlugin Facebook*/ +import { Meteor } from 'meteor/meteor'; + Meteor.loginWithFacebookCordova = function(options, callback) { if (!callback && typeof options === 'function') { callback = options; diff --git a/packages/rocketchat-ui/client/lib/cordova/keyboard-fix.js b/packages/rocketchat-ui/client/lib/cordova/keyboard-fix.js index f2fa1cdb4ac2..1f29da562996 100644 --- a/packages/rocketchat-ui/client/lib/cordova/keyboard-fix.js +++ b/packages/rocketchat-ui/client/lib/cordova/keyboard-fix.js @@ -1,4 +1,6 @@ /* globals device cordova*/ +import { Meteor } from 'meteor/meteor'; + if (Meteor.isCordova) { const body = $(document.body); document.addEventListener('deviceready', function() { diff --git a/packages/rocketchat-ui/client/lib/cordova/push.js b/packages/rocketchat-ui/client/lib/cordova/push.js index 3f508635827c..d597ca07296c 100644 --- a/packages/rocketchat-ui/client/lib/cordova/push.js +++ b/packages/rocketchat-ui/client/lib/cordova/push.js @@ -1,4 +1,6 @@ /* globals Push Servers*/ +import { Meteor } from 'meteor/meteor'; + if (Meteor.isCordova) { // Push.addListener 'token', (token) -> // Meteor.call 'log', 'CLIENT', 'token', arguments diff --git a/packages/rocketchat-ui/client/lib/cordova/urls.js b/packages/rocketchat-ui/client/lib/cordova/urls.js index ed6d9744e482..f4e7d8236aa4 100644 --- a/packages/rocketchat-ui/client/lib/cordova/urls.js +++ b/packages/rocketchat-ui/client/lib/cordova/urls.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(() => { if (!Meteor.isCordova) { return; } // Handle click events for all external URLs diff --git a/packages/rocketchat-ui/client/lib/cordova/user-state.js b/packages/rocketchat-ui/client/lib/cordova/user-state.js index 748eb57c00a8..db4762e0f4e5 100644 --- a/packages/rocketchat-ui/client/lib/cordova/user-state.js +++ b/packages/rocketchat-ui/client/lib/cordova/user-state.js @@ -1,4 +1,5 @@ /* globals UserPresence, readMessage */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; let timer = undefined; diff --git a/packages/rocketchat-ui/client/lib/fileUpload.js b/packages/rocketchat-ui/client/lib/fileUpload.js index ce9ed295eda5..50e674692d7d 100644 --- a/packages/rocketchat-ui/client/lib/fileUpload.js +++ b/packages/rocketchat-ui/client/lib/fileUpload.js @@ -1,5 +1,6 @@ /* globals fileUploadHandler, Handlebars, fileUpload, modal, t */ /* exported fileUpload */ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; const readAsDataURL = (file, callback) => { diff --git a/packages/rocketchat-ui/client/lib/iframeCommands.js b/packages/rocketchat-ui/client/lib/iframeCommands.js index 0d59f0e1b7a7..b6a0224e98c9 100644 --- a/packages/rocketchat-ui/client/lib/iframeCommands.js +++ b/packages/rocketchat-ui/client/lib/iframeCommands.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; const commands = { diff --git a/packages/rocketchat-ui/client/lib/msgTyping.js b/packages/rocketchat-ui/client/lib/msgTyping.js index dc3f76417239..3941a9fbdb5c 100644 --- a/packages/rocketchat-ui/client/lib/msgTyping.js +++ b/packages/rocketchat-ui/client/lib/msgTyping.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; export const MsgTyping = (function() { diff --git a/packages/rocketchat-ui/client/lib/readMessages.js b/packages/rocketchat-ui/client/lib/readMessages.js index 5e7ac2826595..4693ea2ed9f4 100644 --- a/packages/rocketchat-ui/client/lib/readMessages.js +++ b/packages/rocketchat-ui/client/lib/readMessages.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; /* DEFINITIONS @@ -140,15 +141,11 @@ const readMessage = new class { ts: { $lt: subscription.ls, }, - } - // 'u._id': - // $ne: Meteor.userId() - , { + }, { sort: { ts: -1, }, - } - ); + }); if ((lastReadRecord == null) && (RoomHistoryManager.getRoom(room.rid).unreadNotLoaded.get() === 0)) { lastReadRecord = @@ -170,13 +167,11 @@ const readMessage = new class { 'u._id': { $ne: Meteor.userId(), }, - } - , { + }, { sort: { ts: 1, }, - } - ); + }); if (firstUnreadRecord != null) { room.unreadFirstId = firstUnreadRecord._id; diff --git a/packages/rocketchat-ui/client/views/404/roomNotFound.js b/packages/rocketchat-ui/client/views/404/roomNotFound.js index f9481b614f52..04685b1382e4 100644 --- a/packages/rocketchat-ui/client/views/404/roomNotFound.js +++ b/packages/rocketchat-ui/client/views/404/roomNotFound.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Template.roomNotFound.helpers({ data() { return Session.get('roomNotFound'); diff --git a/packages/rocketchat-ui/client/views/app/createChannel.js b/packages/rocketchat-ui/client/views/app/createChannel.js index 232c745ab9c4..6cbf6140961e 100644 --- a/packages/rocketchat-ui/client/views/app/createChannel.js +++ b/packages/rocketchat-ui/client/views/app/createChannel.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; const acEvents = { diff --git a/packages/rocketchat-ui/client/views/app/directory.js b/packages/rocketchat-ui/client/views/app/directory.js index 21e640f6f080..ed8733092df1 100644 --- a/packages/rocketchat-ui/client/views/app/directory.js +++ b/packages/rocketchat-ui/client/views/app/directory.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import { timeAgo } from './helpers'; diff --git a/packages/rocketchat-ui/client/views/app/modal.js b/packages/rocketchat-ui/client/views/app/modal.js index f2157cffb9d8..6851f811b945 100644 --- a/packages/rocketchat-ui/client/views/app/modal.js +++ b/packages/rocketchat-ui/client/views/app/modal.js @@ -1,4 +1,5 @@ /* globals modal */ +import { Meteor } from 'meteor/meteor'; this.modal = { renderedModal: null, diff --git a/packages/rocketchat-ui/client/views/app/photoswipe.js b/packages/rocketchat-ui/client/views/app/photoswipe.js index dbbf19de227c..adc22287e76d 100644 --- a/packages/rocketchat-ui/client/views/app/photoswipe.js +++ b/packages/rocketchat-ui/client/views/app/photoswipe.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import PhotoSwipe from 'photoswipe'; import PhotoSwipeUI_Default from 'photoswipe/dist/photoswipe-ui-default'; import 'photoswipe/dist/photoswipe.css'; diff --git a/packages/rocketchat-ui/client/views/app/popover.js b/packages/rocketchat-ui/client/views/app/popover.js index 155f8bc4110d..c91ee1af0827 100644 --- a/packages/rocketchat-ui/client/views/app/popover.js +++ b/packages/rocketchat-ui/client/views/app/popover.js @@ -1,4 +1,5 @@ /* globals popover isRtl */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import { hide, leave } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-ui/client/views/app/secretURL.js b/packages/rocketchat-ui/client/views/app/secretURL.js index 4ede2ab9d7de..af32336689b4 100644 --- a/packages/rocketchat-ui/client/views/app/secretURL.js +++ b/packages/rocketchat-ui/client/views/app/secretURL.js @@ -1,4 +1,6 @@ /* globals KonchatNotification */ +import { Meteor } from 'meteor/meteor'; + Template.secretURL.helpers({ registrationAllowed() { const { hashIsValid } = Template.instance(); diff --git a/packages/rocketchat-ui/client/views/app/videoCall/videoCall.js b/packages/rocketchat-ui/client/views/app/videoCall/videoCall.js index 83ca3fb4bc09..f05aed90c741 100644 --- a/packages/rocketchat-ui/client/views/app/videoCall/videoCall.js +++ b/packages/rocketchat-ui/client/views/app/videoCall/videoCall.js @@ -1,4 +1,6 @@ /* globals WebRTC */ +import { Meteor } from 'meteor/meteor'; + Template.videoCall.onCreated(function() { return this.mainVideo = new ReactiveVar('$auto'); }); diff --git a/packages/rocketchat-ui/client/views/cmsPage.js b/packages/rocketchat-ui/client/views/cmsPage.js index 4daa5e167496..ac0e30876a47 100644 --- a/packages/rocketchat-ui/client/views/cmsPage.js +++ b/packages/rocketchat-ui/client/views/cmsPage.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Template.cmsPage.onCreated(function() { this.page = new ReactiveVar(''); return Meteor.autorun(() => { diff --git a/packages/rocketchat-ui/getAvatarUrlFromUsername.js b/packages/rocketchat-ui/getAvatarUrlFromUsername.js index d9e17c396539..e5453197c318 100644 --- a/packages/rocketchat-ui/getAvatarUrlFromUsername.js +++ b/packages/rocketchat-ui/getAvatarUrlFromUsername.js @@ -1,4 +1,6 @@ // TODO: remove global +import { Meteor } from 'meteor/meteor'; + this.getAvatarUrlFromUsername = function(username) { const key = `avatar_random_${ username }`; const random = typeof Session !== 'undefined' ? Session.keys[key] : 0; diff --git a/packages/rocketchat-user-data-download/server/cronProcessDownloads.js b/packages/rocketchat-user-data-download/server/cronProcessDownloads.js index 59af82a29b82..7de2b053477b 100644 --- a/packages/rocketchat-user-data-download/server/cronProcessDownloads.js +++ b/packages/rocketchat-user-data-download/server/cronProcessDownloads.js @@ -1,5 +1,6 @@ /* globals SyncedCron */ +import { Meteor } from 'meteor/meteor'; import fs from 'fs'; import path from 'path'; import archiver from 'archiver'; diff --git a/packages/rocketchat-version-check/client/client.js b/packages/rocketchat-version-check/client/client.js index 4c0679fe59e3..d7b7217d8604 100644 --- a/packages/rocketchat-version-check/client/client.js +++ b/packages/rocketchat-version-check/client/client.js @@ -1,4 +1,5 @@ /* globals alerts */ +import { Meteor } from 'meteor/meteor'; Meteor.startup(function() { Tracker.autorun(() => { diff --git a/packages/rocketchat-version-check/server/functions/checkVersionUpdate.js b/packages/rocketchat-version-check/server/functions/checkVersionUpdate.js index 31e4f1c1404d..72d1a7fe8f12 100644 --- a/packages/rocketchat-version-check/server/functions/checkVersionUpdate.js +++ b/packages/rocketchat-version-check/server/functions/checkVersionUpdate.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import semver from 'semver'; import getNewUpdates from './getNewUpdates'; import logger from '../logger'; diff --git a/packages/rocketchat-version-check/server/methods/banner_dismiss.js b/packages/rocketchat-version-check/server/methods/banner_dismiss.js index 885c4329e672..5080c68c332a 100644 --- a/packages/rocketchat-version-check/server/methods/banner_dismiss.js +++ b/packages/rocketchat-version-check/server/methods/banner_dismiss.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'banner/dismiss'({ id }) { if (!Meteor.userId()) { diff --git a/packages/rocketchat-version-check/server/server.js b/packages/rocketchat-version-check/server/server.js index 4dee1218cdd0..544ecdbfb4ec 100644 --- a/packages/rocketchat-version-check/server/server.js +++ b/packages/rocketchat-version-check/server/server.js @@ -1,5 +1,6 @@ /* globals SyncedCron */ +import { Meteor } from 'meteor/meteor'; import checkVersionUpdate from './functions/checkVersionUpdate'; import './methods/banner_dismiss'; import './addSettings'; diff --git a/packages/rocketchat-videobridge/client/tabBar.js b/packages/rocketchat-videobridge/client/tabBar.js index 1ca734471e3c..f33e071fb68f 100644 --- a/packages/rocketchat-videobridge/client/tabBar.js +++ b/packages/rocketchat-videobridge/client/tabBar.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { Tracker.autorun(function() { diff --git a/packages/rocketchat-videobridge/client/views/videoFlexTabBbb.js b/packages/rocketchat-videobridge/client/views/videoFlexTabBbb.js index f24d4a80f80d..fb2bc9819cf6 100644 --- a/packages/rocketchat-videobridge/client/views/videoFlexTabBbb.js +++ b/packages/rocketchat-videobridge/client/views/videoFlexTabBbb.js @@ -1,5 +1,6 @@ /* eslint new-cap: [2, {"capIsNewExceptions": ["MD5"]}] */ /* globals popout */ +import { Meteor } from 'meteor/meteor'; Template.videoFlexTabBbb.helpers({ openInNewWindow() { diff --git a/packages/rocketchat-videobridge/lib/messageType.js b/packages/rocketchat-videobridge/lib/messageType.js index 5804173411b9..6ae145e68f1a 100644 --- a/packages/rocketchat-videobridge/lib/messageType.js +++ b/packages/rocketchat-videobridge/lib/messageType.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.MessageTypes.registerType({ id: 'jitsi_call_started', diff --git a/packages/rocketchat-videobridge/server/methods/jitsiSetTimeout.js b/packages/rocketchat-videobridge/server/methods/jitsiSetTimeout.js index ef7ef7198f24..f581fdca031e 100644 --- a/packages/rocketchat-videobridge/server/methods/jitsiSetTimeout.js +++ b/packages/rocketchat-videobridge/server/methods/jitsiSetTimeout.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ 'jitsi:updateTimeout': (rid) => { diff --git a/packages/rocketchat-videobridge/server/settings.js b/packages/rocketchat-videobridge/server/settings.js index 8529234fcdf3..c229ab6c6bb4 100644 --- a/packages/rocketchat-videobridge/server/settings.js +++ b/packages/rocketchat-videobridge/server/settings.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.startup(function() { RocketChat.settings.addGroup('Video Conference', function() { diff --git a/packages/rocketchat-webdav/client/actionButton.js b/packages/rocketchat-webdav/client/actionButton.js index b7c4ef80af34..3eb6294e4cf3 100644 --- a/packages/rocketchat-webdav/client/actionButton.js +++ b/packages/rocketchat-webdav/client/actionButton.js @@ -1,4 +1,5 @@ /* globals modal, RocketChat*/ +import { Meteor } from 'meteor/meteor'; Meteor.startup(function() { diff --git a/packages/rocketchat-webdav/client/addWebdavAccount.js b/packages/rocketchat-webdav/client/addWebdavAccount.js index ee25ce2d11a6..db8c6358c064 100644 --- a/packages/rocketchat-webdav/client/addWebdavAccount.js +++ b/packages/rocketchat-webdav/client/addWebdavAccount.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-webdav/client/selectWebdavAccount.js b/packages/rocketchat-webdav/client/selectWebdavAccount.js index bb4fcd979948..aa5c51eb65a9 100644 --- a/packages/rocketchat-webdav/client/selectWebdavAccount.js +++ b/packages/rocketchat-webdav/client/selectWebdavAccount.js @@ -1,4 +1,5 @@ /* global */ +import { Meteor } from 'meteor/meteor'; import toastr from 'toastr'; Template.selectWebdavAccount.helpers({ diff --git a/packages/rocketchat-webdav/client/webdavFilePicker.js b/packages/rocketchat-webdav/client/webdavFilePicker.js index 34da1203b8bf..1f207c3cb38f 100644 --- a/packages/rocketchat-webdav/client/webdavFilePicker.js +++ b/packages/rocketchat-webdav/client/webdavFilePicker.js @@ -1,4 +1,5 @@ /* global fileUploadHandler, Handlebars */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import toastr from 'toastr'; import { Session } from 'meteor/session'; diff --git a/packages/rocketchat-webdav/server/methods/addWebdavAccount.js b/packages/rocketchat-webdav/server/methods/addWebdavAccount.js index b4f7a3af515e..0fb3c019b09e 100644 --- a/packages/rocketchat-webdav/server/methods/addWebdavAccount.js +++ b/packages/rocketchat-webdav/server/methods/addWebdavAccount.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import Webdav from 'webdav'; Meteor.methods({ diff --git a/packages/rocketchat-webdav/server/methods/getFileFromWebdav.js b/packages/rocketchat-webdav/server/methods/getFileFromWebdav.js index 3ad57fce1d3a..d344ac462161 100644 --- a/packages/rocketchat-webdav/server/methods/getFileFromWebdav.js +++ b/packages/rocketchat-webdav/server/methods/getFileFromWebdav.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import Webdav from 'webdav'; Meteor.methods({ diff --git a/packages/rocketchat-webdav/server/methods/getWebdavFileList.js b/packages/rocketchat-webdav/server/methods/getWebdavFileList.js index 93c3dcea0d63..14d621ef719f 100644 --- a/packages/rocketchat-webdav/server/methods/getWebdavFileList.js +++ b/packages/rocketchat-webdav/server/methods/getWebdavFileList.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import Webdav from 'webdav'; Meteor.methods({ diff --git a/packages/rocketchat-webdav/server/methods/removeWebdavAccount.js b/packages/rocketchat-webdav/server/methods/removeWebdavAccount.js index 4cc461de072c..78870aaca1a5 100644 --- a/packages/rocketchat-webdav/server/methods/removeWebdavAccount.js +++ b/packages/rocketchat-webdav/server/methods/removeWebdavAccount.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ removeWebdavAccount(accountId) { if (!Meteor.userId()) { diff --git a/packages/rocketchat-webdav/server/methods/uploadFileToWebdav.js b/packages/rocketchat-webdav/server/methods/uploadFileToWebdav.js index 394cbc3bcbaa..75cce42840e9 100644 --- a/packages/rocketchat-webdav/server/methods/uploadFileToWebdav.js +++ b/packages/rocketchat-webdav/server/methods/uploadFileToWebdav.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import Future from 'fibers/future'; import Webdav from 'webdav'; import stream from 'stream'; diff --git a/packages/rocketchat-webdav/server/publications/webdavAccounts.js b/packages/rocketchat-webdav/server/publications/webdavAccounts.js index 40723b452c64..78fafdf615ab 100644 --- a/packages/rocketchat-webdav/server/publications/webdavAccounts.js +++ b/packages/rocketchat-webdav/server/publications/webdavAccounts.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('webdavAccounts', function() { if (!this.userId) { return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'webdavAccounts' })); diff --git a/packages/rocketchat-webdav/startup/messageBoxActions.js b/packages/rocketchat-webdav/startup/messageBoxActions.js index d92167e28f5d..8695122ccdf4 100644 --- a/packages/rocketchat-webdav/startup/messageBoxActions.js +++ b/packages/rocketchat-webdav/startup/messageBoxActions.js @@ -1,4 +1,6 @@ /* globals modal, RocketChat */ +import { Meteor } from 'meteor/meteor'; + RocketChat.messageBox.actions.add('WebDAV', 'Add Server', { id: 'add-webdav', icon: 'plus', diff --git a/packages/rocketchat-webdav/startup/subscription.js b/packages/rocketchat-webdav/startup/subscription.js index 0f6247066b38..f9a991687c61 100644 --- a/packages/rocketchat-webdav/startup/subscription.js +++ b/packages/rocketchat-webdav/startup/subscription.js @@ -1,4 +1,6 @@ +import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; + Tracker.autorun(() => { if (Meteor.userId()) { Meteor.subscribe('webdavAccounts'); diff --git a/packages/rocketchat-wordpress/common.js b/packages/rocketchat-wordpress/common.js index 52fd703b4e70..b86878542583 100644 --- a/packages/rocketchat-wordpress/common.js +++ b/packages/rocketchat-wordpress/common.js @@ -1,4 +1,5 @@ /* globals CustomOAuth */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; const config = { diff --git a/server/lib/cordova.js b/server/lib/cordova.js index d24141f25e89..2677ebab7160 100644 --- a/server/lib/cordova.js +++ b/server/lib/cordova.js @@ -1,4 +1,5 @@ /* global Push, SystemLogger */ +import { Meteor } from 'meteor/meteor'; Meteor.methods({ // log() { diff --git a/server/methods/OEmbedCacheCleanup.js b/server/methods/OEmbedCacheCleanup.js index 0003bf0f9e8f..0b36f39621b5 100644 --- a/server/methods/OEmbedCacheCleanup.js +++ b/server/methods/OEmbedCacheCleanup.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ OEmbedCacheCleanup() { if (Meteor.userId() && !RocketChat.authz.hasRole(Meteor.userId(), 'admin')) { diff --git a/server/methods/addAllUserToRoom.js b/server/methods/addAllUserToRoom.js index 8c73c869b752..b59e7a37c2db 100644 --- a/server/methods/addAllUserToRoom.js +++ b/server/methods/addAllUserToRoom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ addAllUserToRoom(rid, activeUsersOnly = false) { diff --git a/server/methods/afterVerifyEmail.js b/server/methods/afterVerifyEmail.js index c7a5297d4a60..8419f065c683 100644 --- a/server/methods/afterVerifyEmail.js +++ b/server/methods/afterVerifyEmail.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.methods({ diff --git a/server/methods/browseChannels.js b/server/methods/browseChannels.js index 089f787356bc..af09de6580af 100644 --- a/server/methods/browseChannels.js +++ b/server/methods/browseChannels.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; const sortChannels = function(field, direction) { diff --git a/server/methods/canAccessRoom.js b/server/methods/canAccessRoom.js index 62cb87e6a473..5adb9edda2d0 100644 --- a/server/methods/canAccessRoom.js +++ b/server/methods/canAccessRoom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ canAccessRoom(rid, userId, extraData) { check(rid, String); diff --git a/server/methods/channelsList.js b/server/methods/channelsList.js index ca539c135689..1fd0584f10e0 100644 --- a/server/methods/channelsList.js +++ b/server/methods/channelsList.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/server/methods/deleteFileMessage.js b/server/methods/deleteFileMessage.js index e2cb4f72e162..c11dd3955cab 100644 --- a/server/methods/deleteFileMessage.js +++ b/server/methods/deleteFileMessage.js @@ -1,4 +1,6 @@ /* global FileUpload */ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ deleteFileMessage(fileID) { check(fileID, String); diff --git a/server/methods/eraseRoom.js b/server/methods/eraseRoom.js index bc7882330f09..8347ceeeb1be 100644 --- a/server/methods/eraseRoom.js +++ b/server/methods/eraseRoom.js @@ -1,4 +1,5 @@ /* globals RocketChat */ +import { Meteor } from 'meteor/meteor'; Meteor.methods({ eraseRoom(rid) { diff --git a/server/methods/getAvatarSuggestion.js b/server/methods/getAvatarSuggestion.js index 1bf4c0f697ec..49280f4ec706 100644 --- a/server/methods/getAvatarSuggestion.js +++ b/server/methods/getAvatarSuggestion.js @@ -1,4 +1,5 @@ /* global Gravatar */ +import { Meteor } from 'meteor/meteor'; function getAvatarSuggestionForUser(user) { check(user, Object); diff --git a/server/methods/getRoomIdByNameOrId.js b/server/methods/getRoomIdByNameOrId.js index 4b7bd0c7121a..3e229480de8e 100644 --- a/server/methods/getRoomIdByNameOrId.js +++ b/server/methods/getRoomIdByNameOrId.js @@ -1,4 +1,6 @@ // DEPRECATE +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ getRoomIdByNameOrId(rid) { check(rid, String); diff --git a/server/methods/getRoomNameById.js b/server/methods/getRoomNameById.js index d3d44c2ebe93..189e265f6357 100644 --- a/server/methods/getRoomNameById.js +++ b/server/methods/getRoomNameById.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ getRoomNameById(rid) { check(rid, String); diff --git a/server/methods/getTotalChannels.js b/server/methods/getTotalChannels.js index 23159db17abc..bd362a67b7e6 100644 --- a/server/methods/getTotalChannels.js +++ b/server/methods/getTotalChannels.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ getTotalChannels() { if (!Meteor.userId()) { diff --git a/server/methods/getUsernameSuggestion.js b/server/methods/getUsernameSuggestion.js index 5f61897a2876..45e241e43306 100644 --- a/server/methods/getUsernameSuggestion.js +++ b/server/methods/getUsernameSuggestion.js @@ -1,4 +1,5 @@ /* global slugify */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; function slug(text) { diff --git a/server/methods/getUsersOfRoom.js b/server/methods/getUsersOfRoom.js index efd0ea0f6996..ce9239fd86e4 100644 --- a/server/methods/getUsersOfRoom.js +++ b/server/methods/getUsersOfRoom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ getUsersOfRoom(rid, showAll) { const userId = Meteor.userId(); diff --git a/server/methods/hideRoom.js b/server/methods/hideRoom.js index be89e36c2973..b3f75b693a0b 100644 --- a/server/methods/hideRoom.js +++ b/server/methods/hideRoom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ hideRoom(rid) { check(rid, String); diff --git a/server/methods/ignoreUser.js b/server/methods/ignoreUser.js index 2cdc761aecc8..9fd96daea204 100644 --- a/server/methods/ignoreUser.js +++ b/server/methods/ignoreUser.js @@ -1,4 +1,5 @@ /* globals RocketChat */ +import { Meteor } from 'meteor/meteor'; Meteor.methods({ ignoreUser({ rid, userId: ignoredUser, ignore = true }) { diff --git a/server/methods/loadHistory.js b/server/methods/loadHistory.js index 8e91146de9d5..3d278405becf 100644 --- a/server/methods/loadHistory.js +++ b/server/methods/loadHistory.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + const hideMessagesOfType = []; RocketChat.settings.get(/Message_HideType_.+/, function(key, value) { diff --git a/server/methods/loadLocale.js b/server/methods/loadLocale.js index 4af92f2225a9..35b0beed0e22 100644 --- a/server/methods/loadLocale.js +++ b/server/methods/loadLocale.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ loadLocale(locale) { check(locale, String); diff --git a/server/methods/loadMissedMessages.js b/server/methods/loadMissedMessages.js index 548c27c9c402..92950f91fbb1 100644 --- a/server/methods/loadMissedMessages.js +++ b/server/methods/loadMissedMessages.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ loadMissedMessages(rid, start) { check(rid, String); diff --git a/server/methods/loadNextMessages.js b/server/methods/loadNextMessages.js index 431a6b399be7..49a3f96b0122 100644 --- a/server/methods/loadNextMessages.js +++ b/server/methods/loadNextMessages.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.methods({ diff --git a/server/methods/loadSurroundingMessages.js b/server/methods/loadSurroundingMessages.js index 97f6a39efd37..a8437274a48f 100644 --- a/server/methods/loadSurroundingMessages.js +++ b/server/methods/loadSurroundingMessages.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.methods({ diff --git a/server/methods/logoutCleanUp.js b/server/methods/logoutCleanUp.js index d418ed1e1474..81d99b65ff45 100644 --- a/server/methods/logoutCleanUp.js +++ b/server/methods/logoutCleanUp.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ logoutCleanUp(user) { check(user, Object); diff --git a/server/methods/messageSearch.js b/server/methods/messageSearch.js index 083a2d9bf85a..55ab07814f9d 100644 --- a/server/methods/messageSearch.js +++ b/server/methods/messageSearch.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; Meteor.methods({ diff --git a/server/methods/migrate.js b/server/methods/migrate.js index 90b0eedc5ced..49bc531fdae1 100644 --- a/server/methods/migrate.js +++ b/server/methods/migrate.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ migrateTo(version) { check(version, String); diff --git a/server/methods/muteUserInRoom.js b/server/methods/muteUserInRoom.js index 2ac51e8e46ee..92421bdcb3db 100644 --- a/server/methods/muteUserInRoom.js +++ b/server/methods/muteUserInRoom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ muteUserInRoom(data) { check(data, Match.ObjectIncluding({ diff --git a/server/methods/openRoom.js b/server/methods/openRoom.js index 9db671e579ca..9d299c4d63c1 100644 --- a/server/methods/openRoom.js +++ b/server/methods/openRoom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ openRoom(rid) { check(rid, String); diff --git a/server/methods/readMessages.js b/server/methods/readMessages.js index 951642a8d276..99b703305420 100644 --- a/server/methods/readMessages.js +++ b/server/methods/readMessages.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { ReadReceipt } from '../../imports/message-read-receipt/server/lib/ReadReceipt'; Meteor.methods({ diff --git a/server/methods/registerUser.js b/server/methods/registerUser.js index d38da86ef5c8..491aa23de9b7 100644 --- a/server/methods/registerUser.js +++ b/server/methods/registerUser.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; import * as Mailer from 'meteor/rocketchat:mailer'; let verifyEmailTemplate = ''; diff --git a/server/methods/removeRoomLeader.js b/server/methods/removeRoomLeader.js index ec8ffba57ca0..7d9ad71b6a14 100644 --- a/server/methods/removeRoomLeader.js +++ b/server/methods/removeRoomLeader.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ removeRoomLeader(rid, userId) { check(rid, String); diff --git a/server/methods/removeRoomModerator.js b/server/methods/removeRoomModerator.js index 04eb0c323c63..0ba3b840d48c 100644 --- a/server/methods/removeRoomModerator.js +++ b/server/methods/removeRoomModerator.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ removeRoomModerator(rid, userId) { check(rid, String); diff --git a/server/methods/removeRoomOwner.js b/server/methods/removeRoomOwner.js index caf7c3899cfe..a9a91cbcc214 100644 --- a/server/methods/removeRoomOwner.js +++ b/server/methods/removeRoomOwner.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ removeRoomOwner(rid, userId) { check(rid, String); diff --git a/server/methods/removeUserFromRoom.js b/server/methods/removeUserFromRoom.js index 9bb8d1ce2122..4ef4bc6037fb 100644 --- a/server/methods/removeUserFromRoom.js +++ b/server/methods/removeUserFromRoom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ removeUserFromRoom(data) { check(data, Match.ObjectIncluding({ diff --git a/server/methods/reportMessage.js b/server/methods/reportMessage.js index 2c99cbf5a8aa..25ad24d5f1b7 100644 --- a/server/methods/reportMessage.js +++ b/server/methods/reportMessage.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ reportMessage(messageId, description) { check(messageId, String); diff --git a/server/methods/requestDataDownload.js b/server/methods/requestDataDownload.js index baa8e0ed2b34..edce06739bd7 100644 --- a/server/methods/requestDataDownload.js +++ b/server/methods/requestDataDownload.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import fs from 'fs'; import path from 'path'; diff --git a/server/methods/resetAvatar.js b/server/methods/resetAvatar.js index 7d19ba3ec173..f5064b478acb 100644 --- a/server/methods/resetAvatar.js +++ b/server/methods/resetAvatar.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ resetAvatar() { if (!Meteor.userId()) { diff --git a/server/methods/roomNameExists.js b/server/methods/roomNameExists.js index 670da04e91f0..8942ce2b4c78 100644 --- a/server/methods/roomNameExists.js +++ b/server/methods/roomNameExists.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ roomNameExists(rid) { check(rid, String); diff --git a/server/methods/saveUserPreferences.js b/server/methods/saveUserPreferences.js index be78b7436253..129a3bb13dc9 100644 --- a/server/methods/saveUserPreferences.js +++ b/server/methods/saveUserPreferences.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ saveUserPreferences(settings) { const keys = { diff --git a/server/methods/saveUserProfile.js b/server/methods/saveUserProfile.js index bd45439533fb..4aeaf9c701d7 100644 --- a/server/methods/saveUserProfile.js +++ b/server/methods/saveUserProfile.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ saveUserProfile(settings, customFields) { check(settings, Object); diff --git a/server/methods/sendConfirmationEmail.js b/server/methods/sendConfirmationEmail.js index 7c162175312a..bbc82f58f163 100644 --- a/server/methods/sendConfirmationEmail.js +++ b/server/methods/sendConfirmationEmail.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import * as Mailer from 'meteor/rocketchat:mailer'; let subject = ''; diff --git a/server/methods/sendForgotPasswordEmail.js b/server/methods/sendForgotPasswordEmail.js index cb64a99b9469..d763b495c019 100644 --- a/server/methods/sendForgotPasswordEmail.js +++ b/server/methods/sendForgotPasswordEmail.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; import * as Mailer from 'meteor/rocketchat:mailer'; diff --git a/server/methods/setAvatarFromService.js b/server/methods/setAvatarFromService.js index 085c73207f5e..be2298e6d919 100644 --- a/server/methods/setAvatarFromService.js +++ b/server/methods/setAvatarFromService.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ setAvatarFromService(dataURI, contentType, service) { check(dataURI, String); diff --git a/server/methods/setUserActiveStatus.js b/server/methods/setUserActiveStatus.js index bb29660779ee..202f02d39e19 100644 --- a/server/methods/setUserActiveStatus.js +++ b/server/methods/setUserActiveStatus.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import * as Mailer from 'meteor/rocketchat:mailer'; Meteor.methods({ diff --git a/server/methods/setUserPassword.js b/server/methods/setUserPassword.js index 7c6ea5bed9a1..7db9f90a3caf 100644 --- a/server/methods/setUserPassword.js +++ b/server/methods/setUserPassword.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ setUserPassword(password) { check(password, String); diff --git a/server/methods/toogleFavorite.js b/server/methods/toogleFavorite.js index 0f40a4413728..24467ff439f0 100644 --- a/server/methods/toogleFavorite.js +++ b/server/methods/toogleFavorite.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ toggleFavorite(rid, f) { check(rid, String); diff --git a/server/methods/unmuteUserInRoom.js b/server/methods/unmuteUserInRoom.js index 93da71da70d0..05703b9ab432 100644 --- a/server/methods/unmuteUserInRoom.js +++ b/server/methods/unmuteUserInRoom.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ unmuteUserInRoom(data) { const fromId = Meteor.userId(); diff --git a/server/methods/userSetUtcOffset.js b/server/methods/userSetUtcOffset.js index 6869689d14c2..5860d6884840 100644 --- a/server/methods/userSetUtcOffset.js +++ b/server/methods/userSetUtcOffset.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.methods({ userSetUtcOffset(utcOffset) { check(utcOffset, Number); diff --git a/server/publications/activeUsers.js b/server/publications/activeUsers.js index bc50fd729d4d..05bdf63977cf 100644 --- a/server/publications/activeUsers.js +++ b/server/publications/activeUsers.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('activeUsers', function() { if (!this.userId) { return this.ready(); diff --git a/server/publications/channelAndPrivateAutocomplete.js b/server/publications/channelAndPrivateAutocomplete.js index 3ed2ed358c37..43b2333e73dc 100644 --- a/server/publications/channelAndPrivateAutocomplete.js +++ b/server/publications/channelAndPrivateAutocomplete.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('channelAndPrivateAutocomplete', function(selector) { if (!this.userId) { return this.ready(); diff --git a/server/publications/fullUserData.js b/server/publications/fullUserData.js index 8b93812fe13c..132adea23493 100644 --- a/server/publications/fullUserData.js +++ b/server/publications/fullUserData.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('fullUserData', function(filter, limit) { if (!this.userId) { return this.ready(); diff --git a/server/publications/messages.js b/server/publications/messages.js index 6efcea8fda2c..f7a3dfc3889f 100644 --- a/server/publications/messages.js +++ b/server/publications/messages.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.publish('messages', function(rid/* , start*/) { diff --git a/server/publications/room.js b/server/publications/room.js index d93e173d6254..407fc220a255 100644 --- a/server/publications/room.js +++ b/server/publications/room.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; const fields = { diff --git a/server/publications/roomFiles.js b/server/publications/roomFiles.js index f31d9c828c7d..ff9541701700 100644 --- a/server/publications/roomFiles.js +++ b/server/publications/roomFiles.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { roomFiles } from '../lib/roomFiles'; Meteor.publish('roomFiles', function(rid, limit = 50) { diff --git a/server/publications/roomFilesWithSearchText.js b/server/publications/roomFilesWithSearchText.js index 9d7dacdd6c75..7d0d975beaaf 100644 --- a/server/publications/roomFilesWithSearchText.js +++ b/server/publications/roomFilesWithSearchText.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import { roomFiles } from '../lib/roomFiles'; Meteor.publish('roomFilesWithSearchText', function(rid, searchText, limit = 50) { diff --git a/server/publications/roomSubscriptionsByRole.js b/server/publications/roomSubscriptionsByRole.js index 2a50d0f14cc2..254088183427 100644 --- a/server/publications/roomSubscriptionsByRole.js +++ b/server/publications/roomSubscriptionsByRole.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('roomSubscriptionsByRole', function(rid, role) { if (!this.userId) { return this.ready(); diff --git a/server/publications/spotlight.js b/server/publications/spotlight.js index 2f2cdc6f98c8..e5241346106c 100644 --- a/server/publications/spotlight.js +++ b/server/publications/spotlight.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import s from 'underscore.string'; function fetchRooms(userId, rooms) { diff --git a/server/publications/subscription.js b/server/publications/subscription.js index d0c731cd7ffd..4de4be271825 100644 --- a/server/publications/subscription.js +++ b/server/publications/subscription.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + const fields = { t: 1, ts: 1, diff --git a/server/publications/userAutocomplete.js b/server/publications/userAutocomplete.js index 012dffa34ee8..9241013edd8f 100644 --- a/server/publications/userAutocomplete.js +++ b/server/publications/userAutocomplete.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.publish('userAutocomplete', function(selector) { diff --git a/server/publications/userChannels.js b/server/publications/userChannels.js index d3fe48c96209..409235234e54 100644 --- a/server/publications/userChannels.js +++ b/server/publications/userChannels.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('userChannels', function(userId) { if (!this.userId) { return this.ready(); diff --git a/server/publications/userData.js b/server/publications/userData.js index 1f520bdbd704..3bd9f8a24c63 100644 --- a/server/publications/userData.js +++ b/server/publications/userData.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + Meteor.publish('userData', function() { if (!this.userId) { return this.ready(); diff --git a/server/startup/appcache.js b/server/startup/appcache.js index 984ad4479d84..bead53412668 100644 --- a/server/startup/appcache.js +++ b/server/startup/appcache.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + if (Meteor.AppCache) { Meteor.AppCache.config({ onlineOnly: ['/elements/', '/landing/', '/moment-locales/', '/scripts/'], diff --git a/server/startup/avatar.js b/server/startup/avatar.js index 119c2f1a2bb0..a3adb079854b 100644 --- a/server/startup/avatar.js +++ b/server/startup/avatar.js @@ -1,4 +1,5 @@ /* globals FileUpload */ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import sharp from 'sharp'; import { Cookies } from 'meteor/ostrio:cookies'; diff --git a/server/startup/cron.js b/server/startup/cron.js index b7467344851b..f8fc79e57b9d 100644 --- a/server/startup/cron.js +++ b/server/startup/cron.js @@ -1,4 +1,5 @@ /* global SyncedCron */ +import { Meteor } from 'meteor/meteor'; const logger = new Logger('SyncedCron'); diff --git a/server/startup/initialData.js b/server/startup/initialData.js index 331f2e17a647..a502b3112cf1 100644 --- a/server/startup/initialData.js +++ b/server/startup/initialData.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; Meteor.startup(function() { diff --git a/server/startup/migrations/v009.js b/server/startup/migrations/v009.js index 943239ff506b..61aaadeec9c4 100644 --- a/server/startup/migrations/v009.js +++ b/server/startup/migrations/v009.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.Migrations.add({ version: 9, up() { diff --git a/server/startup/migrations/v012.js b/server/startup/migrations/v012.js index f0b61d34b84c..91e726f7e434 100644 --- a/server/startup/migrations/v012.js +++ b/server/startup/migrations/v012.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.Migrations.add({ version: 12, up() { diff --git a/server/startup/migrations/v015.js b/server/startup/migrations/v015.js index 749a8e0f53e5..3add3aacb4cb 100644 --- a/server/startup/migrations/v015.js +++ b/server/startup/migrations/v015.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + RocketChat.Migrations.add({ version: 15, up() { diff --git a/server/startup/migrations/v019.js b/server/startup/migrations/v019.js index de3d672ed680..45e9c863e630 100644 --- a/server/startup/migrations/v019.js +++ b/server/startup/migrations/v019.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; RocketChat.Migrations.add({ diff --git a/server/startup/migrations/v036.js b/server/startup/migrations/v036.js index 633c18ef4b9d..36bbff09376a 100644 --- a/server/startup/migrations/v036.js +++ b/server/startup/migrations/v036.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import url from 'url'; RocketChat.Migrations.add({ diff --git a/server/startup/migrations/v099.js b/server/startup/migrations/v099.js index 5405c78e3c28..94a450260eef 100644 --- a/server/startup/migrations/v099.js +++ b/server/startup/migrations/v099.js @@ -1,5 +1,6 @@ /* globals SystemLogger */ +import { Meteor } from 'meteor/meteor'; import fs from 'fs'; import path from 'path'; diff --git a/server/startup/migrations/v106.js b/server/startup/migrations/v106.js index b66d194bd350..15c1c1c14d79 100644 --- a/server/startup/migrations/v106.js +++ b/server/startup/migrations/v106.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import LivechatVisitors from 'meteor/rocketchat:livechat/server/models/LivechatVisitors'; RocketChat.Migrations.add({ diff --git a/server/startup/migrations/v123.js b/server/startup/migrations/v123.js index 272cfc40c799..db04e4fcacf3 100644 --- a/server/startup/migrations/v123.js +++ b/server/startup/migrations/v123.js @@ -1,3 +1,5 @@ +import { Meteor } from 'meteor/meteor'; + let pageVisitedCollection; let messageCollection; let roomCollection; diff --git a/server/startup/migrations/v130.js b/server/startup/migrations/v130.js index fc24666b9bd0..70c212fbcbd1 100644 --- a/server/startup/migrations/v130.js +++ b/server/startup/migrations/v130.js @@ -1,3 +1,4 @@ +import { Meteor } from 'meteor/meteor'; import Future from 'fibers/future'; RocketChat.Migrations.add({ diff --git a/server/startup/presence.js b/server/startup/presence.js index 6bc6029168cc..123aa2309625 100644 --- a/server/startup/presence.js +++ b/server/startup/presence.js @@ -1,4 +1,5 @@ /* globals InstanceStatus, UserPresence, UserPresenceMonitor */ +import { Meteor } from 'meteor/meteor'; Meteor.startup(function() { const instance = { diff --git a/server/startup/serverRunning.js b/server/startup/serverRunning.js index 14c6ed03bcf1..da1e5c5dcd38 100644 --- a/server/startup/serverRunning.js +++ b/server/startup/serverRunning.js @@ -1,5 +1,6 @@ /* globals MongoInternals, SystemLogger */ +import { Meteor } from 'meteor/meteor'; import fs from 'fs'; import path from 'path'; import semver from 'semver'; From e6dfe65c80758340815ee4db212737d1280f9a72 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Fri, 19 Oct 2018 10:36:25 -0300 Subject: [PATCH 04/34] Fix tests --- tests/data/checks.js | 3 ++- tests/end-to-end/ui/00-login.js | 2 +- tests/end-to-end/ui/14-message-popup.js | 2 +- tests/pageobjects/setup-wizard.page.js | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/data/checks.js b/tests/data/checks.js index f546dca78a29..3bcf03d46fe8 100644 --- a/tests/data/checks.js +++ b/tests/data/checks.js @@ -1,4 +1,5 @@ -import { Meteor } from 'meteor/meteor'; +/* globals Meteor */ + import loginPage from '../pageobjects/login.page'; import mainContent from '../pageobjects/main-content.page'; import sideNav from '../pageobjects/side-nav.page'; diff --git a/tests/end-to-end/ui/00-login.js b/tests/end-to-end/ui/00-login.js index 588a9a2f948c..9e23ba22fd5b 100644 --- a/tests/end-to-end/ui/00-login.js +++ b/tests/end-to-end/ui/00-login.js @@ -1,6 +1,6 @@ /* eslint-env mocha */ +/* globals Meteor */ -import { Meteor } from 'meteor/meteor'; import loginPage from '../../pageobjects/login.page'; import setupWizard from '../../pageobjects/setup-wizard.page'; diff --git a/tests/end-to-end/ui/14-message-popup.js b/tests/end-to-end/ui/14-message-popup.js index 53ba21a2d7ee..5958d647916d 100644 --- a/tests/end-to-end/ui/14-message-popup.js +++ b/tests/end-to-end/ui/14-message-popup.js @@ -1,6 +1,6 @@ /* eslint-env mocha */ +/* globals Meteor */ -import { Meteor } from 'meteor/meteor'; import { adminEmail, adminPassword } from '../../data/user.js'; import { diff --git a/tests/pageobjects/setup-wizard.page.js b/tests/pageobjects/setup-wizard.page.js index 05fe8377eedd..2002fa3a4385 100644 --- a/tests/pageobjects/setup-wizard.page.js +++ b/tests/pageobjects/setup-wizard.page.js @@ -1,4 +1,5 @@ -import { Meteor } from 'meteor/meteor'; +/* globals Meteor */ + import Page from './Page'; import { adminEmail, adminPassword } from '../data/user'; From 2ac4a38bc05a270ec9b8e2155213b45f66523bb4 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Fri, 19 Oct 2018 14:13:24 -0300 Subject: [PATCH 05/34] Remove global variable SHA256 --- .eslintrc | 1 - packages/rocketchat-2fa/server/lib/totp.js | 1 + packages/rocketchat-crowd/server/crowd.js | 1 + packages/rocketchat-ldap/server/loginHandler.js | 1 + packages/rocketchat-ui-account/client/accountProfile.js | 1 + 5 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index 42e4850f3e0d..a585f46afe0b 100644 --- a/.eslintrc +++ b/.eslintrc @@ -54,7 +54,6 @@ "ServiceConfiguration" : false, "Session" : false, "Settings" : false, - "SHA256" : false, "SideNav" : false, "t" : false, "TAPi18n" : false, diff --git a/packages/rocketchat-2fa/server/lib/totp.js b/packages/rocketchat-2fa/server/lib/totp.js index f245d209f5d3..f177b496130a 100644 --- a/packages/rocketchat-2fa/server/lib/totp.js +++ b/packages/rocketchat-2fa/server/lib/totp.js @@ -1,3 +1,4 @@ +import { SHA256 } from 'meteor/sha'; import speakeasy from 'speakeasy'; RocketChat.TOTP = { diff --git a/packages/rocketchat-crowd/server/crowd.js b/packages/rocketchat-crowd/server/crowd.js index c430d78f8ac0..7ea4313e4e2b 100644 --- a/packages/rocketchat-crowd/server/crowd.js +++ b/packages/rocketchat-crowd/server/crowd.js @@ -1,5 +1,6 @@ /* globals:CROWD:true */ /* eslint new-cap: [2, {"capIsNewExceptions": ["SHA256"]}] */ +import { SHA256 } from 'meteor/sha'; import { Meteor } from 'meteor/meteor'; const logger = new Logger('CROWD', {}); diff --git a/packages/rocketchat-ldap/server/loginHandler.js b/packages/rocketchat-ldap/server/loginHandler.js index a50455f2544c..225ef9feeaac 100644 --- a/packages/rocketchat-ldap/server/loginHandler.js +++ b/packages/rocketchat-ldap/server/loginHandler.js @@ -1,5 +1,6 @@ /* eslint new-cap: [2, {"capIsNewExceptions": ["SHA256"]}] */ +import { SHA256 } from 'meteor/sha'; import { Meteor } from 'meteor/meteor'; import { slug, getLdapUsername, getLdapUserUniqueID, syncUserData, addLdapUser } from './sync'; import LDAP from './ldap'; diff --git a/packages/rocketchat-ui-account/client/accountProfile.js b/packages/rocketchat-ui-account/client/accountProfile.js index 74b530ee727e..20f360cea610 100644 --- a/packages/rocketchat-ui-account/client/accountProfile.js +++ b/packages/rocketchat-ui-account/client/accountProfile.js @@ -1,3 +1,4 @@ +import { SHA256 } from 'meteor/sha'; import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; From 0ebaa95f28db82ad22321fdd57ee98395043930a Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Fri, 19 Oct 2018 14:17:11 -0300 Subject: [PATCH 06/34] Remove global variable WebApp --- .eslintrc | 1 - packages/meteor-accounts-saml/saml_server.js | 1 + packages/rocketchat-assets/server/assets.js | 1 + packages/rocketchat-cas/server/cas_server.js | 1 + packages/rocketchat-cors/cors.js | 1 + .../rocketchat-custom-sounds/server/startup/custom-sounds.js | 1 + .../rocketchat-emoji-custom/server/startup/emoji-custom.js | 1 + packages/rocketchat-file-upload/server/lib/proxy.js | 1 + packages/rocketchat-lib/server/lib/debug.js | 1 + packages/rocketchat-livechat/livechat.js | 3 +-- packages/rocketchat-message-snippet/server/requests.js | 2 ++ .../oauth/server/oauth2-server.js | 1 + packages/rocketchat-theme/server/server.js | 1 + server/startup/avatar.js | 1 + 14 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.eslintrc b/.eslintrc index a585f46afe0b..0a73f205c0b8 100644 --- a/.eslintrc +++ b/.eslintrc @@ -66,7 +66,6 @@ "Triggers" : false, "UAParser" : false, "visitor" : false, - "WebApp" : false, "VideoRecorder" : false, "VRecDialog" : false } diff --git a/packages/meteor-accounts-saml/saml_server.js b/packages/meteor-accounts-saml/saml_server.js index d802d286dc5b..f759d1d06ec6 100644 --- a/packages/meteor-accounts-saml/saml_server.js +++ b/packages/meteor-accounts-saml/saml_server.js @@ -1,6 +1,7 @@ /* globals RoutePolicy, SAML */ /* jshint newcap: false */ import { Meteor } from 'meteor/meteor'; +import { WebApp } from 'meteor/webapp'; import _ from 'underscore'; if (!Accounts.saml) { diff --git a/packages/rocketchat-assets/server/assets.js b/packages/rocketchat-assets/server/assets.js index 307e0001154e..66b11b72e1b9 100644 --- a/packages/rocketchat-assets/server/assets.js +++ b/packages/rocketchat-assets/server/assets.js @@ -1,5 +1,6 @@ /* global WebAppHashing, WebAppInternals */ import { Meteor } from 'meteor/meteor'; +import { WebApp } from 'meteor/webapp'; import _ from 'underscore'; import sizeOf from 'image-size'; diff --git a/packages/rocketchat-cas/server/cas_server.js b/packages/rocketchat-cas/server/cas_server.js index 726157db8264..6f6cd5b59a41 100644 --- a/packages/rocketchat-cas/server/cas_server.js +++ b/packages/rocketchat-cas/server/cas_server.js @@ -1,6 +1,7 @@ /* globals RoutePolicy, logger */ /* jshint newcap: false */ import { Meteor } from 'meteor/meteor'; +import { WebApp } from 'meteor/webapp'; import _ from 'underscore'; import fiber from 'fibers'; diff --git a/packages/rocketchat-cors/cors.js b/packages/rocketchat-cors/cors.js index fb9c25d5e8ee..9d1f60f6c23e 100644 --- a/packages/rocketchat-cors/cors.js +++ b/packages/rocketchat-cors/cors.js @@ -1,5 +1,6 @@ /* globals WebAppInternals */ import { Meteor } from 'meteor/meteor'; +import { WebApp } from 'meteor/webapp'; import _ from 'underscore'; import url from 'url'; diff --git a/packages/rocketchat-custom-sounds/server/startup/custom-sounds.js b/packages/rocketchat-custom-sounds/server/startup/custom-sounds.js index 308f1536e636..226ed972cbfe 100644 --- a/packages/rocketchat-custom-sounds/server/startup/custom-sounds.js +++ b/packages/rocketchat-custom-sounds/server/startup/custom-sounds.js @@ -1,5 +1,6 @@ /* globals RocketChatFileCustomSoundsInstance */ import { Meteor } from 'meteor/meteor'; +import { WebApp } from 'meteor/webapp'; import _ from 'underscore'; Meteor.startup(function() { diff --git a/packages/rocketchat-emoji-custom/server/startup/emoji-custom.js b/packages/rocketchat-emoji-custom/server/startup/emoji-custom.js index ecff8cbc0da9..1a8c3aa50a43 100644 --- a/packages/rocketchat-emoji-custom/server/startup/emoji-custom.js +++ b/packages/rocketchat-emoji-custom/server/startup/emoji-custom.js @@ -1,5 +1,6 @@ /* globals RocketChatFileEmojiCustomInstance */ import { Meteor } from 'meteor/meteor'; +import { WebApp } from 'meteor/webapp'; import _ from 'underscore'; Meteor.startup(function() { diff --git a/packages/rocketchat-file-upload/server/lib/proxy.js b/packages/rocketchat-file-upload/server/lib/proxy.js index 5f5090947132..83653bd43a24 100644 --- a/packages/rocketchat-file-upload/server/lib/proxy.js +++ b/packages/rocketchat-file-upload/server/lib/proxy.js @@ -1,6 +1,7 @@ /* globals UploadFS, InstanceStatus */ import { Meteor } from 'meteor/meteor'; +import { WebApp } from 'meteor/webapp'; import http from 'http'; import URL from 'url'; diff --git a/packages/rocketchat-lib/server/lib/debug.js b/packages/rocketchat-lib/server/lib/debug.js index 1c7b577c2c27..f5ca069d8a04 100644 --- a/packages/rocketchat-lib/server/lib/debug.js +++ b/packages/rocketchat-lib/server/lib/debug.js @@ -1,5 +1,6 @@ /* global InstanceStatus */ import { Meteor } from 'meteor/meteor'; +import { WebApp } from 'meteor/webapp'; import _ from 'underscore'; const logger = new Logger('Meteor', { diff --git a/packages/rocketchat-livechat/livechat.js b/packages/rocketchat-livechat/livechat.js index 5b79e2d35634..ca7013d64052 100644 --- a/packages/rocketchat-livechat/livechat.js +++ b/packages/rocketchat-livechat/livechat.js @@ -1,9 +1,8 @@ -/* globals WebApp:true */ import { Meteor } from 'meteor/meteor'; +import { WebApp } from 'meteor/webapp'; import _ from 'underscore'; import url from 'url'; -const { WebApp } = Package.webapp; const { Autoupdate } = Package.autoupdate; WebApp.connectHandlers.use('/livechat', Meteor.bindEnvironment((req, res, next) => { diff --git a/packages/rocketchat-message-snippet/server/requests.js b/packages/rocketchat-message-snippet/server/requests.js index 5b54b8f6faed..65d1a1089fe5 100644 --- a/packages/rocketchat-message-snippet/server/requests.js +++ b/packages/rocketchat-message-snippet/server/requests.js @@ -1,4 +1,6 @@ /* global Cookies */ +import { WebApp } from 'meteor/webapp'; + WebApp.connectHandlers.use('/snippet/download', function(req, res) { let rawCookies; let token; diff --git a/packages/rocketchat-oauth2-server-config/oauth/server/oauth2-server.js b/packages/rocketchat-oauth2-server-config/oauth/server/oauth2-server.js index fa1b150a5c09..77cca296e015 100644 --- a/packages/rocketchat-oauth2-server-config/oauth/server/oauth2-server.js +++ b/packages/rocketchat-oauth2-server-config/oauth/server/oauth2-server.js @@ -1,5 +1,6 @@ /* global OAuth2Server */ import { Meteor } from 'meteor/meteor'; +import { WebApp } from 'meteor/webapp'; const oauth2server = new OAuth2Server({ accessTokensCollectionName: 'rocketchat_oauth_access_tokens', diff --git a/packages/rocketchat-theme/server/server.js b/packages/rocketchat-theme/server/server.js index b2a6d8a5708b..dabeb874fcf3 100644 --- a/packages/rocketchat-theme/server/server.js +++ b/packages/rocketchat-theme/server/server.js @@ -1,5 +1,6 @@ /* globals WebAppHashing */ +import { WebApp } from 'meteor/webapp'; import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import less from 'less'; diff --git a/server/startup/avatar.js b/server/startup/avatar.js index a3adb079854b..f1e66b5408da 100644 --- a/server/startup/avatar.js +++ b/server/startup/avatar.js @@ -1,4 +1,5 @@ /* globals FileUpload */ +import { WebApp } from 'meteor/webapp'; import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import sharp from 'sharp'; From 7db5aa9e5568c0f318ab390d84591a716be4ab18 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Fri, 19 Oct 2018 14:19:45 -0300 Subject: [PATCH 07/34] Remove global variable EJSON --- .eslintrc | 1 - packages/rocketchat-logger/server/server.js | 1 + packages/rocketchat-mail-messages/server/functions/sendMail.js | 1 + packages/rocketchat-otr/client/rocketchat.otr.room.js | 1 + 4 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index 0a73f205c0b8..d36694e9917b 100644 --- a/.eslintrc +++ b/.eslintrc @@ -19,7 +19,6 @@ "CryptoJS" : false, "Department" : false, "DDPRateLimiter" : false, - "EJSON" : false, "Email" : false, "FlowRouter" : false, "FileUpload" : false, diff --git a/packages/rocketchat-logger/server/server.js b/packages/rocketchat-logger/server/server.js index 608d62a30d03..92a824400298 100644 --- a/packages/rocketchat-logger/server/server.js +++ b/packages/rocketchat-logger/server/server.js @@ -1,5 +1,6 @@ /* globals EventEmitter LoggerManager SystemLogger Log*/ import { Meteor } from 'meteor/meteor'; +import { EJSON } from 'meteor/ejson'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-mail-messages/server/functions/sendMail.js b/packages/rocketchat-mail-messages/server/functions/sendMail.js index fa82ec2155f3..05c6aedd70f8 100644 --- a/packages/rocketchat-mail-messages/server/functions/sendMail.js +++ b/packages/rocketchat-mail-messages/server/functions/sendMail.js @@ -1,5 +1,6 @@ /* globals */ import { Meteor } from 'meteor/meteor'; +import { EJSON } from 'meteor/ejson'; import s from 'underscore.string'; import * as Mailer from 'meteor/rocketchat:mailer'; diff --git a/packages/rocketchat-otr/client/rocketchat.otr.room.js b/packages/rocketchat-otr/client/rocketchat.otr.room.js index 12d737369c4c..ca27a57ca187 100644 --- a/packages/rocketchat-otr/client/rocketchat.otr.room.js +++ b/packages/rocketchat-otr/client/rocketchat.otr.room.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { EJSON } from 'meteor/ejson'; import _ from 'underscore'; import toastr from 'toastr'; /* globals crypto */ From bff9b31327f008f38ef51e7752004f6d79c8a6a1 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Fri, 19 Oct 2018 14:21:10 -0300 Subject: [PATCH 08/34] Remove global variable Email --- .eslintrc | 1 - packages/rocketchat-mailer/server/api.js | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index d36694e9917b..8cc3c2a9dd26 100644 --- a/.eslintrc +++ b/.eslintrc @@ -19,7 +19,6 @@ "CryptoJS" : false, "Department" : false, "DDPRateLimiter" : false, - "Email" : false, "FlowRouter" : false, "FileUpload" : false, "HTTP" : false, diff --git a/packages/rocketchat-mailer/server/api.js b/packages/rocketchat-mailer/server/api.js index 1eb6ae07ec92..6b8e3bf4b6ca 100644 --- a/packages/rocketchat-mailer/server/api.js +++ b/packages/rocketchat-mailer/server/api.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Email } from 'meteor/email'; import _ from 'underscore'; import s from 'underscore.string'; import juice from 'juice'; From 4aafc1bfcb9da73479eb83b0d5a6048ecd70b30c Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Fri, 19 Oct 2018 14:25:15 -0300 Subject: [PATCH 09/34] Remove global variable HTTP --- .eslintrc | 1 - packages/chatpal-search/server/provider/index.js | 1 + packages/chatpal-search/server/utils/utils.js | 2 ++ packages/rocketchat-apps/server/bridges/http.js | 2 ++ packages/rocketchat-apps/server/communication/rest.js | 1 + packages/rocketchat-autotranslate/server/autotranslate.js | 1 + packages/rocketchat-custom-oauth/server/custom_oauth_server.js | 1 + packages/rocketchat-integrations/server/api/api.js | 1 + packages/rocketchat-integrations/server/lib/triggerHandler.js | 1 + packages/rocketchat-lib/server/functions/setUserAvatar.js | 1 + packages/rocketchat-lib/server/oauth/facebook.js | 1 + packages/rocketchat-lib/server/oauth/google.js | 1 + packages/rocketchat-livechat/server/hooks/RDStation.js | 2 ++ packages/rocketchat-livechat/server/lib/OmniChannel.js | 2 ++ packages/rocketchat-slackbridge/server/RocketAdapter.js | 1 + packages/rocketchat-slackbridge/server/SlackAdapter.js | 1 + .../server/functions/getProtectedTokenpassBalances.js | 1 + .../server/functions/getPublicTokenpassBalances.js | 1 + server/lib/cordova.js | 1 + server/lib/cordova/facebook-login.js | 1 + server/methods/getAvatarSuggestion.js | 1 + server/startup/cron.js | 1 + server/startup/migrations/v036.js | 1 + 23 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index 8cc3c2a9dd26..bf7579841c73 100644 --- a/.eslintrc +++ b/.eslintrc @@ -21,7 +21,6 @@ "DDPRateLimiter" : false, "FlowRouter" : false, "FileUpload" : false, - "HTTP" : false, "getNextAgent" : false, "handleError" : false, "getAvatarUrlFromUsername" : false, diff --git a/packages/chatpal-search/server/provider/index.js b/packages/chatpal-search/server/provider/index.js index 3a4e461b9a58..9a393ce05362 100644 --- a/packages/chatpal-search/server/provider/index.js +++ b/packages/chatpal-search/server/provider/index.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { HTTP } from 'meteor/http'; import ChatpalLogger from '../utils/logger'; import { Random } from 'meteor/random'; diff --git a/packages/chatpal-search/server/utils/utils.js b/packages/chatpal-search/server/utils/utils.js index ec76ba5aceb5..d30ba0415c64 100644 --- a/packages/chatpal-search/server/utils/utils.js +++ b/packages/chatpal-search/server/utils/utils.js @@ -1,4 +1,6 @@ import { Meteor } from 'meteor/meteor'; +import { HTTP } from 'meteor/http'; + Meteor.methods({ 'chatpalUtilsCreateKey'(email) { try { diff --git a/packages/rocketchat-apps/server/bridges/http.js b/packages/rocketchat-apps/server/bridges/http.js index 4d32f265950d..dcb51ec6ce9c 100644 --- a/packages/rocketchat-apps/server/bridges/http.js +++ b/packages/rocketchat-apps/server/bridges/http.js @@ -1,3 +1,5 @@ +import { HTTP } from 'meteor/http'; + export class AppHttpBridge { async call(info) { if (!info.request.content && typeof info.request.data === 'object') { diff --git a/packages/rocketchat-apps/server/communication/rest.js b/packages/rocketchat-apps/server/communication/rest.js index cd99f018ab59..68d30c1bf470 100644 --- a/packages/rocketchat-apps/server/communication/rest.js +++ b/packages/rocketchat-apps/server/communication/rest.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { HTTP } from 'meteor/http'; import Busboy from 'busboy'; export class AppsRestApi { diff --git a/packages/rocketchat-autotranslate/server/autotranslate.js b/packages/rocketchat-autotranslate/server/autotranslate.js index afbb6c5f0113..eeabb34eaae9 100644 --- a/packages/rocketchat-autotranslate/server/autotranslate.js +++ b/packages/rocketchat-autotranslate/server/autotranslate.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { HTTP } from 'meteor/http'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-custom-oauth/server/custom_oauth_server.js b/packages/rocketchat-custom-oauth/server/custom_oauth_server.js index 0c96ca95be68..76f05e0a461e 100644 --- a/packages/rocketchat-custom-oauth/server/custom_oauth_server.js +++ b/packages/rocketchat-custom-oauth/server/custom_oauth_server.js @@ -1,5 +1,6 @@ /* globals OAuth*/ import { Meteor } from 'meteor/meteor'; +import { HTTP } from 'meteor/http'; import _ from 'underscore'; const logger = new Logger('CustomOAuth'); diff --git a/packages/rocketchat-integrations/server/api/api.js b/packages/rocketchat-integrations/server/api/api.js index e6afa94c292f..80c9448c2998 100644 --- a/packages/rocketchat-integrations/server/api/api.js +++ b/packages/rocketchat-integrations/server/api/api.js @@ -1,6 +1,7 @@ /* globals Meteor Restivus logger processWebhookMessage*/ // TODO: remove globals +import { HTTP } from 'meteor/http'; import Fiber from 'fibers'; import Future from 'fibers/future'; import _ from 'underscore'; diff --git a/packages/rocketchat-integrations/server/lib/triggerHandler.js b/packages/rocketchat-integrations/server/lib/triggerHandler.js index a97fedb80e58..eb441a390699 100644 --- a/packages/rocketchat-integrations/server/lib/triggerHandler.js +++ b/packages/rocketchat-integrations/server/lib/triggerHandler.js @@ -1,5 +1,6 @@ /* global logger, processWebhookMessage */ import { Meteor } from 'meteor/meteor'; +import { HTTP } from 'meteor/http'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-lib/server/functions/setUserAvatar.js b/packages/rocketchat-lib/server/functions/setUserAvatar.js index 0985178849b2..dc4319aff6fb 100644 --- a/packages/rocketchat-lib/server/functions/setUserAvatar.js +++ b/packages/rocketchat-lib/server/functions/setUserAvatar.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { HTTP } from 'meteor/http'; RocketChat.setUserAvatar = function(user, dataURI, contentType, service) { let encoding; diff --git a/packages/rocketchat-lib/server/oauth/facebook.js b/packages/rocketchat-lib/server/oauth/facebook.js index 1776dce9d832..7f1bf4ab13ce 100644 --- a/packages/rocketchat-lib/server/oauth/facebook.js +++ b/packages/rocketchat-lib/server/oauth/facebook.js @@ -1,5 +1,6 @@ import _ from 'underscore'; import { OAuth } from 'meteor/oauth'; +import { HTTP } from 'meteor/http'; const crypto = Npm.require('crypto'); const whitelisted = [ 'id', diff --git a/packages/rocketchat-lib/server/oauth/google.js b/packages/rocketchat-lib/server/oauth/google.js index eaebc9b901a1..068a288ddc2d 100644 --- a/packages/rocketchat-lib/server/oauth/google.js +++ b/packages/rocketchat-lib/server/oauth/google.js @@ -1,5 +1,6 @@ /* globals Google */ import _ from 'underscore'; +import { HTTP } from 'meteor/http'; function getIdentity(accessToken) { try { diff --git a/packages/rocketchat-livechat/server/hooks/RDStation.js b/packages/rocketchat-livechat/server/hooks/RDStation.js index 04e9b5df19e8..f464fa78b5d8 100644 --- a/packages/rocketchat-livechat/server/hooks/RDStation.js +++ b/packages/rocketchat-livechat/server/hooks/RDStation.js @@ -1,3 +1,5 @@ +import { HTTP } from 'meteor/http'; + function sendToRDStation(room) { if (!RocketChat.settings.get('Livechat_RDStation_Token')) { return room; diff --git a/packages/rocketchat-livechat/server/lib/OmniChannel.js b/packages/rocketchat-livechat/server/lib/OmniChannel.js index 139b4ec5d9f7..f4855b5d3920 100644 --- a/packages/rocketchat-livechat/server/lib/OmniChannel.js +++ b/packages/rocketchat-livechat/server/lib/OmniChannel.js @@ -1,3 +1,5 @@ +import { HTTP } from 'meteor/http'; + const gatewayURL = 'https://omni.rocket.chat'; export default { diff --git a/packages/rocketchat-slackbridge/server/RocketAdapter.js b/packages/rocketchat-slackbridge/server/RocketAdapter.js index 699557d87958..11d13f9bd384 100644 --- a/packages/rocketchat-slackbridge/server/RocketAdapter.js +++ b/packages/rocketchat-slackbridge/server/RocketAdapter.js @@ -1,6 +1,7 @@ /* globals logger*/ import { Meteor } from 'meteor/meteor'; +import { HTTP } from 'meteor/http'; import _ from 'underscore'; export default class RocketAdapter { diff --git a/packages/rocketchat-slackbridge/server/SlackAdapter.js b/packages/rocketchat-slackbridge/server/SlackAdapter.js index 2363f3d553d8..70b20da13afe 100644 --- a/packages/rocketchat-slackbridge/server/SlackAdapter.js +++ b/packages/rocketchat-slackbridge/server/SlackAdapter.js @@ -1,5 +1,6 @@ /* globals logger*/ import { Meteor } from 'meteor/meteor'; +import { HTTP } from 'meteor/http'; import _ from 'underscore'; import url from 'url'; import http from 'http'; diff --git a/packages/rocketchat-tokenpass/server/functions/getProtectedTokenpassBalances.js b/packages/rocketchat-tokenpass/server/functions/getProtectedTokenpassBalances.js index ea2cc40c4f5e..6b1bc586f597 100644 --- a/packages/rocketchat-tokenpass/server/functions/getProtectedTokenpassBalances.js +++ b/packages/rocketchat-tokenpass/server/functions/getProtectedTokenpassBalances.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { HTTP } from 'meteor/http'; let userAgent = 'Meteor'; if (Meteor.release) { userAgent += `/${ Meteor.release }`; } diff --git a/packages/rocketchat-tokenpass/server/functions/getPublicTokenpassBalances.js b/packages/rocketchat-tokenpass/server/functions/getPublicTokenpassBalances.js index c58e80e2ea80..0083676c1b73 100644 --- a/packages/rocketchat-tokenpass/server/functions/getPublicTokenpassBalances.js +++ b/packages/rocketchat-tokenpass/server/functions/getPublicTokenpassBalances.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { HTTP } from 'meteor/http'; let userAgent = 'Meteor'; if (Meteor.release) { userAgent += `/${ Meteor.release }`; } diff --git a/server/lib/cordova.js b/server/lib/cordova.js index 2677ebab7160..d57738d62f16 100644 --- a/server/lib/cordova.js +++ b/server/lib/cordova.js @@ -1,5 +1,6 @@ /* global Push, SystemLogger */ import { Meteor } from 'meteor/meteor'; +import { HTTP } from 'meteor/http'; Meteor.methods({ // log() { diff --git a/server/lib/cordova/facebook-login.js b/server/lib/cordova/facebook-login.js index 6ce9fd422c2e..3e2a0f3fd748 100644 --- a/server/lib/cordova/facebook-login.js +++ b/server/lib/cordova/facebook-login.js @@ -1,4 +1,5 @@ import _ from 'underscore'; +import { HTTP } from 'meteor/http'; function getIdentity(accessToken) { try { diff --git a/server/methods/getAvatarSuggestion.js b/server/methods/getAvatarSuggestion.js index 49280f4ec706..3b831c5620b4 100644 --- a/server/methods/getAvatarSuggestion.js +++ b/server/methods/getAvatarSuggestion.js @@ -1,5 +1,6 @@ /* global Gravatar */ import { Meteor } from 'meteor/meteor'; +import { HTTP } from 'meteor/http'; function getAvatarSuggestionForUser(user) { check(user, Object); diff --git a/server/startup/cron.js b/server/startup/cron.js index f8fc79e57b9d..1c68fcf4df64 100644 --- a/server/startup/cron.js +++ b/server/startup/cron.js @@ -1,5 +1,6 @@ /* global SyncedCron */ import { Meteor } from 'meteor/meteor'; +import { HTTP } from 'meteor/http'; const logger = new Logger('SyncedCron'); diff --git a/server/startup/migrations/v036.js b/server/startup/migrations/v036.js index 36bbff09376a..5fc1479cb6eb 100644 --- a/server/startup/migrations/v036.js +++ b/server/startup/migrations/v036.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { HTTP } from 'meteor/http'; import url from 'url'; RocketChat.Migrations.add({ From 4551e92e1498c5048e891804f6c450ced9014137 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Fri, 19 Oct 2018 14:34:06 -0300 Subject: [PATCH 10/34] Remove global variable Random --- .eslintrc | 1 - packages/meteor-accounts-saml/saml_client.js | 2 ++ packages/meteor-accounts-saml/saml_server.js | 1 + packages/rocketchat-2fa/server/lib/totp.js | 1 + packages/rocketchat-api/server/v1/commands.js | 1 + packages/rocketchat-api/server/v1/push.js | 1 + packages/rocketchat-apps/server/bridges/messages.js | 1 + packages/rocketchat-apps/server/converters/messages.js | 2 ++ .../client/views/autoTranslateFlexTab.js | 1 + packages/rocketchat-cas/client/cas_client.js | 1 + packages/rocketchat-cas/server/cas_server.js | 1 + packages/rocketchat-custom-oauth/client/custom_oauth_client.js | 1 + packages/rocketchat-file-upload/lib/FileUploadBase.js | 1 + .../server/config/Slingshot_DEPRECATED.js | 1 + .../rocketchat-file-upload/server/methods/sendFileMessage.js | 1 + packages/rocketchat-file-upload/ufs/AmazonS3/server.js | 1 + packages/rocketchat-file-upload/ufs/GoogleStorage/server.js | 1 + packages/rocketchat-file-upload/ufs/Webdav/server.js | 1 + packages/rocketchat-google-vision/server/googlevision.js | 1 + .../rocketchat-importer-hipchat-enterprise/server/importer.js | 1 + packages/rocketchat-importer-slack-users/server/importer.js | 1 + .../client/views/integrationsIncoming.js | 1 + .../client/views/integrationsOutgoing.js | 1 + packages/rocketchat-integrations/server/api/api.js | 1 + packages/rocketchat-integrations/server/lib/triggerHandler.js | 1 + .../server/methods/incoming/addIncomingIntegration.js | 1 + packages/rocketchat-katex/katex.js | 1 + packages/rocketchat-lib/lib/RoomTypeConfig.js | 1 + packages/rocketchat-lib/lib/callbacks.js | 1 + packages/rocketchat-lib/lib/promises.js | 1 + packages/rocketchat-lib/server/methods/filterATAllTag.js | 1 + packages/rocketchat-lib/server/methods/filterATHereTag.js | 1 + packages/rocketchat-lib/server/methods/sendMessage.js | 1 + packages/rocketchat-lib/server/startup/settings.js | 1 + packages/rocketchat-livechat/.app/client/lib/chatMessages.js | 1 + packages/rocketchat-livechat/.app/client/lib/hooks.js | 1 + packages/rocketchat-livechat/.app/client/lib/triggers.js | 1 + packages/rocketchat-livechat/.app/client/startup/visitor.js | 1 + packages/rocketchat-livechat/.app/imports/client/visitor.js | 2 ++ .../rocketchat-livechat/client/views/app/livechatAppearance.js | 1 + packages/rocketchat-livechat/imports/server/rest/facebook.js | 1 + packages/rocketchat-livechat/imports/server/rest/sms.js | 1 + packages/rocketchat-livechat/server/api/lib/livechat.js | 1 + packages/rocketchat-livechat/server/api/v1/message.js | 1 + packages/rocketchat-livechat/server/api/v1/room.js | 1 + packages/rocketchat-livechat/server/api/v1/videoCall.js | 1 + packages/rocketchat-livechat/server/lib/Livechat.js | 1 + .../server/methods/sendFileLivechatMessage.js | 1 + .../rocketchat-livechat/server/methods/startFileUploadRoom.js | 1 + packages/rocketchat-livechat/server/methods/startVideoCall.js | 1 + packages/rocketchat-logger/server/server.js | 1 + packages/rocketchat-mentions/server/server.js | 1 + .../admin/server/methods/addOAuthApp.js | 1 + packages/rocketchat-otr/client/rocketchat.otr.room.js | 1 + packages/rocketchat-reactions/setReaction.js | 1 + packages/rocketchat-slackbridge/server/RocketAdapter.js | 1 + .../rocketchat-slackbridge/server/slackbridge_import.server.js | 1 + packages/rocketchat-slashcommands-archiveroom/server/server.js | 1 + packages/rocketchat-slashcommands-create/server/server.js | 1 + packages/rocketchat-slashcommands-help/server.js | 1 + packages/rocketchat-slashcommands-hide/server/hide.js | 1 + packages/rocketchat-slashcommands-invite/server/server.js | 1 + packages/rocketchat-slashcommands-inviteall/server/server.js | 1 + packages/rocketchat-slashcommands-join/server/server.js | 1 + packages/rocketchat-slashcommands-kick/server/server.js | 1 + packages/rocketchat-slashcommands-leave/leave.js | 1 + packages/rocketchat-slashcommands-msg/server.js | 1 + packages/rocketchat-slashcommands-mute/server/mute.js | 1 + packages/rocketchat-slashcommands-mute/server/unmute.js | 1 + .../rocketchat-slashcommands-unarchiveroom/server/server.js | 1 + packages/rocketchat-ui-admin/client/admin.js | 1 + packages/rocketchat-ui-flextab/client/tabs/userEdit.js | 1 + packages/rocketchat-ui-message/startup/messageBoxActions.js | 1 + packages/rocketchat-ui/client/lib/chatMessages.js | 1 + packages/rocketchat-ui/client/lib/notification.js | 1 + packages/rocketchat-ui/client/views/app/room.js | 1 + server/startup/migrations/v004.js | 2 ++ 77 files changed, 80 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index bf7579841c73..0c5a27599e49 100644 --- a/.eslintrc +++ b/.eslintrc @@ -40,7 +40,6 @@ "Package" : false, "parentCall" : false, "Promise" : false, - "Random" : false, "ReactiveDict" : false, "ReactiveVar" : false, "Reload" : false, diff --git a/packages/meteor-accounts-saml/saml_client.js b/packages/meteor-accounts-saml/saml_client.js index 9d167572008c..64b6572c6c4f 100644 --- a/packages/meteor-accounts-saml/saml_client.js +++ b/packages/meteor-accounts-saml/saml_client.js @@ -1,5 +1,7 @@ /* globals cordova */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; + if (!Accounts.saml) { Accounts.saml = {}; } diff --git a/packages/meteor-accounts-saml/saml_server.js b/packages/meteor-accounts-saml/saml_server.js index f759d1d06ec6..7ee9cc9c0164 100644 --- a/packages/meteor-accounts-saml/saml_server.js +++ b/packages/meteor-accounts-saml/saml_server.js @@ -1,6 +1,7 @@ /* globals RoutePolicy, SAML */ /* jshint newcap: false */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import { WebApp } from 'meteor/webapp'; import _ from 'underscore'; diff --git a/packages/rocketchat-2fa/server/lib/totp.js b/packages/rocketchat-2fa/server/lib/totp.js index f177b496130a..e6f7878b4afd 100644 --- a/packages/rocketchat-2fa/server/lib/totp.js +++ b/packages/rocketchat-2fa/server/lib/totp.js @@ -1,4 +1,5 @@ import { SHA256 } from 'meteor/sha'; +import { Random } from 'meteor/random'; import speakeasy from 'speakeasy'; RocketChat.TOTP = { diff --git a/packages/rocketchat-api/server/v1/commands.js b/packages/rocketchat-api/server/v1/commands.js index 28a18ab419bb..9be449734d39 100644 --- a/packages/rocketchat-api/server/v1/commands.js +++ b/packages/rocketchat-api/server/v1/commands.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; RocketChat.API.v1.addRoute('commands.get', { authRequired: true }, { get() { diff --git a/packages/rocketchat-api/server/v1/push.js b/packages/rocketchat-api/server/v1/push.js index a211c8df2d87..dfb6cae1d9dc 100644 --- a/packages/rocketchat-api/server/v1/push.js +++ b/packages/rocketchat-api/server/v1/push.js @@ -1,5 +1,6 @@ /* globals Push */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; RocketChat.API.v1.addRoute('push.token', { authRequired: true }, { post() { diff --git a/packages/rocketchat-apps/server/bridges/messages.js b/packages/rocketchat-apps/server/bridges/messages.js index debbff666499..de3b0a89d9ca 100644 --- a/packages/rocketchat-apps/server/bridges/messages.js +++ b/packages/rocketchat-apps/server/bridges/messages.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; export class AppMessageBridge { constructor(orch) { diff --git a/packages/rocketchat-apps/server/converters/messages.js b/packages/rocketchat-apps/server/converters/messages.js index 34188ed2cdea..3bee0eedb592 100644 --- a/packages/rocketchat-apps/server/converters/messages.js +++ b/packages/rocketchat-apps/server/converters/messages.js @@ -1,3 +1,5 @@ +import { Random } from 'meteor/random'; + export class AppMessagesConverter { constructor(orch) { this.orch = orch; diff --git a/packages/rocketchat-autotranslate/client/views/autoTranslateFlexTab.js b/packages/rocketchat-autotranslate/client/views/autoTranslateFlexTab.js index 0134944c13ee..c7a5722f0a87 100644 --- a/packages/rocketchat-autotranslate/client/views/autoTranslateFlexTab.js +++ b/packages/rocketchat-autotranslate/client/views/autoTranslateFlexTab.js @@ -1,5 +1,6 @@ /* globals ChatSubscription */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-cas/client/cas_client.js b/packages/rocketchat-cas/client/cas_client.js index 280e89380d8c..34654f918fcf 100644 --- a/packages/rocketchat-cas/client/cas_client.js +++ b/packages/rocketchat-cas/client/cas_client.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; const openCenteredPopup = function(url, width, height) { diff --git a/packages/rocketchat-cas/server/cas_server.js b/packages/rocketchat-cas/server/cas_server.js index 6f6cd5b59a41..7b72f5fb96f7 100644 --- a/packages/rocketchat-cas/server/cas_server.js +++ b/packages/rocketchat-cas/server/cas_server.js @@ -1,6 +1,7 @@ /* globals RoutePolicy, logger */ /* jshint newcap: false */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import { WebApp } from 'meteor/webapp'; import _ from 'underscore'; diff --git a/packages/rocketchat-custom-oauth/client/custom_oauth_client.js b/packages/rocketchat-custom-oauth/client/custom_oauth_client.js index 2338ae86e7d7..014937870876 100644 --- a/packages/rocketchat-custom-oauth/client/custom_oauth_client.js +++ b/packages/rocketchat-custom-oauth/client/custom_oauth_client.js @@ -1,5 +1,6 @@ /* globals OAuth*/ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import s from 'underscore.string'; // Request custom OAuth credentials for the user diff --git a/packages/rocketchat-file-upload/lib/FileUploadBase.js b/packages/rocketchat-file-upload/lib/FileUploadBase.js index b32747154e90..0327222401b6 100644 --- a/packages/rocketchat-file-upload/lib/FileUploadBase.js +++ b/packages/rocketchat-file-upload/lib/FileUploadBase.js @@ -1,6 +1,7 @@ /* globals FileUploadBase:true, UploadFS */ /* exported FileUploadBase */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import _ from 'underscore'; UploadFS.config.defaultStorePermissions = new UploadFS.StorePermissions({ diff --git a/packages/rocketchat-file-upload/server/config/Slingshot_DEPRECATED.js b/packages/rocketchat-file-upload/server/config/Slingshot_DEPRECATED.js index d802dc1a4aea..2a7539bb17c8 100644 --- a/packages/rocketchat-file-upload/server/config/Slingshot_DEPRECATED.js +++ b/packages/rocketchat-file-upload/server/config/Slingshot_DEPRECATED.js @@ -1,5 +1,6 @@ /* globals Slingshot, FileUpload */ import _ from 'underscore'; +import { Random } from 'meteor/random'; const configureSlingshot = _.debounce(() => { const type = RocketChat.settings.get('FileUpload_Storage_Type'); diff --git a/packages/rocketchat-file-upload/server/methods/sendFileMessage.js b/packages/rocketchat-file-upload/server/methods/sendFileMessage.js index a5da741d7afa..900a8ac214c1 100644 --- a/packages/rocketchat-file-upload/server/methods/sendFileMessage.js +++ b/packages/rocketchat-file-upload/server/methods/sendFileMessage.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import _ from 'underscore'; Meteor.methods({ diff --git a/packages/rocketchat-file-upload/ufs/AmazonS3/server.js b/packages/rocketchat-file-upload/ufs/AmazonS3/server.js index 5906323f4c5d..db850f5ab171 100644 --- a/packages/rocketchat-file-upload/ufs/AmazonS3/server.js +++ b/packages/rocketchat-file-upload/ufs/AmazonS3/server.js @@ -1,4 +1,5 @@ import { UploadFS } from 'meteor/jalik:ufs'; +import { Random } from 'meteor/random'; import _ from 'underscore'; import S3 from 'aws-sdk/clients/s3'; import stream from 'stream'; diff --git a/packages/rocketchat-file-upload/ufs/GoogleStorage/server.js b/packages/rocketchat-file-upload/ufs/GoogleStorage/server.js index 570c1b595d08..7fdb3e8ea397 100644 --- a/packages/rocketchat-file-upload/ufs/GoogleStorage/server.js +++ b/packages/rocketchat-file-upload/ufs/GoogleStorage/server.js @@ -1,4 +1,5 @@ import { UploadFS } from 'meteor/jalik:ufs'; +import { Random } from 'meteor/random'; import gcStorage from '@google-cloud/storage'; /** diff --git a/packages/rocketchat-file-upload/ufs/Webdav/server.js b/packages/rocketchat-file-upload/ufs/Webdav/server.js index 19c46700815a..ede964e158e6 100644 --- a/packages/rocketchat-file-upload/ufs/Webdav/server.js +++ b/packages/rocketchat-file-upload/ufs/Webdav/server.js @@ -1,4 +1,5 @@ import { UploadFS } from 'meteor/jalik:ufs'; +import { Random } from 'meteor/random'; import Webdav from 'webdav'; import stream from 'stream'; /** diff --git a/packages/rocketchat-google-vision/server/googlevision.js b/packages/rocketchat-google-vision/server/googlevision.js index ec05eac45737..d2609c89e97d 100644 --- a/packages/rocketchat-google-vision/server/googlevision.js +++ b/packages/rocketchat-google-vision/server/googlevision.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; class GoogleVision { constructor() { diff --git a/packages/rocketchat-importer-hipchat-enterprise/server/importer.js b/packages/rocketchat-importer-hipchat-enterprise/server/importer.js index 73c9f263d588..c50a3776fe49 100644 --- a/packages/rocketchat-importer-hipchat-enterprise/server/importer.js +++ b/packages/rocketchat-importer-hipchat-enterprise/server/importer.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import { Base, ProgressStep, diff --git a/packages/rocketchat-importer-slack-users/server/importer.js b/packages/rocketchat-importer-slack-users/server/importer.js index f6d0b7d5321f..eba030abc1de 100644 --- a/packages/rocketchat-importer-slack-users/server/importer.js +++ b/packages/rocketchat-importer-slack-users/server/importer.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import { Base, ProgressStep, diff --git a/packages/rocketchat-integrations/client/views/integrationsIncoming.js b/packages/rocketchat-integrations/client/views/integrationsIncoming.js index fbfb27c98dfe..54290ef3002a 100644 --- a/packages/rocketchat-integrations/client/views/integrationsIncoming.js +++ b/packages/rocketchat-integrations/client/views/integrationsIncoming.js @@ -1,6 +1,7 @@ /* global ChatIntegrations */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import hljs from 'highlight.js'; import toastr from 'toastr'; diff --git a/packages/rocketchat-integrations/client/views/integrationsOutgoing.js b/packages/rocketchat-integrations/client/views/integrationsOutgoing.js index dd3fe136cbbf..5b5036301120 100644 --- a/packages/rocketchat-integrations/client/views/integrationsOutgoing.js +++ b/packages/rocketchat-integrations/client/views/integrationsOutgoing.js @@ -1,6 +1,7 @@ /* global ChatIntegrations */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import hljs from 'highlight.js'; import toastr from 'toastr'; diff --git a/packages/rocketchat-integrations/server/api/api.js b/packages/rocketchat-integrations/server/api/api.js index 80c9448c2998..54ab0e9be8fd 100644 --- a/packages/rocketchat-integrations/server/api/api.js +++ b/packages/rocketchat-integrations/server/api/api.js @@ -2,6 +2,7 @@ // TODO: remove globals import { HTTP } from 'meteor/http'; +import { Random } from 'meteor/random'; import Fiber from 'fibers'; import Future from 'fibers/future'; import _ from 'underscore'; diff --git a/packages/rocketchat-integrations/server/lib/triggerHandler.js b/packages/rocketchat-integrations/server/lib/triggerHandler.js index eb441a390699..851abfc69639 100644 --- a/packages/rocketchat-integrations/server/lib/triggerHandler.js +++ b/packages/rocketchat-integrations/server/lib/triggerHandler.js @@ -1,5 +1,6 @@ /* global logger, processWebhookMessage */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import { HTTP } from 'meteor/http'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-integrations/server/methods/incoming/addIncomingIntegration.js b/packages/rocketchat-integrations/server/methods/incoming/addIncomingIntegration.js index 0fe8e9a63a01..f90f2d6790e7 100644 --- a/packages/rocketchat-integrations/server/methods/incoming/addIncomingIntegration.js +++ b/packages/rocketchat-integrations/server/methods/incoming/addIncomingIntegration.js @@ -1,5 +1,6 @@ /* global Babel */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import _ from 'underscore'; import s from 'underscore.string'; const validChannelChars = ['@', '#']; diff --git a/packages/rocketchat-katex/katex.js b/packages/rocketchat-katex/katex.js index 1a5c5033cd15..bd233d87caa8 100644 --- a/packages/rocketchat-katex/katex.js +++ b/packages/rocketchat-katex/katex.js @@ -3,6 +3,7 @@ * https://github.com/Khan/KaTeX */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-lib/lib/RoomTypeConfig.js b/packages/rocketchat-lib/lib/RoomTypeConfig.js index ec1794d688cf..1660bfaf12db 100644 --- a/packages/rocketchat-lib/lib/RoomTypeConfig.js +++ b/packages/rocketchat-lib/lib/RoomTypeConfig.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; export const RoomSettingsEnum = { NAME: 'roomName', diff --git a/packages/rocketchat-lib/lib/callbacks.js b/packages/rocketchat-lib/lib/callbacks.js index 73c800a022d0..f4c6c2c8a5e9 100644 --- a/packages/rocketchat-lib/lib/callbacks.js +++ b/packages/rocketchat-lib/lib/callbacks.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import _ from 'underscore'; /* diff --git a/packages/rocketchat-lib/lib/promises.js b/packages/rocketchat-lib/lib/promises.js index bf201d0e2029..a306ccceeef6 100644 --- a/packages/rocketchat-lib/lib/promises.js +++ b/packages/rocketchat-lib/lib/promises.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import _ from 'underscore'; /* diff --git a/packages/rocketchat-lib/server/methods/filterATAllTag.js b/packages/rocketchat-lib/server/methods/filterATAllTag.js index 906e68af624f..7a2f596a670b 100644 --- a/packages/rocketchat-lib/server/methods/filterATAllTag.js +++ b/packages/rocketchat-lib/server/methods/filterATAllTag.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import _ from 'underscore'; RocketChat.callbacks.add('beforeSaveMessage', function(message) { diff --git a/packages/rocketchat-lib/server/methods/filterATHereTag.js b/packages/rocketchat-lib/server/methods/filterATHereTag.js index a5765967de4e..9ca5680d4c55 100644 --- a/packages/rocketchat-lib/server/methods/filterATHereTag.js +++ b/packages/rocketchat-lib/server/methods/filterATHereTag.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import _ from 'underscore'; RocketChat.callbacks.add('beforeSaveMessage', function(message) { diff --git a/packages/rocketchat-lib/server/methods/sendMessage.js b/packages/rocketchat-lib/server/methods/sendMessage.js index bfec23de3dd4..5844d3d7697e 100644 --- a/packages/rocketchat-lib/server/methods/sendMessage.js +++ b/packages/rocketchat-lib/server/methods/sendMessage.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import moment from 'moment'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/startup/settings.js b/packages/rocketchat-lib/server/startup/settings.js index 749431adfd17..4902fd7e84b8 100644 --- a/packages/rocketchat-lib/server/startup/settings.js +++ b/packages/rocketchat-lib/server/startup/settings.js @@ -1,3 +1,4 @@ +import { Random } from 'meteor/random'; import './email'; // Insert server unique id if it doesn't exist diff --git a/packages/rocketchat-livechat/.app/client/lib/chatMessages.js b/packages/rocketchat-livechat/.app/client/lib/chatMessages.js index 98bdb93c1cbf..c4edf1ae596b 100644 --- a/packages/rocketchat-livechat/.app/client/lib/chatMessages.js +++ b/packages/rocketchat-livechat/.app/client/lib/chatMessages.js @@ -1,5 +1,6 @@ /* globals MsgTyping, showError, Livechat */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-livechat/.app/client/lib/hooks.js b/packages/rocketchat-livechat/.app/client/lib/hooks.js index 9bbf720933bb..862417b1c185 100644 --- a/packages/rocketchat-livechat/.app/client/lib/hooks.js +++ b/packages/rocketchat-livechat/.app/client/lib/hooks.js @@ -1,5 +1,6 @@ /* globals CustomFields, Livechat */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import visitor from '../../imports/client/visitor'; const api = { diff --git a/packages/rocketchat-livechat/.app/client/lib/triggers.js b/packages/rocketchat-livechat/.app/client/lib/triggers.js index a69720f3f39d..ceb0d9b928a0 100644 --- a/packages/rocketchat-livechat/.app/client/lib/triggers.js +++ b/packages/rocketchat-livechat/.app/client/lib/triggers.js @@ -1,5 +1,6 @@ /* globals Livechat */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import visitor from '../../imports/client/visitor'; const firedTriggers = JSON.parse(localStorage.getItem('rocketChatFiredTriggers')) || []; diff --git a/packages/rocketchat-livechat/.app/client/startup/visitor.js b/packages/rocketchat-livechat/.app/client/startup/visitor.js index 35748e0f0788..6bf40b2579e9 100644 --- a/packages/rocketchat-livechat/.app/client/startup/visitor.js +++ b/packages/rocketchat-livechat/.app/client/startup/visitor.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import visitor from '../../imports/client/visitor'; Meteor.startup(() => { diff --git a/packages/rocketchat-livechat/.app/imports/client/visitor.js b/packages/rocketchat-livechat/.app/imports/client/visitor.js index 8a51ab48d797..df151fb45bf0 100644 --- a/packages/rocketchat-livechat/.app/imports/client/visitor.js +++ b/packages/rocketchat-livechat/.app/imports/client/visitor.js @@ -1,5 +1,7 @@ /* globals Commands, Livechat, UserPresence */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; + const msgStream = new Meteor.Streamer('room-messages'); export default { diff --git a/packages/rocketchat-livechat/client/views/app/livechatAppearance.js b/packages/rocketchat-livechat/client/views/app/livechatAppearance.js index a23eb5f812ed..335fbfb18cc2 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatAppearance.js +++ b/packages/rocketchat-livechat/client/views/app/livechatAppearance.js @@ -1,6 +1,7 @@ /* globals jscolor*/ /* eslint new-cap: ["error", { "newIsCapExceptions": ["jscolor"] }]*/ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import s from 'underscore.string'; import moment from 'moment'; import toastr from 'toastr'; diff --git a/packages/rocketchat-livechat/imports/server/rest/facebook.js b/packages/rocketchat-livechat/imports/server/rest/facebook.js index 54a401fe7c4c..bfab014fff9c 100644 --- a/packages/rocketchat-livechat/imports/server/rest/facebook.js +++ b/packages/rocketchat-livechat/imports/server/rest/facebook.js @@ -1,4 +1,5 @@ import crypto from 'crypto'; +import { Random } from 'meteor/random'; import LivechatVisitors from '../../../server/models/LivechatVisitors'; diff --git a/packages/rocketchat-livechat/imports/server/rest/sms.js b/packages/rocketchat-livechat/imports/server/rest/sms.js index a8d90481e232..216696fff343 100644 --- a/packages/rocketchat-livechat/imports/server/rest/sms.js +++ b/packages/rocketchat-livechat/imports/server/rest/sms.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import LivechatVisitors from '../../../server/models/LivechatVisitors'; RocketChat.API.v1.addRoute('livechat/sms-incoming/:service', { diff --git a/packages/rocketchat-livechat/server/api/lib/livechat.js b/packages/rocketchat-livechat/server/api/lib/livechat.js index 16119f9451f6..43c2043615b1 100644 --- a/packages/rocketchat-livechat/server/api/lib/livechat.js +++ b/packages/rocketchat-livechat/server/api/lib/livechat.js @@ -1,3 +1,4 @@ +import { Random } from 'meteor/random'; import _ from 'underscore'; import LivechatVisitors from '../../models/LivechatVisitors'; diff --git a/packages/rocketchat-livechat/server/api/v1/message.js b/packages/rocketchat-livechat/server/api/v1/message.js index cf3936078bf2..47719369865a 100644 --- a/packages/rocketchat-livechat/server/api/v1/message.js +++ b/packages/rocketchat-livechat/server/api/v1/message.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import LivechatVisitors from '../../../server/models/LivechatVisitors'; import { findGuest, findRoom } from '../lib/livechat'; diff --git a/packages/rocketchat-livechat/server/api/v1/room.js b/packages/rocketchat-livechat/server/api/v1/room.js index 08d3b7c93bbb..4229100d3250 100644 --- a/packages/rocketchat-livechat/server/api/v1/room.js +++ b/packages/rocketchat-livechat/server/api/v1/room.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import { findGuest, findRoom, getRoom, settings } from '../lib/livechat'; RocketChat.API.v1.addRoute('livechat/room', { diff --git a/packages/rocketchat-livechat/server/api/v1/videoCall.js b/packages/rocketchat-livechat/server/api/v1/videoCall.js index 00e4d44e1976..249cf59407e1 100644 --- a/packages/rocketchat-livechat/server/api/v1/videoCall.js +++ b/packages/rocketchat-livechat/server/api/v1/videoCall.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import { findGuest, getRoom, settings } from '../lib/livechat'; RocketChat.API.v1.addRoute('livechat/video.call/:token', { diff --git a/packages/rocketchat-livechat/server/lib/Livechat.js b/packages/rocketchat-livechat/server/lib/Livechat.js index 359e06dbac2f..129d30f8d549 100644 --- a/packages/rocketchat-livechat/server/lib/Livechat.js +++ b/packages/rocketchat-livechat/server/lib/Livechat.js @@ -1,5 +1,6 @@ /* globals HTTP */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-livechat/server/methods/sendFileLivechatMessage.js b/packages/rocketchat-livechat/server/methods/sendFileLivechatMessage.js index 709dd92b4cf2..6aac9de7b337 100644 --- a/packages/rocketchat-livechat/server/methods/sendFileLivechatMessage.js +++ b/packages/rocketchat-livechat/server/methods/sendFileLivechatMessage.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/methods/startFileUploadRoom.js b/packages/rocketchat-livechat/server/methods/startFileUploadRoom.js index 3b41c65d17aa..495c51fb03ba 100644 --- a/packages/rocketchat-livechat/server/methods/startFileUploadRoom.js +++ b/packages/rocketchat-livechat/server/methods/startFileUploadRoom.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/methods/startVideoCall.js b/packages/rocketchat-livechat/server/methods/startVideoCall.js index 4904e255adad..e32033b6874b 100644 --- a/packages/rocketchat-livechat/server/methods/startVideoCall.js +++ b/packages/rocketchat-livechat/server/methods/startVideoCall.js @@ -1,5 +1,6 @@ /* eslint new-cap: [2, {"capIsNewExceptions": ["MD5"]}] */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; Meteor.methods({ 'livechat:startVideoCall'(roomId) { diff --git a/packages/rocketchat-logger/server/server.js b/packages/rocketchat-logger/server/server.js index 92a824400298..06a938dbec5a 100644 --- a/packages/rocketchat-logger/server/server.js +++ b/packages/rocketchat-logger/server/server.js @@ -1,5 +1,6 @@ /* globals EventEmitter LoggerManager SystemLogger Log*/ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import { EJSON } from 'meteor/ejson'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-mentions/server/server.js b/packages/rocketchat-mentions/server/server.js index 9184d47b4d75..1dba02354ad8 100644 --- a/packages/rocketchat-mentions/server/server.js +++ b/packages/rocketchat-mentions/server/server.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import _ from 'underscore'; import MentionsServer from './Mentions'; diff --git a/packages/rocketchat-oauth2-server-config/admin/server/methods/addOAuthApp.js b/packages/rocketchat-oauth2-server-config/admin/server/methods/addOAuthApp.js index 67a2d90a3e63..5d915849217b 100644 --- a/packages/rocketchat-oauth2-server-config/admin/server/methods/addOAuthApp.js +++ b/packages/rocketchat-oauth2-server-config/admin/server/methods/addOAuthApp.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import _ from 'underscore'; Meteor.methods({ diff --git a/packages/rocketchat-otr/client/rocketchat.otr.room.js b/packages/rocketchat-otr/client/rocketchat.otr.room.js index ca27a57ca187..8544f89f3b77 100644 --- a/packages/rocketchat-otr/client/rocketchat.otr.room.js +++ b/packages/rocketchat-otr/client/rocketchat.otr.room.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import { EJSON } from 'meteor/ejson'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-reactions/setReaction.js b/packages/rocketchat-reactions/setReaction.js index 9f915a082d39..5c0b0163ce57 100644 --- a/packages/rocketchat-reactions/setReaction.js +++ b/packages/rocketchat-reactions/setReaction.js @@ -1,5 +1,6 @@ /* globals msgStream */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import _ from 'underscore'; const removeUserReaction = (message, reaction, username) => { diff --git a/packages/rocketchat-slackbridge/server/RocketAdapter.js b/packages/rocketchat-slackbridge/server/RocketAdapter.js index 11d13f9bd384..c4c6bc4054b9 100644 --- a/packages/rocketchat-slackbridge/server/RocketAdapter.js +++ b/packages/rocketchat-slackbridge/server/RocketAdapter.js @@ -1,6 +1,7 @@ /* globals logger*/ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import { HTTP } from 'meteor/http'; import _ from 'underscore'; diff --git a/packages/rocketchat-slackbridge/server/slackbridge_import.server.js b/packages/rocketchat-slackbridge/server/slackbridge_import.server.js index 53b2d66cd6c5..2a33a0b8dfc8 100644 --- a/packages/rocketchat-slackbridge/server/slackbridge_import.server.js +++ b/packages/rocketchat-slackbridge/server/slackbridge_import.server.js @@ -1,5 +1,6 @@ /* globals msgStream */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; function SlackBridgeImport(command, params, item) { if (command !== 'slackbridge-import' || !Match.test(params, String)) { diff --git a/packages/rocketchat-slashcommands-archiveroom/server/server.js b/packages/rocketchat-slashcommands-archiveroom/server/server.js index eb1da38b51eb..93436a758a89 100644 --- a/packages/rocketchat-slashcommands-archiveroom/server/server.js +++ b/packages/rocketchat-slashcommands-archiveroom/server/server.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; function Archive(command, params, item) { if (command !== 'archive' || !Match.test(params, String)) { diff --git a/packages/rocketchat-slashcommands-create/server/server.js b/packages/rocketchat-slashcommands-create/server/server.js index 29cf5b092ca8..0d86c318dbf6 100644 --- a/packages/rocketchat-slashcommands-create/server/server.js +++ b/packages/rocketchat-slashcommands-create/server/server.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; function Create(command, params, item) { function getParams(str) { diff --git a/packages/rocketchat-slashcommands-help/server.js b/packages/rocketchat-slashcommands-help/server.js index d615e0031256..19f054bb7e6c 100644 --- a/packages/rocketchat-slashcommands-help/server.js +++ b/packages/rocketchat-slashcommands-help/server.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; /* * Help is a named function that will replace /join commands diff --git a/packages/rocketchat-slashcommands-hide/server/hide.js b/packages/rocketchat-slashcommands-hide/server/hide.js index 1bb27d335f77..30e575704951 100644 --- a/packages/rocketchat-slashcommands-hide/server/hide.js +++ b/packages/rocketchat-slashcommands-hide/server/hide.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; /* * Hide is a named function that will replace /hide commands diff --git a/packages/rocketchat-slashcommands-invite/server/server.js b/packages/rocketchat-slashcommands-invite/server/server.js index 3769ae5fa1fa..b1847b6f95d6 100644 --- a/packages/rocketchat-slashcommands-invite/server/server.js +++ b/packages/rocketchat-slashcommands-invite/server/server.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; /* * Invite is a named function that will replace /invite commands diff --git a/packages/rocketchat-slashcommands-inviteall/server/server.js b/packages/rocketchat-slashcommands-inviteall/server/server.js index eafe53dc86b1..794e6b31e902 100644 --- a/packages/rocketchat-slashcommands-inviteall/server/server.js +++ b/packages/rocketchat-slashcommands-inviteall/server/server.js @@ -3,6 +3,7 @@ * @param {Object} message - The message object */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; function inviteAll(type) { return function inviteAll(command, params, item) { diff --git a/packages/rocketchat-slashcommands-join/server/server.js b/packages/rocketchat-slashcommands-join/server/server.js index ba1a2f1a2238..d46e571b6817 100644 --- a/packages/rocketchat-slashcommands-join/server/server.js +++ b/packages/rocketchat-slashcommands-join/server/server.js @@ -4,6 +4,7 @@ * @param {Object} message - The message object */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; RocketChat.slashCommands.add('join', function Join(command, params, item) { diff --git a/packages/rocketchat-slashcommands-kick/server/server.js b/packages/rocketchat-slashcommands-kick/server/server.js index 47c632778e0a..0699d4366c1c 100644 --- a/packages/rocketchat-slashcommands-kick/server/server.js +++ b/packages/rocketchat-slashcommands-kick/server/server.js @@ -1,6 +1,7 @@ // Kick is a named function that will replace /kick commands import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; const Kick = function(command, params, { rid }) { if (command !== 'kick' || !Match.test(params, String)) { diff --git a/packages/rocketchat-slashcommands-leave/leave.js b/packages/rocketchat-slashcommands-leave/leave.js index 9334fff969c4..d337c746576d 100644 --- a/packages/rocketchat-slashcommands-leave/leave.js +++ b/packages/rocketchat-slashcommands-leave/leave.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; /* * Leave is a named function that will replace /leave commands diff --git a/packages/rocketchat-slashcommands-msg/server.js b/packages/rocketchat-slashcommands-msg/server.js index 55693a1d69ff..faa6950d1a2f 100644 --- a/packages/rocketchat-slashcommands-msg/server.js +++ b/packages/rocketchat-slashcommands-msg/server.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; /* * Msg is a named function that will replace /msg commands diff --git a/packages/rocketchat-slashcommands-mute/server/mute.js b/packages/rocketchat-slashcommands-mute/server/mute.js index dde77211d543..4f51032ab878 100644 --- a/packages/rocketchat-slashcommands-mute/server/mute.js +++ b/packages/rocketchat-slashcommands-mute/server/mute.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; /* * Mute is a named function that will replace /mute commands diff --git a/packages/rocketchat-slashcommands-mute/server/unmute.js b/packages/rocketchat-slashcommands-mute/server/unmute.js index 150eacd10592..568d7e00ba1c 100644 --- a/packages/rocketchat-slashcommands-mute/server/unmute.js +++ b/packages/rocketchat-slashcommands-mute/server/unmute.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; /* * Unmute is a named function that will replace /unmute commands diff --git a/packages/rocketchat-slashcommands-unarchiveroom/server/server.js b/packages/rocketchat-slashcommands-unarchiveroom/server/server.js index c1847f1ec0b7..54e7a033dfab 100644 --- a/packages/rocketchat-slashcommands-unarchiveroom/server/server.js +++ b/packages/rocketchat-slashcommands-unarchiveroom/server/server.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; function Unarchive(command, params, item) { if (command !== 'unarchive' || !Match.test(params, String)) { diff --git a/packages/rocketchat-ui-admin/client/admin.js b/packages/rocketchat-ui-admin/client/admin.js index a190ace994ae..b42799af3708 100644 --- a/packages/rocketchat-ui-admin/client/admin.js +++ b/packages/rocketchat-ui-admin/client/admin.js @@ -1,5 +1,6 @@ /* globals jscolor, i18nDefaultQuery */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-flextab/client/tabs/userEdit.js b/packages/rocketchat-ui-flextab/client/tabs/userEdit.js index a2d08f6f92d7..0f67aea2b454 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/userEdit.js +++ b/packages/rocketchat-ui-flextab/client/tabs/userEdit.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import toastr from 'toastr'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-message/startup/messageBoxActions.js b/packages/rocketchat-ui-message/startup/messageBoxActions.js index dc2daaff3b71..2c2d860f8f39 100644 --- a/packages/rocketchat-ui-message/startup/messageBoxActions.js +++ b/packages/rocketchat-ui-message/startup/messageBoxActions.js @@ -1,6 +1,7 @@ /* globals fileUpload device modal */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import mime from 'mime-type/with-db'; import { VRecDialog } from 'meteor/rocketchat:ui-vrecord'; diff --git a/packages/rocketchat-ui/client/lib/chatMessages.js b/packages/rocketchat-ui/client/lib/chatMessages.js index f248fce1f44e..4209142ca58b 100644 --- a/packages/rocketchat-ui/client/lib/chatMessages.js +++ b/packages/rocketchat-ui/client/lib/chatMessages.js @@ -1,5 +1,6 @@ /* globals MsgTyping */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-ui/client/lib/notification.js b/packages/rocketchat-ui/client/lib/notification.js index 58b64ed16ba7..70d4350a6add 100644 --- a/packages/rocketchat-ui/client/lib/notification.js +++ b/packages/rocketchat-ui/client/lib/notification.js @@ -1,5 +1,6 @@ // @TODO implementar 'clicar na notificacao' abre a janela do chat import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import _ from 'underscore'; import s from 'underscore.string'; import { e2e } from 'meteor/rocketchat:e2e'; diff --git a/packages/rocketchat-ui/client/views/app/room.js b/packages/rocketchat-ui/client/views/app/room.js index ce1aef410f9a..ae04f7f4ee89 100644 --- a/packages/rocketchat-ui/client/views/app/room.js +++ b/packages/rocketchat-ui/client/views/app/room.js @@ -1,5 +1,6 @@ /* globals chatMessages, fileUpload , fireGlobalEvent , cordova , readMessage , RoomRoles, popover , device */ import { Meteor } from 'meteor/meteor'; +import { Random } from 'meteor/random'; import { RocketChatTabBar } from 'meteor/rocketchat:lib'; import _ from 'underscore'; diff --git a/server/startup/migrations/v004.js b/server/startup/migrations/v004.js index 63cb0c7182a8..40c00ac52fbc 100644 --- a/server/startup/migrations/v004.js +++ b/server/startup/migrations/v004.js @@ -1,3 +1,5 @@ +import { Random } from 'meteor/random'; + RocketChat.Migrations.add({ version: 4, up() { From 501fec51ca1560aaaa2b5cecb7df164de4e129d2 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Fri, 19 Oct 2018 14:36:19 -0300 Subject: [PATCH 11/34] Remove global variable ReactiveDict --- .eslintrc | 1 - packages/rocketchat-setup-wizard/client/setupWizard.js | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index 0c5a27599e49..f15d371f3731 100644 --- a/.eslintrc +++ b/.eslintrc @@ -40,7 +40,6 @@ "Package" : false, "parentCall" : false, "Promise" : false, - "ReactiveDict" : false, "ReactiveVar" : false, "Reload" : false, "RocketChat" : true, diff --git a/packages/rocketchat-setup-wizard/client/setupWizard.js b/packages/rocketchat-setup-wizard/client/setupWizard.js index 5f125d927bfe..31095f2b18cb 100644 --- a/packages/rocketchat-setup-wizard/client/setupWizard.js +++ b/packages/rocketchat-setup-wizard/client/setupWizard.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveDict } from 'meteor/reactive-dict'; const cannotSetup = () => { const showSetupWizard = RocketChat.settings.get('Show_Setup_Wizard'); From 963b5af367f5be36d0a819f266d36b73e2e8f91a Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Fri, 19 Oct 2018 14:47:51 -0300 Subject: [PATCH 12/34] Remove global variable ReactiveVar --- .eslintrc | 1 - client/startup/i18n.js | 1 + packages/chatpal-search/client/template/admin.js | 1 + packages/chatpal-search/client/template/result.js | 1 + packages/rocketchat-2fa/client/accountSecurity.js | 1 + packages/rocketchat-apps/client/admin/appInstall.js | 1 + packages/rocketchat-apps/client/admin/appLogs.js | 1 + packages/rocketchat-apps/client/admin/appManage.js | 1 + packages/rocketchat-apps/client/admin/appWhatIsIt.js | 1 + packages/rocketchat-apps/client/admin/apps.js | 1 + packages/rocketchat-authorization/client/views/permissions.js | 1 + .../rocketchat-authorization/client/views/permissionsRole.js | 1 + .../client/views/autoTranslateFlexTab.js | 1 + .../client/views/mailMessagesInstructions.js | 1 + .../rocketchat-channel-settings/client/lib/ChannelSettings.js | 2 ++ .../client/views/channelSettings.js | 1 + packages/rocketchat-custom-sounds/client/admin/adminSounds.js | 1 + packages/rocketchat-custom-sounds/client/admin/soundInfo.js | 1 + packages/rocketchat-custom-sounds/client/lib/CustomSounds.js | 1 + packages/rocketchat-emoji-custom/admin/adminEmoji.js | 2 +- packages/rocketchat-emoji-custom/admin/emojiInfo.js | 1 + packages/rocketchat-emoji/client/emojiPicker.js | 2 ++ .../rocketchat-importer/client/admin/adminImportPrepare.js | 1 + .../rocketchat-importer/client/admin/adminImportProgress.js | 1 + .../client/views/integrationsIncoming.js | 1 + .../client/views/integrationsOutgoing.js | 1 + .../client/views/integrationsOutgoingHistory.js | 1 + packages/rocketchat-lazy-load/client/lazyloadImage.js | 1 + packages/rocketchat-lib/client/AdminBox.js | 1 + packages/rocketchat-lib/client/MessageAction.js | 1 + packages/rocketchat-lib/client/lib/RocketChatAnnouncement.js | 1 + packages/rocketchat-lib/client/lib/RocketChatTabBar.js | 2 ++ packages/rocketchat-lib/client/lib/TabBar.js | 1 + packages/rocketchat-lib/client/lib/cachedCollection.js | 1 + packages/rocketchat-lib/client/views/customFieldsForm.js | 2 ++ .../rocketchat-livechat/.app/client/lib/LivechatVideoCall.js | 1 + packages/rocketchat-livechat/.app/client/lib/_livechat.js | 1 + .../.app/client/lib/fromApp/RoomHistoryManager.js | 1 + packages/rocketchat-livechat/.app/client/lib/msgTyping.js | 1 + packages/rocketchat-livechat/.app/client/views/messages.js | 1 + packages/rocketchat-livechat/.app/client/views/offlineForm.js | 1 + packages/rocketchat-livechat/.app/client/views/register.js | 1 + .../rocketchat-livechat/.app/client/views/switchDepartment.js | 1 + packages/rocketchat-livechat/.app/client/views/videoCall.js | 1 + packages/rocketchat-livechat/.app/imports/client/visitor.js | 1 + .../client/views/app/analytics/livechatAnalytics.js | 1 + .../client/views/app/analytics/livechatRealTimeMonitoring.js | 1 + .../views/app/integrations/livechatIntegrationFacebook.js | 1 + .../views/app/integrations/livechatIntegrationWebhook.js | 1 + .../rocketchat-livechat/client/views/app/livechatAppearance.js | 1 + .../client/views/app/livechatCurrentChats.js | 1 + .../client/views/app/livechatCustomFieldForm.js | 1 + .../client/views/app/livechatDepartmentForm.js | 1 + .../client/views/app/livechatOfficeHours.js | 1 + packages/rocketchat-livechat/client/views/app/livechatQueue.js | 1 + .../rocketchat-livechat/client/views/app/tabbar/visitorEdit.js | 3 ++- .../client/views/app/tabbar/visitorForward.js | 2 ++ .../client/views/app/tabbar/visitorHistory.js | 1 + .../rocketchat-livechat/client/views/app/tabbar/visitorInfo.js | 1 + .../client/views/app/triggers/livechatTriggerAction.js | 2 ++ packages/rocketchat-livechat/client/views/sideNav/livechat.js | 1 + packages/rocketchat-livestream/client/views/broadcastView.js | 1 + packages/rocketchat-livestream/client/views/liveStreamTab.js | 1 + packages/rocketchat-livestream/client/views/liveStreamView.js | 1 + .../client/views/mentionsFlexTab.js | 1 + packages/rocketchat-message-pin/client/views/pinnedMessages.js | 1 + .../client/tabBar/views/snippetedMessages.js | 1 + .../rocketchat-message-star/client/views/starredMessages.js | 1 + .../admin/client/views/oauthApp.js | 1 + packages/rocketchat-otr/client/rocketchat.otr.js | 1 + packages/rocketchat-otr/client/rocketchat.otr.room.js | 1 + .../client/views/pushNotificationsFlexTab.js | 1 + packages/rocketchat-search/client/provider/result.js | 1 + packages/rocketchat-setup-wizard/client/setupWizard.js | 1 + packages/rocketchat-tokenpass/client/tokenChannelsList.js | 1 + .../rocketchat-tokenpass/client/tokenpassChannelSettings.js | 1 + packages/rocketchat-ui-account/client/accountPreferences.js | 1 + packages/rocketchat-ui-account/client/accountProfile.js | 1 + packages/rocketchat-ui-account/client/avatar/prompt.js | 1 + packages/rocketchat-ui-admin/client/admin.js | 1 + packages/rocketchat-ui-admin/client/adminFlex.js | 1 + packages/rocketchat-ui-admin/client/adminInfo.js | 1 + packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js | 1 + packages/rocketchat-ui-admin/client/rooms/adminRooms.js | 1 + .../rocketchat-ui-admin/client/rooms/channelSettingsDefault.js | 1 + packages/rocketchat-ui-admin/client/users/adminInviteUser.js | 1 + packages/rocketchat-ui-admin/client/users/adminUsers.js | 1 + .../rocketchat-ui-clean-history/client/views/cleanHistory.js | 1 + packages/rocketchat-ui-flextab/client/flexTabBar.js | 1 + packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js | 1 + packages/rocketchat-ui-flextab/client/tabs/membersList.js | 1 + .../rocketchat-ui-flextab/client/tabs/uploadedFilesList.js | 1 + packages/rocketchat-ui-flextab/client/tabs/userEdit.js | 1 + packages/rocketchat-ui-flextab/client/tabs/userInfo.js | 1 + packages/rocketchat-ui-login/client/login/footer.js | 2 ++ packages/rocketchat-ui-login/client/login/form.js | 1 + packages/rocketchat-ui-login/client/username/username.js | 1 + packages/rocketchat-ui-master/client/main.js | 1 + packages/rocketchat-ui-message/client/messageBox.js | 1 + packages/rocketchat-ui-message/client/popup/messagePopup.js | 1 + .../client/popup/messagePopupSlashCommandPreview.js | 1 + packages/rocketchat-ui-sidenav/client/createCombinedFlex.js | 1 + packages/rocketchat-ui-sidenav/client/listChannelsFlex.js | 1 + packages/rocketchat-ui-sidenav/client/listCombinedFlex.js | 1 + packages/rocketchat-ui-sidenav/client/listPrivateGroupsFlex.js | 1 + packages/rocketchat-ui-sidenav/client/sideNav.js | 1 + packages/rocketchat-ui-sidenav/client/sidebarItem.js | 1 + packages/rocketchat-ui-sidenav/client/toolbar.js | 1 + packages/rocketchat-ui/client/components/selectDropdown.js | 2 ++ packages/rocketchat-ui/client/components/tabs.js | 2 ++ packages/rocketchat-ui/client/lib/RoomHistoryManager.js | 1 + packages/rocketchat-ui/client/lib/RoomManager.js | 1 + packages/rocketchat-ui/client/lib/accountBox.js | 1 + packages/rocketchat-ui/client/lib/chatMessages.js | 1 + packages/rocketchat-ui/client/lib/msgTyping.js | 1 + packages/rocketchat-ui/client/lib/notification.js | 1 + packages/rocketchat-ui/client/lib/recorderjs/videoRecorder.js | 2 ++ packages/rocketchat-ui/client/views/app/createChannel.js | 1 + packages/rocketchat-ui/client/views/app/directory.js | 1 + packages/rocketchat-ui/client/views/app/popout.js | 1 + packages/rocketchat-ui/client/views/app/room.js | 1 + packages/rocketchat-ui/client/views/app/secretURL.js | 1 + packages/rocketchat-ui/client/views/app/videoCall/videoCall.js | 1 + packages/rocketchat-ui/client/views/cmsPage.js | 1 + packages/rocketchat-webdav/client/addWebdavAccount.js | 1 + packages/rocketchat-webrtc/client/WebRTCClass.js | 2 ++ 126 files changed, 137 insertions(+), 3 deletions(-) diff --git a/.eslintrc b/.eslintrc index f15d371f3731..f5360273ec2d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -40,7 +40,6 @@ "Package" : false, "parentCall" : false, "Promise" : false, - "ReactiveVar" : false, "Reload" : false, "RocketChat" : true, "RocketChatFile" : false, diff --git a/client/startup/i18n.js b/client/startup/i18n.js index a6e78a273f43..3819f82c0edd 100644 --- a/client/startup/i18n.js +++ b/client/startup/i18n.js @@ -1,6 +1,7 @@ /* globals isRtl */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import moment from 'moment'; const currentLanguage = new ReactiveVar(); diff --git a/packages/chatpal-search/client/template/admin.js b/packages/chatpal-search/client/template/admin.js index adf4589e705e..6882d2bb5a3a 100644 --- a/packages/chatpal-search/client/template/admin.js +++ b/packages/chatpal-search/client/template/admin.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import toastr from 'toastr'; Template.ChatpalAdmin.onCreated(function() { diff --git a/packages/chatpal-search/client/template/result.js b/packages/chatpal-search/client/template/result.js index b188e21b8a94..7041ea9879d8 100644 --- a/packages/chatpal-search/client/template/result.js +++ b/packages/chatpal-search/client/template/result.js @@ -1,4 +1,5 @@ import { DateFormat } from 'meteor/rocketchat:lib'; +import { ReactiveVar } from 'meteor/reactive-var'; Template.ChatpalSearchResultTemplate.onCreated(function() { this.badRequest = new ReactiveVar(false); diff --git a/packages/rocketchat-2fa/client/accountSecurity.js b/packages/rocketchat-2fa/client/accountSecurity.js index e2d00c3c061e..dc61eebbface 100644 --- a/packages/rocketchat-2fa/client/accountSecurity.js +++ b/packages/rocketchat-2fa/client/accountSecurity.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import toastr from 'toastr'; import qrcode from 'yaqrcode'; diff --git a/packages/rocketchat-apps/client/admin/appInstall.js b/packages/rocketchat-apps/client/admin/appInstall.js index 498410a3de3c..c89259fd9fe6 100644 --- a/packages/rocketchat-apps/client/admin/appInstall.js +++ b/packages/rocketchat-apps/client/admin/appInstall.js @@ -7,6 +7,7 @@ // if you're developing it and using a rest api with a particular parameter passed // then it will be enabled by default for development reasons. The server prefers a url // over the passed in body, so if both are found it will only use the url. +import { ReactiveVar } from 'meteor/reactive-var'; Template.appInstall.helpers({ appFile() { diff --git a/packages/rocketchat-apps/client/admin/appLogs.js b/packages/rocketchat-apps/client/admin/appLogs.js index 611edd82d013..d798d1349807 100644 --- a/packages/rocketchat-apps/client/admin/appLogs.js +++ b/packages/rocketchat-apps/client/admin/appLogs.js @@ -1,3 +1,4 @@ +import { ReactiveVar } from 'meteor/reactive-var'; import moment from 'moment'; import hljs from 'highlight.js'; diff --git a/packages/rocketchat-apps/client/admin/appManage.js b/packages/rocketchat-apps/client/admin/appManage.js index 4c2f127ab776..19078f9fb96c 100644 --- a/packages/rocketchat-apps/client/admin/appManage.js +++ b/packages/rocketchat-apps/client/admin/appManage.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-apps/client/admin/appWhatIsIt.js b/packages/rocketchat-apps/client/admin/appWhatIsIt.js index ce77b1c67248..c527d7416014 100644 --- a/packages/rocketchat-apps/client/admin/appWhatIsIt.js +++ b/packages/rocketchat-apps/client/admin/appWhatIsIt.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; Template.appWhatIsIt.onCreated(function() { this.isLoading = new ReactiveVar(false); diff --git a/packages/rocketchat-apps/client/admin/apps.js b/packages/rocketchat-apps/client/admin/apps.js index 5def7c5e4bdd..8e7166653300 100644 --- a/packages/rocketchat-apps/client/admin/apps.js +++ b/packages/rocketchat-apps/client/admin/apps.js @@ -1,4 +1,5 @@ import toastr from 'toastr'; +import { ReactiveVar } from 'meteor/reactive-var'; import { AppEvents } from '../communication'; const ENABLED_STATUS = ['auto_enabled', 'manually_enabled']; diff --git a/packages/rocketchat-authorization/client/views/permissions.js b/packages/rocketchat-authorization/client/views/permissions.js index 85fe41ffc5e8..b77c8daab9be 100644 --- a/packages/rocketchat-authorization/client/views/permissions.js +++ b/packages/rocketchat-authorization/client/views/permissions.js @@ -1,5 +1,6 @@ /* globals ChatPermissions */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; Template.permissions.helpers({ role() { diff --git a/packages/rocketchat-authorization/client/views/permissionsRole.js b/packages/rocketchat-authorization/client/views/permissionsRole.js index 1bf1bb252f19..d7bb54a6609b 100644 --- a/packages/rocketchat-authorization/client/views/permissionsRole.js +++ b/packages/rocketchat-authorization/client/views/permissionsRole.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import toastr from 'toastr'; Template.permissionsRole.helpers({ diff --git a/packages/rocketchat-autotranslate/client/views/autoTranslateFlexTab.js b/packages/rocketchat-autotranslate/client/views/autoTranslateFlexTab.js index c7a5722f0a87..c3a67f9378af 100644 --- a/packages/rocketchat-autotranslate/client/views/autoTranslateFlexTab.js +++ b/packages/rocketchat-autotranslate/client/views/autoTranslateFlexTab.js @@ -1,5 +1,6 @@ /* globals ChatSubscription */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js b/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js index 18c5e5d45b6b..41363fa2bc3b 100644 --- a/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js +++ b/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js @@ -1,5 +1,6 @@ /* global AutoComplete Deps */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import toastr from 'toastr'; import resetSelection from '../resetSelection'; diff --git a/packages/rocketchat-channel-settings/client/lib/ChannelSettings.js b/packages/rocketchat-channel-settings/client/lib/ChannelSettings.js index 92ff8d7d0ef7..d5ec4375bef8 100644 --- a/packages/rocketchat-channel-settings/client/lib/ChannelSettings.js +++ b/packages/rocketchat-channel-settings/client/lib/ChannelSettings.js @@ -1,4 +1,6 @@ +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; + RocketChat.ChannelSettings = new class { constructor() { this.options = new ReactiveVar({}); diff --git a/packages/rocketchat-channel-settings/client/views/channelSettings.js b/packages/rocketchat-channel-settings/client/views/channelSettings.js index 2ad8e92be0c5..3fd090f6261f 100644 --- a/packages/rocketchat-channel-settings/client/views/channelSettings.js +++ b/packages/rocketchat-channel-settings/client/views/channelSettings.js @@ -1,5 +1,6 @@ /* globals popover */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import toastr from 'toastr'; import moment from 'moment'; import s from 'underscore.string'; diff --git a/packages/rocketchat-custom-sounds/client/admin/adminSounds.js b/packages/rocketchat-custom-sounds/client/admin/adminSounds.js index a1f8ecf28c0a..61f3ba8c463a 100644 --- a/packages/rocketchat-custom-sounds/client/admin/adminSounds.js +++ b/packages/rocketchat-custom-sounds/client/admin/adminSounds.js @@ -1,4 +1,5 @@ import s from 'underscore.string'; +import { ReactiveVar } from 'meteor/reactive-var'; import { RocketChatTabBar } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-custom-sounds/client/admin/soundInfo.js b/packages/rocketchat-custom-sounds/client/admin/soundInfo.js index 30dbf18f4588..b4c05674aec3 100644 --- a/packages/rocketchat-custom-sounds/client/admin/soundInfo.js +++ b/packages/rocketchat-custom-sounds/client/admin/soundInfo.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; Template.soundInfo.helpers({ name() { diff --git a/packages/rocketchat-custom-sounds/client/lib/CustomSounds.js b/packages/rocketchat-custom-sounds/client/lib/CustomSounds.js index eb2ba40fe74d..5f3775b10256 100644 --- a/packages/rocketchat-custom-sounds/client/lib/CustomSounds.js +++ b/packages/rocketchat-custom-sounds/client/lib/CustomSounds.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; class CustomSounds { diff --git a/packages/rocketchat-emoji-custom/admin/adminEmoji.js b/packages/rocketchat-emoji-custom/admin/adminEmoji.js index aee72d545616..7071f93e5761 100644 --- a/packages/rocketchat-emoji-custom/admin/adminEmoji.js +++ b/packages/rocketchat-emoji-custom/admin/adminEmoji.js @@ -1,5 +1,5 @@ import s from 'underscore.string'; - +import { ReactiveVar } from 'meteor/reactive-var'; import { RocketChatTabBar } from 'meteor/rocketchat:lib'; Template.adminEmoji.helpers({ diff --git a/packages/rocketchat-emoji-custom/admin/emojiInfo.js b/packages/rocketchat-emoji-custom/admin/emojiInfo.js index 0e19c436fea6..719645032b28 100644 --- a/packages/rocketchat-emoji-custom/admin/emojiInfo.js +++ b/packages/rocketchat-emoji-custom/admin/emojiInfo.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; Template.emojiInfo.helpers({ name() { diff --git a/packages/rocketchat-emoji/client/emojiPicker.js b/packages/rocketchat-emoji/client/emojiPicker.js index 31094181ae52..e8e180e8b9a0 100644 --- a/packages/rocketchat-emoji/client/emojiPicker.js +++ b/packages/rocketchat-emoji/client/emojiPicker.js @@ -1,4 +1,6 @@ /* globals Template, isSetNotNull */ +import { ReactiveVar } from 'meteor/reactive-var'; + const emojiCategories = {}; /** * Turns category hash to a nice readable translated name diff --git a/packages/rocketchat-importer/client/admin/adminImportPrepare.js b/packages/rocketchat-importer/client/admin/adminImportPrepare.js index aa93a2cb2687..74021bebe502 100644 --- a/packages/rocketchat-importer/client/admin/adminImportPrepare.js +++ b/packages/rocketchat-importer/client/admin/adminImportPrepare.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import { Importers } from 'meteor/rocketchat:importer'; import toastr from 'toastr'; diff --git a/packages/rocketchat-importer/client/admin/adminImportProgress.js b/packages/rocketchat-importer/client/admin/adminImportProgress.js index e30a6a4aa667..aa9368442055 100644 --- a/packages/rocketchat-importer/client/admin/adminImportProgress.js +++ b/packages/rocketchat-importer/client/admin/adminImportProgress.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import { Importers, ImporterWebsocketReceiver, ProgressStep } from 'meteor/rocketchat:importer'; import toastr from 'toastr'; diff --git a/packages/rocketchat-integrations/client/views/integrationsIncoming.js b/packages/rocketchat-integrations/client/views/integrationsIncoming.js index 54290ef3002a..7270b88b29d3 100644 --- a/packages/rocketchat-integrations/client/views/integrationsIncoming.js +++ b/packages/rocketchat-integrations/client/views/integrationsIncoming.js @@ -1,6 +1,7 @@ /* global ChatIntegrations */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import hljs from 'highlight.js'; import toastr from 'toastr'; diff --git a/packages/rocketchat-integrations/client/views/integrationsOutgoing.js b/packages/rocketchat-integrations/client/views/integrationsOutgoing.js index 5b5036301120..2adf5c15d3e4 100644 --- a/packages/rocketchat-integrations/client/views/integrationsOutgoing.js +++ b/packages/rocketchat-integrations/client/views/integrationsOutgoing.js @@ -1,6 +1,7 @@ /* global ChatIntegrations */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import hljs from 'highlight.js'; import toastr from 'toastr'; diff --git a/packages/rocketchat-integrations/client/views/integrationsOutgoingHistory.js b/packages/rocketchat-integrations/client/views/integrationsOutgoingHistory.js index 722e7aa94bcf..c69aeecc3605 100644 --- a/packages/rocketchat-integrations/client/views/integrationsOutgoingHistory.js +++ b/packages/rocketchat-integrations/client/views/integrationsOutgoingHistory.js @@ -1,6 +1,7 @@ /* global ChatIntegrations, ChatIntegrationHistory */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import hljs from 'highlight.js'; import moment from 'moment'; diff --git a/packages/rocketchat-lazy-load/client/lazyloadImage.js b/packages/rocketchat-lazy-load/client/lazyloadImage.js index c48015dce546..cf8b79664dc8 100644 --- a/packages/rocketchat-lazy-load/client/lazyloadImage.js +++ b/packages/rocketchat-lazy-load/client/lazyloadImage.js @@ -1,3 +1,4 @@ +import { ReactiveVar } from 'meteor/reactive-var'; import './lazyloadImage.html'; import { addImage, fixCordova } from './'; diff --git a/packages/rocketchat-lib/client/AdminBox.js b/packages/rocketchat-lib/client/AdminBox.js index 10492de6a265..15253eb648b6 100644 --- a/packages/rocketchat-lib/client/AdminBox.js +++ b/packages/rocketchat-lib/client/AdminBox.js @@ -1,3 +1,4 @@ +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; RocketChat.AdminBox = new class { diff --git a/packages/rocketchat-lib/client/MessageAction.js b/packages/rocketchat-lib/client/MessageAction.js index cdf9bedb7a16..7e891f19d5ed 100644 --- a/packages/rocketchat-lib/client/MessageAction.js +++ b/packages/rocketchat-lib/client/MessageAction.js @@ -1,6 +1,7 @@ /* globals chatMessages cordova */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import moment from 'moment'; import toastr from 'toastr'; diff --git a/packages/rocketchat-lib/client/lib/RocketChatAnnouncement.js b/packages/rocketchat-lib/client/lib/RocketChatAnnouncement.js index a220b388906c..4fd6d432abce 100644 --- a/packages/rocketchat-lib/client/lib/RocketChatAnnouncement.js +++ b/packages/rocketchat-lib/client/lib/RocketChatAnnouncement.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; export class RocketChatAnnouncement { constructor(args = {}) { diff --git a/packages/rocketchat-lib/client/lib/RocketChatTabBar.js b/packages/rocketchat-lib/client/lib/RocketChatTabBar.js index 49c36326c801..c891c13278cd 100644 --- a/packages/rocketchat-lib/client/lib/RocketChatTabBar.js +++ b/packages/rocketchat-lib/client/lib/RocketChatTabBar.js @@ -1,3 +1,5 @@ +import { ReactiveVar } from 'meteor/reactive-var'; + export class RocketChatTabBar { constructor() { this.template = new ReactiveVar(); diff --git a/packages/rocketchat-lib/client/lib/TabBar.js b/packages/rocketchat-lib/client/lib/TabBar.js index 5c03f09ee33e..8e7db8dff6e9 100644 --- a/packages/rocketchat-lib/client/lib/TabBar.js +++ b/packages/rocketchat-lib/client/lib/TabBar.js @@ -1,4 +1,5 @@ import _ from 'underscore'; +import { ReactiveVar } from 'meteor/reactive-var'; RocketChat.TabBar = new (class TabBar { get size() { diff --git a/packages/rocketchat-lib/client/lib/cachedCollection.js b/packages/rocketchat-lib/client/lib/cachedCollection.js index e91c0dccb3be..1b38f7a01591 100644 --- a/packages/rocketchat-lib/client/lib/cachedCollection.js +++ b/packages/rocketchat-lib/client/lib/cachedCollection.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import localforage from 'localforage'; import _ from 'underscore'; diff --git a/packages/rocketchat-lib/client/views/customFieldsForm.js b/packages/rocketchat-lib/client/views/customFieldsForm.js index 469fcb933ff5..f631f6400bdc 100644 --- a/packages/rocketchat-lib/client/views/customFieldsForm.js +++ b/packages/rocketchat-lib/client/views/customFieldsForm.js @@ -1,3 +1,5 @@ +import { ReactiveVar } from 'meteor/reactive-var'; + Template.customFieldsForm.helpers({ new() { return this.new; diff --git a/packages/rocketchat-livechat/.app/client/lib/LivechatVideoCall.js b/packages/rocketchat-livechat/.app/client/lib/LivechatVideoCall.js index feb456ed82f8..0cb30fd43a9f 100644 --- a/packages/rocketchat-livechat/.app/client/lib/LivechatVideoCall.js +++ b/packages/rocketchat-livechat/.app/client/lib/LivechatVideoCall.js @@ -1,5 +1,6 @@ /* globals LivechatVideoCall, cordova, JitsiMeetExternalAPI */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import visitor from '../../imports/client/visitor'; LivechatVideoCall = new (class LivechatVideoCall { diff --git a/packages/rocketchat-livechat/.app/client/lib/_livechat.js b/packages/rocketchat-livechat/.app/client/lib/_livechat.js index fddfc5040f87..ee2ab10a6cab 100644 --- a/packages/rocketchat-livechat/.app/client/lib/_livechat.js +++ b/packages/rocketchat-livechat/.app/client/lib/_livechat.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import visitor from '../../imports/client/visitor'; this.Livechat = new (class Livechat { diff --git a/packages/rocketchat-livechat/.app/client/lib/fromApp/RoomHistoryManager.js b/packages/rocketchat-livechat/.app/client/lib/fromApp/RoomHistoryManager.js index 76a64bdbc905..dabc2282d6ba 100644 --- a/packages/rocketchat-livechat/.app/client/lib/fromApp/RoomHistoryManager.js +++ b/packages/rocketchat-livechat/.app/client/lib/fromApp/RoomHistoryManager.js @@ -1,6 +1,7 @@ /* globals readMessage UserRoles RoomRoles*/ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import visitor from '../../../imports/client/visitor'; import _ from 'underscore'; diff --git a/packages/rocketchat-livechat/.app/client/lib/msgTyping.js b/packages/rocketchat-livechat/.app/client/lib/msgTyping.js index a4222d404c95..ee50da90fa22 100644 --- a/packages/rocketchat-livechat/.app/client/lib/msgTyping.js +++ b/packages/rocketchat-livechat/.app/client/lib/msgTyping.js @@ -1,5 +1,6 @@ /* globals Notifications, Livechat */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import visitor from '../../imports/client/visitor'; import _ from 'underscore'; diff --git a/packages/rocketchat-livechat/.app/client/views/messages.js b/packages/rocketchat-livechat/.app/client/views/messages.js index d215a5845b92..c4ea12aa4201 100644 --- a/packages/rocketchat-livechat/.app/client/views/messages.js +++ b/packages/rocketchat-livechat/.app/client/views/messages.js @@ -1,5 +1,6 @@ /* globals Livechat, LivechatVideoCall, MsgTyping, fileUpload */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import visitor from '../../imports/client/visitor'; import _ from 'underscore'; import mime from 'mime-type/with-db'; diff --git a/packages/rocketchat-livechat/.app/client/views/offlineForm.js b/packages/rocketchat-livechat/.app/client/views/offlineForm.js index ca1742fef4cd..dcff90237085 100644 --- a/packages/rocketchat-livechat/.app/client/views/offlineForm.js +++ b/packages/rocketchat-livechat/.app/client/views/offlineForm.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-livechat/.app/client/views/register.js b/packages/rocketchat-livechat/.app/client/views/register.js index 1dd8bd91b21b..d31f76c75158 100644 --- a/packages/rocketchat-livechat/.app/client/views/register.js +++ b/packages/rocketchat-livechat/.app/client/views/register.js @@ -1,5 +1,6 @@ /* globals Department, Livechat, LivechatVideoCall */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import visitor from '../../imports/client/visitor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-livechat/.app/client/views/switchDepartment.js b/packages/rocketchat-livechat/.app/client/views/switchDepartment.js index 5f04075380d3..b170dcd43667 100644 --- a/packages/rocketchat-livechat/.app/client/views/switchDepartment.js +++ b/packages/rocketchat-livechat/.app/client/views/switchDepartment.js @@ -1,5 +1,6 @@ /* globals Department, Livechat */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import swal from 'sweetalert2'; import visitor from '../../imports/client/visitor'; diff --git a/packages/rocketchat-livechat/.app/client/views/videoCall.js b/packages/rocketchat-livechat/.app/client/views/videoCall.js index d0e6231feba8..95d817a04a84 100644 --- a/packages/rocketchat-livechat/.app/client/views/videoCall.js +++ b/packages/rocketchat-livechat/.app/client/views/videoCall.js @@ -1,4 +1,5 @@ /* globals LivechatVideoCall */ +import { ReactiveVar } from 'meteor/reactive-var'; Template.videoCall.helpers({ visible() { diff --git a/packages/rocketchat-livechat/.app/imports/client/visitor.js b/packages/rocketchat-livechat/.app/imports/client/visitor.js index df151fb45bf0..8b20645f85ac 100644 --- a/packages/rocketchat-livechat/.app/imports/client/visitor.js +++ b/packages/rocketchat-livechat/.app/imports/client/visitor.js @@ -1,5 +1,6 @@ /* globals Commands, Livechat, UserPresence */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; const msgStream = new Meteor.Streamer('room-messages'); diff --git a/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalytics.js b/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalytics.js index 9584b02159bb..bf22bcfd3035 100644 --- a/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalytics.js +++ b/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalytics.js @@ -1,5 +1,6 @@ /* globals popover */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import moment from 'moment'; import { drawLineChart } from '../../../lib/chartHandler'; diff --git a/packages/rocketchat-livechat/client/views/app/analytics/livechatRealTimeMonitoring.js b/packages/rocketchat-livechat/client/views/app/analytics/livechatRealTimeMonitoring.js index 2029c19f14a9..6d1cb7495bbd 100644 --- a/packages/rocketchat-livechat/client/views/app/analytics/livechatRealTimeMonitoring.js +++ b/packages/rocketchat-livechat/client/views/app/analytics/livechatRealTimeMonitoring.js @@ -1,4 +1,5 @@ import moment from 'moment'; +import { ReactiveVar } from 'meteor/reactive-var'; import { drawLineChart, drawDoughnutChart, updateChart } from '../../../lib/chartHandler'; import { getTimingsChartData, getAgentStatusData, getConversationsOverviewData, getTimingsOverviewData } from '../../../lib/dataHandler'; diff --git a/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationFacebook.js b/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationFacebook.js index be8ba6494be0..19feab3b1033 100644 --- a/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationFacebook.js +++ b/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationFacebook.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; Template.livechatIntegrationFacebook.helpers({ pages() { diff --git a/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationWebhook.js b/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationWebhook.js index ee78853ae6e1..8a4ad736ff87 100644 --- a/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationWebhook.js +++ b/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationWebhook.js @@ -1,5 +1,6 @@ /* globals LivechatIntegration */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatAppearance.js b/packages/rocketchat-livechat/client/views/app/livechatAppearance.js index 335fbfb18cc2..4fe233c3f568 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatAppearance.js +++ b/packages/rocketchat-livechat/client/views/app/livechatAppearance.js @@ -1,6 +1,7 @@ /* globals jscolor*/ /* eslint new-cap: ["error", { "newIsCapExceptions": ["jscolor"] }]*/ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js b/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js index 5da996c4c799..847231745d25 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js +++ b/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import moment from 'moment'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatCustomFieldForm.js b/packages/rocketchat-livechat/client/views/app/livechatCustomFieldForm.js index d37f0d04d0e4..0696a41193f5 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatCustomFieldForm.js +++ b/packages/rocketchat-livechat/client/views/app/livechatCustomFieldForm.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import toastr from 'toastr'; Template.livechatCustomFieldForm.helpers({ diff --git a/packages/rocketchat-livechat/client/views/app/livechatDepartmentForm.js b/packages/rocketchat-livechat/client/views/app/livechatDepartmentForm.js index ffada6274c48..7038571b20a1 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatDepartmentForm.js +++ b/packages/rocketchat-livechat/client/views/app/livechatDepartmentForm.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatOfficeHours.js b/packages/rocketchat-livechat/client/views/app/livechatOfficeHours.js index 88c22b84a0e4..7b4200a3dba4 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatOfficeHours.js +++ b/packages/rocketchat-livechat/client/views/app/livechatOfficeHours.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import toastr from 'toastr'; /* globals LivechatOfficeHour */ import moment from 'moment'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatQueue.js b/packages/rocketchat-livechat/client/views/app/livechatQueue.js index 7925fa0bb58f..f7808fa73e62 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatQueue.js +++ b/packages/rocketchat-livechat/client/views/app/livechatQueue.js @@ -1,5 +1,6 @@ /* globals LivechatQueueUser */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; Template.livechatQueue.helpers({ departments() { diff --git a/packages/rocketchat-livechat/client/views/app/tabbar/visitorEdit.js b/packages/rocketchat-livechat/client/views/app/tabbar/visitorEdit.js index e8267c986795..c2d69c8e0594 100644 --- a/packages/rocketchat-livechat/client/views/app/tabbar/visitorEdit.js +++ b/packages/rocketchat-livechat/client/views/app/tabbar/visitorEdit.js @@ -1,7 +1,8 @@ /* globals LivechatVisitor */ import { Meteor } from 'meteor/meteor'; - +import { ReactiveVar } from 'meteor/reactive-var'; import toastr from 'toastr'; + Template.visitorEdit.helpers({ visitor() { return Template.instance().visitor.get(); diff --git a/packages/rocketchat-livechat/client/views/app/tabbar/visitorForward.js b/packages/rocketchat-livechat/client/views/app/tabbar/visitorForward.js index 777e7141dd71..74a7bc01ba93 100644 --- a/packages/rocketchat-livechat/client/views/app/tabbar/visitorForward.js +++ b/packages/rocketchat-livechat/client/views/app/tabbar/visitorForward.js @@ -1,5 +1,7 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import toastr from 'toastr'; + Template.visitorForward.helpers({ visitor() { return Template.instance().visitor.get(); diff --git a/packages/rocketchat-livechat/client/views/app/tabbar/visitorHistory.js b/packages/rocketchat-livechat/client/views/app/tabbar/visitorHistory.js index f4f321de4bb4..87efe06b1f4a 100644 --- a/packages/rocketchat-livechat/client/views/app/tabbar/visitorHistory.js +++ b/packages/rocketchat-livechat/client/views/app/tabbar/visitorHistory.js @@ -1,3 +1,4 @@ +import { ReactiveVar } from 'meteor/reactive-var'; import moment from 'moment'; const visitorHistory = new Mongo.Collection('visitor_history'); diff --git a/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js b/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js index 7a95b9f62646..147d0818eb71 100644 --- a/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js +++ b/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js @@ -1,6 +1,7 @@ /* globals LivechatVisitor */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-livechat/client/views/app/triggers/livechatTriggerAction.js b/packages/rocketchat-livechat/client/views/app/triggers/livechatTriggerAction.js index c339387d8ac9..5394dd09204a 100644 --- a/packages/rocketchat-livechat/client/views/app/triggers/livechatTriggerAction.js +++ b/packages/rocketchat-livechat/client/views/app/triggers/livechatTriggerAction.js @@ -1,3 +1,5 @@ +import { ReactiveVar } from 'meteor/reactive-var'; + Template.livechatTriggerAction.helpers({ hiddenValue(current) { if (this.name === undefined && Template.instance().firstAction) { diff --git a/packages/rocketchat-livechat/client/views/sideNav/livechat.js b/packages/rocketchat-livechat/client/views/sideNav/livechat.js index c5d053bc70bd..6a8841129120 100644 --- a/packages/rocketchat-livechat/client/views/sideNav/livechat.js +++ b/packages/rocketchat-livechat/client/views/sideNav/livechat.js @@ -1,5 +1,6 @@ /* globals LivechatInquiry, KonchatNotification */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; Template.livechat.helpers({ isActive() { diff --git a/packages/rocketchat-livestream/client/views/broadcastView.js b/packages/rocketchat-livestream/client/views/broadcastView.js index 9faa2e5b702d..3c1c3c613389 100644 --- a/packages/rocketchat-livestream/client/views/broadcastView.js +++ b/packages/rocketchat-livestream/client/views/broadcastView.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; const getMedia = () => navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; const createAndConnect = (url) => { diff --git a/packages/rocketchat-livestream/client/views/liveStreamTab.js b/packages/rocketchat-livestream/client/views/liveStreamTab.js index bcaa38181db5..f0bbce9d51af 100644 --- a/packages/rocketchat-livestream/client/views/liveStreamTab.js +++ b/packages/rocketchat-livestream/client/views/liveStreamTab.js @@ -1,5 +1,6 @@ /* globals popout */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import toastr from 'toastr'; import { auth } from '../oauth.js'; import { RocketChatAnnouncement } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-livestream/client/views/liveStreamView.js b/packages/rocketchat-livestream/client/views/liveStreamView.js index d5c10cc6ca59..93011ba3b0f7 100644 --- a/packages/rocketchat-livestream/client/views/liveStreamView.js +++ b/packages/rocketchat-livestream/client/views/liveStreamView.js @@ -1,3 +1,4 @@ +import { ReactiveVar } from 'meteor/reactive-var'; this.onYouTubePlayerAPIReady = function() { const playerReadyEvent = new Event('playerReady'); diff --git a/packages/rocketchat-mentions-flextab/client/views/mentionsFlexTab.js b/packages/rocketchat-mentions-flextab/client/views/mentionsFlexTab.js index cd0553eb6dce..eee8673de2c9 100644 --- a/packages/rocketchat-mentions-flextab/client/views/mentionsFlexTab.js +++ b/packages/rocketchat-mentions-flextab/client/views/mentionsFlexTab.js @@ -1,5 +1,6 @@ /* globals MentionedMessage */ import _ from 'underscore'; +import { ReactiveVar } from 'meteor/reactive-var'; Template.mentionsFlexTab.helpers({ hasMessages() { diff --git a/packages/rocketchat-message-pin/client/views/pinnedMessages.js b/packages/rocketchat-message-pin/client/views/pinnedMessages.js index 3331d93211be..eafb34ce2bce 100644 --- a/packages/rocketchat-message-pin/client/views/pinnedMessages.js +++ b/packages/rocketchat-message-pin/client/views/pinnedMessages.js @@ -1,5 +1,6 @@ /* globals PinnedMessage */ import _ from 'underscore'; +import { ReactiveVar } from 'meteor/reactive-var'; Template.pinnedMessages.helpers({ hasMessages() { diff --git a/packages/rocketchat-message-snippet/client/tabBar/views/snippetedMessages.js b/packages/rocketchat-message-snippet/client/tabBar/views/snippetedMessages.js index 840984b26578..8f5ceb0a915b 100644 --- a/packages/rocketchat-message-snippet/client/tabBar/views/snippetedMessages.js +++ b/packages/rocketchat-message-snippet/client/tabBar/views/snippetedMessages.js @@ -1,4 +1,5 @@ import _ from 'underscore'; +import { ReactiveVar } from 'meteor/reactive-var'; /* global SnippetedMessages */ Template.snippetedMessages.helpers({ diff --git a/packages/rocketchat-message-star/client/views/starredMessages.js b/packages/rocketchat-message-star/client/views/starredMessages.js index 63f490632ea2..ddfa2cdc3366 100644 --- a/packages/rocketchat-message-star/client/views/starredMessages.js +++ b/packages/rocketchat-message-star/client/views/starredMessages.js @@ -1,5 +1,6 @@ /* globals StarredMessage */ import _ from 'underscore'; +import { ReactiveVar } from 'meteor/reactive-var'; Template.starredMessages.helpers({ hasMessages() { diff --git a/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.js b/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.js index a443d6c1ffa3..e7729e638a8b 100644 --- a/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.js +++ b/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.js @@ -1,6 +1,7 @@ /* globals ChatOAuthApps */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import toastr from 'toastr'; Template.oauthApp.onCreated(function() { diff --git a/packages/rocketchat-otr/client/rocketchat.otr.js b/packages/rocketchat-otr/client/rocketchat.otr.js index b4abfbae2e71..e167ea328a7d 100644 --- a/packages/rocketchat-otr/client/rocketchat.otr.js +++ b/packages/rocketchat-otr/client/rocketchat.otr.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; class OTR { constructor() { diff --git a/packages/rocketchat-otr/client/rocketchat.otr.room.js b/packages/rocketchat-otr/client/rocketchat.otr.room.js index 8544f89f3b77..a2dd3f4b6f9c 100644 --- a/packages/rocketchat-otr/client/rocketchat.otr.room.js +++ b/packages/rocketchat-otr/client/rocketchat.otr.room.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import { EJSON } from 'meteor/ejson'; import _ from 'underscore'; diff --git a/packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.js b/packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.js index 80f1ee3a2b0e..258afd68eb2b 100644 --- a/packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.js +++ b/packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.js @@ -1,5 +1,6 @@ /* globals ChatSubscription popover */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; const notificationLabels = { all: 'All_messages', diff --git a/packages/rocketchat-search/client/provider/result.js b/packages/rocketchat-search/client/provider/result.js index ecaff5beb7ac..f82b12d4351d 100644 --- a/packages/rocketchat-search/client/provider/result.js +++ b/packages/rocketchat-search/client/provider/result.js @@ -1,5 +1,6 @@ /* globals FlowRouter, RoomHistoryManager */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; Meteor.startup(function() { diff --git a/packages/rocketchat-setup-wizard/client/setupWizard.js b/packages/rocketchat-setup-wizard/client/setupWizard.js index 31095f2b18cb..52d251078553 100644 --- a/packages/rocketchat-setup-wizard/client/setupWizard.js +++ b/packages/rocketchat-setup-wizard/client/setupWizard.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import { ReactiveDict } from 'meteor/reactive-dict'; const cannotSetup = () => { diff --git a/packages/rocketchat-tokenpass/client/tokenChannelsList.js b/packages/rocketchat-tokenpass/client/tokenChannelsList.js index 44b33d61d5e3..505c3a1d7805 100644 --- a/packages/rocketchat-tokenpass/client/tokenChannelsList.js +++ b/packages/rocketchat-tokenpass/client/tokenChannelsList.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; Template.tokenChannelsList.helpers({ rooms() { diff --git a/packages/rocketchat-tokenpass/client/tokenpassChannelSettings.js b/packages/rocketchat-tokenpass/client/tokenpassChannelSettings.js index 39e1f5ff5e0d..8050e871b77a 100644 --- a/packages/rocketchat-tokenpass/client/tokenpassChannelSettings.js +++ b/packages/rocketchat-tokenpass/client/tokenpassChannelSettings.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; Template.channelSettings__tokenpass.helpers({ addDisabled() { diff --git a/packages/rocketchat-ui-account/client/accountPreferences.js b/packages/rocketchat-ui-account/client/accountPreferences.js index 140dba69f79f..03a5c77fed59 100644 --- a/packages/rocketchat-ui-account/client/accountPreferences.js +++ b/packages/rocketchat-ui-account/client/accountPreferences.js @@ -1,5 +1,6 @@ /* globals KonchatNotification */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-account/client/accountProfile.js b/packages/rocketchat-ui-account/client/accountProfile.js index 20f360cea610..7fdda834c7a3 100644 --- a/packages/rocketchat-ui-account/client/accountProfile.js +++ b/packages/rocketchat-ui-account/client/accountProfile.js @@ -1,4 +1,5 @@ import { SHA256 } from 'meteor/sha'; +import { ReactiveVar } from 'meteor/reactive-var'; import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-account/client/avatar/prompt.js b/packages/rocketchat-ui-account/client/avatar/prompt.js index d4c8965d1772..a3ac7cf4ea2b 100644 --- a/packages/rocketchat-ui-account/client/avatar/prompt.js +++ b/packages/rocketchat-ui-account/client/avatar/prompt.js @@ -1,6 +1,7 @@ /* globals fileUploadHandler */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import s from 'underscore.string'; import toastr from 'toastr'; import mime from 'mime-type/with-db'; diff --git a/packages/rocketchat-ui-admin/client/admin.js b/packages/rocketchat-ui-admin/client/admin.js index b42799af3708..b0d1ee8fc997 100644 --- a/packages/rocketchat-ui-admin/client/admin.js +++ b/packages/rocketchat-ui-admin/client/admin.js @@ -1,5 +1,6 @@ /* globals jscolor, i18nDefaultQuery */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-admin/client/adminFlex.js b/packages/rocketchat-ui-admin/client/adminFlex.js index 93a12a2bac49..dc961f734a4c 100644 --- a/packages/rocketchat-ui-admin/client/adminFlex.js +++ b/packages/rocketchat-ui-admin/client/adminFlex.js @@ -1,3 +1,4 @@ +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-admin/client/adminInfo.js b/packages/rocketchat-ui-admin/client/adminInfo.js index 70877e0b428c..f6afb15fdb6b 100644 --- a/packages/rocketchat-ui-admin/client/adminInfo.js +++ b/packages/rocketchat-ui-admin/client/adminInfo.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js b/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js index 41121648ed4a..9b14332a5ecc 100644 --- a/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js +++ b/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js @@ -1,5 +1,6 @@ /* globals AdminChatRoom */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import toastr from 'toastr'; Template.adminRoomInfo.helpers({ selectedRoom() { diff --git a/packages/rocketchat-ui-admin/client/rooms/adminRooms.js b/packages/rocketchat-ui-admin/client/rooms/adminRooms.js index d67267b336ae..0e9ca6da055e 100644 --- a/packages/rocketchat-ui-admin/client/rooms/adminRooms.js +++ b/packages/rocketchat-ui-admin/client/rooms/adminRooms.js @@ -1,5 +1,6 @@ /* globals AdminChatRoom, RocketChat */ import _ from 'underscore'; +import { ReactiveVar } from 'meteor/reactive-var'; import s from 'underscore.string'; import { RocketChatTabBar } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-ui-admin/client/rooms/channelSettingsDefault.js b/packages/rocketchat-ui-admin/client/rooms/channelSettingsDefault.js index 1c1267cb99cf..4358bde620e6 100644 --- a/packages/rocketchat-ui-admin/client/rooms/channelSettingsDefault.js +++ b/packages/rocketchat-ui-admin/client/rooms/channelSettingsDefault.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import toastr from 'toastr'; /* globals AdminChatRoom */ diff --git a/packages/rocketchat-ui-admin/client/users/adminInviteUser.js b/packages/rocketchat-ui-admin/client/users/adminInviteUser.js index 2fd4239fadad..f77303e9341a 100644 --- a/packages/rocketchat-ui-admin/client/users/adminInviteUser.js +++ b/packages/rocketchat-ui-admin/client/users/adminInviteUser.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-admin/client/users/adminUsers.js b/packages/rocketchat-ui-admin/client/users/adminUsers.js index 5bc453f3309c..e6637e38264f 100644 --- a/packages/rocketchat-ui-admin/client/users/adminUsers.js +++ b/packages/rocketchat-ui-admin/client/users/adminUsers.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js b/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js index 83f74d477486..d1e62a41b65a 100644 --- a/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js +++ b/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js @@ -1,5 +1,6 @@ /* globals AutoComplete */ import moment from 'moment'; +import { ReactiveVar } from 'meteor/reactive-var'; import { call } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-ui-flextab/client/flexTabBar.js b/packages/rocketchat-ui-flextab/client/flexTabBar.js index 19615939a7e1..1193c6c5ca25 100644 --- a/packages/rocketchat-ui-flextab/client/flexTabBar.js +++ b/packages/rocketchat-ui-flextab/client/flexTabBar.js @@ -1,5 +1,6 @@ /* globals popover */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; const commonHelpers = { diff --git a/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js b/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js index 731728f731fe..ada8c736badc 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js +++ b/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import toastr from 'toastr'; const acEvents = { diff --git a/packages/rocketchat-ui-flextab/client/tabs/membersList.js b/packages/rocketchat-ui-flextab/client/tabs/membersList.js index 16ebe40bb050..0561bab537e7 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/membersList.js +++ b/packages/rocketchat-ui-flextab/client/tabs/membersList.js @@ -1,5 +1,6 @@ /* globals WebRTC popover isRtl */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import { getActions } from './userActions'; diff --git a/packages/rocketchat-ui-flextab/client/tabs/uploadedFilesList.js b/packages/rocketchat-ui-flextab/client/tabs/uploadedFilesList.js index a32fc21b7d28..cfbb4e17ebf1 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/uploadedFilesList.js +++ b/packages/rocketchat-ui-flextab/client/tabs/uploadedFilesList.js @@ -1,4 +1,5 @@ import { fixCordova } from 'meteor/rocketchat:lazy-load'; +import { ReactiveVar } from 'meteor/reactive-var'; import { DateFormat } from 'meteor/rocketchat:lib'; import _ from 'underscore'; diff --git a/packages/rocketchat-ui-flextab/client/tabs/userEdit.js b/packages/rocketchat-ui-flextab/client/tabs/userEdit.js index 0f67aea2b454..ca4b53e15963 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/userEdit.js +++ b/packages/rocketchat-ui-flextab/client/tabs/userEdit.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import toastr from 'toastr'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-flextab/client/tabs/userInfo.js b/packages/rocketchat-ui-flextab/client/tabs/userInfo.js index 4b00bf993dac..a9de0a497364 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/userInfo.js +++ b/packages/rocketchat-ui-flextab/client/tabs/userInfo.js @@ -1,5 +1,6 @@ /* globals RoomRoles UserRoles popover */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-ui-login/client/login/footer.js b/packages/rocketchat-ui-login/client/login/footer.js index f73b9563be16..77ebc79fcbaf 100644 --- a/packages/rocketchat-ui-login/client/login/footer.js +++ b/packages/rocketchat-ui-login/client/login/footer.js @@ -1,3 +1,5 @@ +import { ReactiveVar } from 'meteor/reactive-var'; + Template.loginFooter.onCreated(function() { this.suggestedLanguage = new ReactiveVar(); diff --git a/packages/rocketchat-ui-login/client/login/form.js b/packages/rocketchat-ui-login/client/login/form.js index eff33471aba4..4afce63c4d9d 100644 --- a/packages/rocketchat-ui-login/client/login/form.js +++ b/packages/rocketchat-ui-login/client/login/form.js @@ -1,5 +1,6 @@ /* globals OnePassword, device */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-login/client/username/username.js b/packages/rocketchat-ui-login/client/username/username.js index aa5bd4a5df51..f7c9c9a31270 100644 --- a/packages/rocketchat-ui-login/client/username/username.js +++ b/packages/rocketchat-ui-login/client/username/username.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; Template.username.onCreated(function() { diff --git a/packages/rocketchat-ui-master/client/main.js b/packages/rocketchat-ui-master/client/main.js index 501d8c6ccfe5..be1701753980 100644 --- a/packages/rocketchat-ui-master/client/main.js +++ b/packages/rocketchat-ui-master/client/main.js @@ -1,5 +1,6 @@ /* globals toolbarSearch, menu, fireGlobalEvent, CachedChatSubscription, DynamicCss, popover */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import Clipboard from 'clipboard'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-message/client/messageBox.js b/packages/rocketchat-ui-message/client/messageBox.js index 089928306297..ea5e76811264 100644 --- a/packages/rocketchat-ui-message/client/messageBox.js +++ b/packages/rocketchat-ui-message/client/messageBox.js @@ -1,5 +1,6 @@ /* globals fileUpload KonchatNotification chatMessages popover AudioRecorder chatMessages fileUploadHandler*/ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import toastr from 'toastr'; import moment from 'moment'; import _ from 'underscore'; diff --git a/packages/rocketchat-ui-message/client/popup/messagePopup.js b/packages/rocketchat-ui-message/client/popup/messagePopup.js index 94c9c845e4d5..902327d963b9 100644 --- a/packages/rocketchat-ui-message/client/popup/messagePopup.js +++ b/packages/rocketchat-ui-message/client/popup/messagePopup.js @@ -3,6 +3,7 @@ // it is just to improve readability in this file import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import { lazyloadtick } from 'meteor/rocketchat:lazy-load'; diff --git a/packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js b/packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js index f190d998ea52..4a809f0756b3 100644 --- a/packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js +++ b/packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js @@ -1,6 +1,7 @@ /* globals toolbarSearch */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; const keys = { diff --git a/packages/rocketchat-ui-sidenav/client/createCombinedFlex.js b/packages/rocketchat-ui-sidenav/client/createCombinedFlex.js index 9e196372e80d..e9f932bb41b5 100644 --- a/packages/rocketchat-ui-sidenav/client/createCombinedFlex.js +++ b/packages/rocketchat-ui-sidenav/client/createCombinedFlex.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; Template.createCombinedFlex.helpers({ diff --git a/packages/rocketchat-ui-sidenav/client/listChannelsFlex.js b/packages/rocketchat-ui-sidenav/client/listChannelsFlex.js index ce95e7eff142..8952e7a8c295 100644 --- a/packages/rocketchat-ui-sidenav/client/listChannelsFlex.js +++ b/packages/rocketchat-ui-sidenav/client/listChannelsFlex.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-sidenav/client/listCombinedFlex.js b/packages/rocketchat-ui-sidenav/client/listCombinedFlex.js index 4cfcd6f1d6b1..8dd2cc5df7dc 100644 --- a/packages/rocketchat-ui-sidenav/client/listCombinedFlex.js +++ b/packages/rocketchat-ui-sidenav/client/listCombinedFlex.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-sidenav/client/listPrivateGroupsFlex.js b/packages/rocketchat-ui-sidenav/client/listPrivateGroupsFlex.js index a3dff0b4248c..f7d707c80ee6 100644 --- a/packages/rocketchat-ui-sidenav/client/listPrivateGroupsFlex.js +++ b/packages/rocketchat-ui-sidenav/client/listPrivateGroupsFlex.js @@ -1,5 +1,6 @@ import _ from 'underscore'; import s from 'underscore.string'; +import { ReactiveVar } from 'meteor/reactive-var'; Template.listPrivateGroupsFlex.helpers({ groups() { diff --git a/packages/rocketchat-ui-sidenav/client/sideNav.js b/packages/rocketchat-ui-sidenav/client/sideNav.js index 6d752fc05569..6d345faee18e 100644 --- a/packages/rocketchat-ui-sidenav/client/sideNav.js +++ b/packages/rocketchat-ui-sidenav/client/sideNav.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import { lazyloadtick } from 'meteor/rocketchat:lazy-load'; /* globals menu*/ diff --git a/packages/rocketchat-ui-sidenav/client/sidebarItem.js b/packages/rocketchat-ui-sidenav/client/sidebarItem.js index 6de33f88e5aa..5f90c7c31c33 100644 --- a/packages/rocketchat-ui-sidenav/client/sidebarItem.js +++ b/packages/rocketchat-ui-sidenav/client/sidebarItem.js @@ -1,5 +1,6 @@ /* globals menu popover renderMessageBody */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import moment from 'moment'; Template.sidebarItem.helpers({ diff --git a/packages/rocketchat-ui-sidenav/client/toolbar.js b/packages/rocketchat-ui-sidenav/client/toolbar.js index 93c04d84b97a..838494996070 100644 --- a/packages/rocketchat-ui-sidenav/client/toolbar.js +++ b/packages/rocketchat-ui-sidenav/client/toolbar.js @@ -1,6 +1,7 @@ /* global menu */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; let isLoading; diff --git a/packages/rocketchat-ui/client/components/selectDropdown.js b/packages/rocketchat-ui/client/components/selectDropdown.js index 7a08c1c7cc11..a8b239ef3826 100644 --- a/packages/rocketchat-ui/client/components/selectDropdown.js +++ b/packages/rocketchat-ui/client/components/selectDropdown.js @@ -1,3 +1,5 @@ +import { ReactiveVar } from 'meteor/reactive-var'; + Template.selectDropdown.events({ 'focus input'(e, i) { i.open.set(true); diff --git a/packages/rocketchat-ui/client/components/tabs.js b/packages/rocketchat-ui/client/components/tabs.js index e4968758c884..f9752e569698 100644 --- a/packages/rocketchat-ui/client/components/tabs.js +++ b/packages/rocketchat-ui/client/components/tabs.js @@ -1,3 +1,5 @@ +import { ReactiveVar } from 'meteor/reactive-var'; + Template.tabs.onCreated(function() { this.activeTab = new ReactiveVar(this.data.tabs.tabs.find((tab) => tab.active).value); }); diff --git a/packages/rocketchat-ui/client/lib/RoomHistoryManager.js b/packages/rocketchat-ui/client/lib/RoomHistoryManager.js index 0281fb645be6..c8a4a14b84d6 100644 --- a/packages/rocketchat-ui/client/lib/RoomHistoryManager.js +++ b/packages/rocketchat-ui/client/lib/RoomHistoryManager.js @@ -1,5 +1,6 @@ /* globals readMessage UserRoles RoomRoles*/ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; export const upsertMessage = ({ msg, subscription }) => { diff --git a/packages/rocketchat-ui/client/lib/RoomManager.js b/packages/rocketchat-ui/client/lib/RoomManager.js index 0a1d6b8ae04c..0a4e11960883 100644 --- a/packages/rocketchat-ui/client/lib/RoomManager.js +++ b/packages/rocketchat-ui/client/lib/RoomManager.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import { upsertMessage } from './RoomHistoryManager'; diff --git a/packages/rocketchat-ui/client/lib/accountBox.js b/packages/rocketchat-ui/client/lib/accountBox.js index 94bb707186bc..de096a06f023 100644 --- a/packages/rocketchat-ui/client/lib/accountBox.js +++ b/packages/rocketchat-ui/client/lib/accountBox.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; this.AccountBox = (function() { diff --git a/packages/rocketchat-ui/client/lib/chatMessages.js b/packages/rocketchat-ui/client/lib/chatMessages.js index 4209142ca58b..7494bcec7662 100644 --- a/packages/rocketchat-ui/client/lib/chatMessages.js +++ b/packages/rocketchat-ui/client/lib/chatMessages.js @@ -1,5 +1,6 @@ /* globals MsgTyping */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui/client/lib/msgTyping.js b/packages/rocketchat-ui/client/lib/msgTyping.js index 3941a9fbdb5c..621c5a623bb9 100644 --- a/packages/rocketchat-ui/client/lib/msgTyping.js +++ b/packages/rocketchat-ui/client/lib/msgTyping.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; export const MsgTyping = (function() { diff --git a/packages/rocketchat-ui/client/lib/notification.js b/packages/rocketchat-ui/client/lib/notification.js index 70d4350a6add..ba8796d41ad5 100644 --- a/packages/rocketchat-ui/client/lib/notification.js +++ b/packages/rocketchat-ui/client/lib/notification.js @@ -1,5 +1,6 @@ // @TODO implementar 'clicar na notificacao' abre a janela do chat import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui/client/lib/recorderjs/videoRecorder.js b/packages/rocketchat-ui/client/lib/recorderjs/videoRecorder.js index aa6c8882e633..3d0c88b0634d 100644 --- a/packages/rocketchat-ui/client/lib/recorderjs/videoRecorder.js +++ b/packages/rocketchat-ui/client/lib/recorderjs/videoRecorder.js @@ -1,3 +1,5 @@ +import { ReactiveVar } from 'meteor/reactive-var'; + this.VideoRecorder = new class { constructor() { this.started = false; diff --git a/packages/rocketchat-ui/client/views/app/createChannel.js b/packages/rocketchat-ui/client/views/app/createChannel.js index 6cbf6140961e..c84097acb76d 100644 --- a/packages/rocketchat-ui/client/views/app/createChannel.js +++ b/packages/rocketchat-ui/client/views/app/createChannel.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; const acEvents = { diff --git a/packages/rocketchat-ui/client/views/app/directory.js b/packages/rocketchat-ui/client/views/app/directory.js index ed8733092df1..d206f0fb1d55 100644 --- a/packages/rocketchat-ui/client/views/app/directory.js +++ b/packages/rocketchat-ui/client/views/app/directory.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import { timeAgo } from './helpers'; diff --git a/packages/rocketchat-ui/client/views/app/popout.js b/packages/rocketchat-ui/client/views/app/popout.js index 9e2cc2dae4f5..eb704e739007 100644 --- a/packages/rocketchat-ui/client/views/app/popout.js +++ b/packages/rocketchat-ui/client/views/app/popout.js @@ -1,4 +1,5 @@ /* globals popout */ +import { ReactiveVar } from 'meteor/reactive-var'; this.popout = { context: null, diff --git a/packages/rocketchat-ui/client/views/app/room.js b/packages/rocketchat-ui/client/views/app/room.js index ae04f7f4ee89..e0be722dc5f8 100644 --- a/packages/rocketchat-ui/client/views/app/room.js +++ b/packages/rocketchat-ui/client/views/app/room.js @@ -1,5 +1,6 @@ /* globals chatMessages, fileUpload , fireGlobalEvent , cordova , readMessage , RoomRoles, popover , device */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import { RocketChatTabBar } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-ui/client/views/app/secretURL.js b/packages/rocketchat-ui/client/views/app/secretURL.js index af32336689b4..5b67c656c43f 100644 --- a/packages/rocketchat-ui/client/views/app/secretURL.js +++ b/packages/rocketchat-ui/client/views/app/secretURL.js @@ -1,5 +1,6 @@ /* globals KonchatNotification */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; Template.secretURL.helpers({ registrationAllowed() { diff --git a/packages/rocketchat-ui/client/views/app/videoCall/videoCall.js b/packages/rocketchat-ui/client/views/app/videoCall/videoCall.js index f05aed90c741..cbde903391a5 100644 --- a/packages/rocketchat-ui/client/views/app/videoCall/videoCall.js +++ b/packages/rocketchat-ui/client/views/app/videoCall/videoCall.js @@ -1,5 +1,6 @@ /* globals WebRTC */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; Template.videoCall.onCreated(function() { return this.mainVideo = new ReactiveVar('$auto'); diff --git a/packages/rocketchat-ui/client/views/cmsPage.js b/packages/rocketchat-ui/client/views/cmsPage.js index ac0e30876a47..68693ffce03c 100644 --- a/packages/rocketchat-ui/client/views/cmsPage.js +++ b/packages/rocketchat-ui/client/views/cmsPage.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; Template.cmsPage.onCreated(function() { this.page = new ReactiveVar(''); diff --git a/packages/rocketchat-webdav/client/addWebdavAccount.js b/packages/rocketchat-webdav/client/addWebdavAccount.js index db8c6358c064..d32572c005f7 100644 --- a/packages/rocketchat-webdav/client/addWebdavAccount.js +++ b/packages/rocketchat-webdav/client/addWebdavAccount.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-webrtc/client/WebRTCClass.js b/packages/rocketchat-webrtc/client/WebRTCClass.js index 5919330d468a..adb6b79bc54f 100644 --- a/packages/rocketchat-webrtc/client/WebRTCClass.js +++ b/packages/rocketchat-webrtc/client/WebRTCClass.js @@ -1,5 +1,7 @@ /* globals chrome, ChromeScreenShare */ import { Meteor } from 'meteor/meteor'; +import { ReactiveVar } from 'meteor/reactive-var'; + class WebRTCTransportClass { constructor(webrtcInstance) { this.debug = false; From 103d8c5e2386afd7e9c4eddb47eae9a0e9b8e531 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Fri, 19 Oct 2018 14:54:25 -0300 Subject: [PATCH 13/34] Remove global variable Accounts --- .eslintrc | 1 - client/routes/router.js | 1 + packages/meteor-accounts-saml/saml_client.js | 1 + packages/meteor-accounts-saml/saml_rocketchat.js | 2 ++ packages/meteor-accounts-saml/saml_server.js | 1 + packages/rocketchat-2fa/client/TOTPPassword.js | 1 + packages/rocketchat-2fa/server/loginHandler.js | 2 ++ packages/rocketchat-api/server/api.js | 1 + packages/rocketchat-api/server/helpers/getLoggedInUser.js | 2 ++ packages/rocketchat-cas/client/cas_client.js | 1 + packages/rocketchat-cas/server/cas_server.js | 1 + packages/rocketchat-crowd/client/loginHelper.js | 1 + packages/rocketchat-crowd/server/crowd.js | 1 + packages/rocketchat-custom-oauth/client/custom_oauth_client.js | 1 + packages/rocketchat-custom-oauth/server/custom_oauth_server.js | 1 + packages/rocketchat-file-upload/client/lib/fileUploadHandler.js | 1 + packages/rocketchat-importer-csv/server/importer.js | 1 + .../rocketchat-importer-hipchat-enterprise/server/importer.js | 1 + packages/rocketchat-importer-hipchat/server/importer.js | 1 + packages/rocketchat-importer-slack-users/server/importer.js | 1 + packages/rocketchat-importer-slack/server/importer.js | 1 + packages/rocketchat-ldap/client/loginHelper.js | 1 + packages/rocketchat-ldap/server/loginHandler.js | 1 + packages/rocketchat-ldap/server/sync.js | 1 + packages/rocketchat-lib/client/lib/cachedCollection.js | 1 + packages/rocketchat-lib/server/functions/saveUser.js | 1 + packages/rocketchat-lib/server/functions/setUsername.js | 1 + packages/rocketchat-lib/server/lib/loginErrorMessageOverride.js | 1 + packages/rocketchat-lib/server/methods/createToken.js | 1 + packages/rocketchat-lib/server/methods/deleteUserOwnAccount.js | 1 + packages/rocketchat-lib/server/models/Users.js | 1 + packages/rocketchat-lib/server/oauth/oauth.js | 1 + packages/rocketchat-slackbridge/server/RocketAdapter.js | 1 + packages/rocketchat-token-login/client/login_token_client.js | 1 + packages/rocketchat-tokenpass/server/startup.js | 1 + .../rocketchat-ui-login/client/reset-password/resetPassword.js | 1 + packages/rocketchat-ui/client/lib/accounts.js | 1 + packages/rocketchat-ui/client/lib/cordova/facebook-login.js | 1 + server/configuration/accounts_meld.js | 1 + server/lib/accounts.js | 1 + server/lib/cordova/facebook-login.js | 1 + server/methods/registerUser.js | 1 + server/methods/saveUserProfile.js | 1 + server/methods/sendConfirmationEmail.js | 1 + server/methods/sendForgotPasswordEmail.js | 1 + server/methods/setUserActiveStatus.js | 1 + server/methods/setUserPassword.js | 1 + server/startup/initialData.js | 1 + 48 files changed, 50 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index f5360273ec2d..4142562873ce 100644 --- a/.eslintrc +++ b/.eslintrc @@ -4,7 +4,6 @@ "globals": { "__meteor_runtime_config__" : false, "AccountBox" : false, - "Accounts" : false, "AgentUsers" : false, "Apps" : false, "Assets" : false, diff --git a/client/routes/router.js b/client/routes/router.js index 45d241687e86..748f329da75f 100644 --- a/client/routes/router.js +++ b/client/routes/router.js @@ -1,5 +1,6 @@ /* globals KonchatNotification */ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import s from 'underscore.string'; Blaze.registerHelper('pathFor', function(path, kw) { diff --git a/packages/meteor-accounts-saml/saml_client.js b/packages/meteor-accounts-saml/saml_client.js index 64b6572c6c4f..bc0076e9ac94 100644 --- a/packages/meteor-accounts-saml/saml_client.js +++ b/packages/meteor-accounts-saml/saml_client.js @@ -1,5 +1,6 @@ /* globals cordova */ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import { Random } from 'meteor/random'; if (!Accounts.saml) { diff --git a/packages/meteor-accounts-saml/saml_rocketchat.js b/packages/meteor-accounts-saml/saml_rocketchat.js index f7b5b6b354aa..40d18a5cb0bd 100644 --- a/packages/meteor-accounts-saml/saml_rocketchat.js +++ b/packages/meteor-accounts-saml/saml_rocketchat.js @@ -1,4 +1,6 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; + const logger = new Logger('steffo:meteor-accounts-saml', { methods: { updated: { diff --git a/packages/meteor-accounts-saml/saml_server.js b/packages/meteor-accounts-saml/saml_server.js index 7ee9cc9c0164..4bc41a2e5445 100644 --- a/packages/meteor-accounts-saml/saml_server.js +++ b/packages/meteor-accounts-saml/saml_server.js @@ -1,6 +1,7 @@ /* globals RoutePolicy, SAML */ /* jshint newcap: false */ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import { Random } from 'meteor/random'; import { WebApp } from 'meteor/webapp'; import _ from 'underscore'; diff --git a/packages/rocketchat-2fa/client/TOTPPassword.js b/packages/rocketchat-2fa/client/TOTPPassword.js index 4c087081bfb4..5ac31193fc67 100644 --- a/packages/rocketchat-2fa/client/TOTPPassword.js +++ b/packages/rocketchat-2fa/client/TOTPPassword.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import toastr from 'toastr'; function reportError(error, callback) { diff --git a/packages/rocketchat-2fa/server/loginHandler.js b/packages/rocketchat-2fa/server/loginHandler.js index db4794391683..545038cfb73b 100644 --- a/packages/rocketchat-2fa/server/loginHandler.js +++ b/packages/rocketchat-2fa/server/loginHandler.js @@ -1,4 +1,6 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; + Accounts.registerLoginHandler('totp', function(options) { if (!options.totp || !options.totp.code) { return; diff --git a/packages/rocketchat-api/server/api.js b/packages/rocketchat-api/server/api.js index 6c57dc06d50b..614b0af4048d 100644 --- a/packages/rocketchat-api/server/api.js +++ b/packages/rocketchat-api/server/api.js @@ -1,5 +1,6 @@ /* global Restivus, DDP, DDPCommon */ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import _ from 'underscore'; const logger = new Logger('API', {}); diff --git a/packages/rocketchat-api/server/helpers/getLoggedInUser.js b/packages/rocketchat-api/server/helpers/getLoggedInUser.js index 5126d2b67748..f67a50928176 100644 --- a/packages/rocketchat-api/server/helpers/getLoggedInUser.js +++ b/packages/rocketchat-api/server/helpers/getLoggedInUser.js @@ -1,3 +1,5 @@ +import { Accounts } from 'meteor/accounts-base'; + RocketChat.API.helperMethods.set('getLoggedInUser', function _getLoggedInUser() { let user; diff --git a/packages/rocketchat-cas/client/cas_client.js b/packages/rocketchat-cas/client/cas_client.js index 34654f918fcf..9bf775ec8e39 100644 --- a/packages/rocketchat-cas/client/cas_client.js +++ b/packages/rocketchat-cas/client/cas_client.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import { Random } from 'meteor/random'; const openCenteredPopup = function(url, width, height) { diff --git a/packages/rocketchat-cas/server/cas_server.js b/packages/rocketchat-cas/server/cas_server.js index 7b72f5fb96f7..3f03dbf65c8a 100644 --- a/packages/rocketchat-cas/server/cas_server.js +++ b/packages/rocketchat-cas/server/cas_server.js @@ -1,6 +1,7 @@ /* globals RoutePolicy, logger */ /* jshint newcap: false */ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import { Random } from 'meteor/random'; import { WebApp } from 'meteor/webapp'; import _ from 'underscore'; diff --git a/packages/rocketchat-crowd/client/loginHelper.js b/packages/rocketchat-crowd/client/loginHelper.js index e8a87e38aec3..a7056d5d2ffe 100644 --- a/packages/rocketchat-crowd/client/loginHelper.js +++ b/packages/rocketchat-crowd/client/loginHelper.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; Meteor.loginWithCrowd = function(...args) { // Pull username and password diff --git a/packages/rocketchat-crowd/server/crowd.js b/packages/rocketchat-crowd/server/crowd.js index 7ea4313e4e2b..67c53b291776 100644 --- a/packages/rocketchat-crowd/server/crowd.js +++ b/packages/rocketchat-crowd/server/crowd.js @@ -2,6 +2,7 @@ /* eslint new-cap: [2, {"capIsNewExceptions": ["SHA256"]}] */ import { SHA256 } from 'meteor/sha'; import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; const logger = new Logger('CROWD', {}); function fallbackDefaultAccountSystem(bind, username, password) { diff --git a/packages/rocketchat-custom-oauth/client/custom_oauth_client.js b/packages/rocketchat-custom-oauth/client/custom_oauth_client.js index 014937870876..f93ee32782d2 100644 --- a/packages/rocketchat-custom-oauth/client/custom_oauth_client.js +++ b/packages/rocketchat-custom-oauth/client/custom_oauth_client.js @@ -1,5 +1,6 @@ /* globals OAuth*/ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import { Random } from 'meteor/random'; import s from 'underscore.string'; diff --git a/packages/rocketchat-custom-oauth/server/custom_oauth_server.js b/packages/rocketchat-custom-oauth/server/custom_oauth_server.js index 76f05e0a461e..e0c5ba09c758 100644 --- a/packages/rocketchat-custom-oauth/server/custom_oauth_server.js +++ b/packages/rocketchat-custom-oauth/server/custom_oauth_server.js @@ -1,5 +1,6 @@ /* globals OAuth*/ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import { HTTP } from 'meteor/http'; import _ from 'underscore'; diff --git a/packages/rocketchat-file-upload/client/lib/fileUploadHandler.js b/packages/rocketchat-file-upload/client/lib/fileUploadHandler.js index 030f74731f98..b6e2f55310cc 100644 --- a/packages/rocketchat-file-upload/client/lib/fileUploadHandler.js +++ b/packages/rocketchat-file-upload/client/lib/fileUploadHandler.js @@ -1,6 +1,7 @@ /* globals FileUploadBase, UploadFS, fileUploadHandler:true */ /* exported fileUploadHandler */ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; new UploadFS.Store({ collection: RocketChat.models.Uploads.model, diff --git a/packages/rocketchat-importer-csv/server/importer.js b/packages/rocketchat-importer-csv/server/importer.js index c10a512041ca..eeb5c854fccd 100644 --- a/packages/rocketchat-importer-csv/server/importer.js +++ b/packages/rocketchat-importer-csv/server/importer.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import { Base, ProgressStep, diff --git a/packages/rocketchat-importer-hipchat-enterprise/server/importer.js b/packages/rocketchat-importer-hipchat-enterprise/server/importer.js index c50a3776fe49..bcec9cec192e 100644 --- a/packages/rocketchat-importer-hipchat-enterprise/server/importer.js +++ b/packages/rocketchat-importer-hipchat-enterprise/server/importer.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import { Random } from 'meteor/random'; import { Base, diff --git a/packages/rocketchat-importer-hipchat/server/importer.js b/packages/rocketchat-importer-hipchat/server/importer.js index 7c9ec7789fa0..a00526a61b60 100644 --- a/packages/rocketchat-importer-hipchat/server/importer.js +++ b/packages/rocketchat-importer-hipchat/server/importer.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import { Base, ProgressStep, diff --git a/packages/rocketchat-importer-slack-users/server/importer.js b/packages/rocketchat-importer-slack-users/server/importer.js index eba030abc1de..a557cbe717ce 100644 --- a/packages/rocketchat-importer-slack-users/server/importer.js +++ b/packages/rocketchat-importer-slack-users/server/importer.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import { Random } from 'meteor/random'; import { Base, diff --git a/packages/rocketchat-importer-slack/server/importer.js b/packages/rocketchat-importer-slack/server/importer.js index f06f03e641ee..60ef1f2de4fc 100644 --- a/packages/rocketchat-importer-slack/server/importer.js +++ b/packages/rocketchat-importer-slack/server/importer.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import { Base, ProgressStep, diff --git a/packages/rocketchat-ldap/client/loginHelper.js b/packages/rocketchat-ldap/client/loginHelper.js index f5b8e9dc58bf..57a006524c08 100644 --- a/packages/rocketchat-ldap/client/loginHelper.js +++ b/packages/rocketchat-ldap/client/loginHelper.js @@ -3,6 +3,7 @@ // on any particular call (if you have multiple ldap servers you'd like to connect to) // You'll likely want to set the dn value here {dn: "..."} import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; Meteor.loginWithLDAP = function(...args) { // Pull username and password diff --git a/packages/rocketchat-ldap/server/loginHandler.js b/packages/rocketchat-ldap/server/loginHandler.js index 225ef9feeaac..134fbdf0ab36 100644 --- a/packages/rocketchat-ldap/server/loginHandler.js +++ b/packages/rocketchat-ldap/server/loginHandler.js @@ -2,6 +2,7 @@ import { SHA256 } from 'meteor/sha'; import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import { slug, getLdapUsername, getLdapUserUniqueID, syncUserData, addLdapUser } from './sync'; import LDAP from './ldap'; diff --git a/packages/rocketchat-ldap/server/sync.js b/packages/rocketchat-ldap/server/sync.js index 1605d3c38a00..75e3abd719f8 100644 --- a/packages/rocketchat-ldap/server/sync.js +++ b/packages/rocketchat-ldap/server/sync.js @@ -1,6 +1,7 @@ /* globals slugify, SyncedCron */ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import _ from 'underscore'; import LDAP from './ldap'; diff --git a/packages/rocketchat-lib/client/lib/cachedCollection.js b/packages/rocketchat-lib/client/lib/cachedCollection.js index 1b38f7a01591..24a07fbadbf0 100644 --- a/packages/rocketchat-lib/client/lib/cachedCollection.js +++ b/packages/rocketchat-lib/client/lib/cachedCollection.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import { ReactiveVar } from 'meteor/reactive-var'; import localforage from 'localforage'; import _ from 'underscore'; diff --git a/packages/rocketchat-lib/server/functions/saveUser.js b/packages/rocketchat-lib/server/functions/saveUser.js index 38dba4dfe96c..5b8c17318cb7 100644 --- a/packages/rocketchat-lib/server/functions/saveUser.js +++ b/packages/rocketchat-lib/server/functions/saveUser.js @@ -1,5 +1,6 @@ /* globals Gravatar */ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import _ from 'underscore'; import s from 'underscore.string'; import * as Mailer from 'meteor/rocketchat:mailer'; diff --git a/packages/rocketchat-lib/server/functions/setUsername.js b/packages/rocketchat-lib/server/functions/setUsername.js index 20c317c9b032..b9fa77799398 100644 --- a/packages/rocketchat-lib/server/functions/setUsername.js +++ b/packages/rocketchat-lib/server/functions/setUsername.js @@ -1,4 +1,5 @@ import s from 'underscore.string'; +import { Accounts } from 'meteor/accounts-base'; RocketChat._setUsername = function(userId, u) { const username = s.trim(u); diff --git a/packages/rocketchat-lib/server/lib/loginErrorMessageOverride.js b/packages/rocketchat-lib/server/lib/loginErrorMessageOverride.js index 857a4eb5bf92..c75c3853bc1e 100644 --- a/packages/rocketchat-lib/server/lib/loginErrorMessageOverride.js +++ b/packages/rocketchat-lib/server/lib/loginErrorMessageOverride.js @@ -1,5 +1,6 @@ // Do not disclose if user exists when password is invalid import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; const { _runLoginHandlers } = Accounts; Accounts._runLoginHandlers = function(methodInvocation, options) { diff --git a/packages/rocketchat-lib/server/methods/createToken.js b/packages/rocketchat-lib/server/methods/createToken.js index 0dc8711b9df2..249c039b4a61 100644 --- a/packages/rocketchat-lib/server/methods/createToken.js +++ b/packages/rocketchat-lib/server/methods/createToken.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; Meteor.methods({ createToken(userId) { diff --git a/packages/rocketchat-lib/server/methods/deleteUserOwnAccount.js b/packages/rocketchat-lib/server/methods/deleteUserOwnAccount.js index 33128f5ab704..06a7ba4ad9b7 100644 --- a/packages/rocketchat-lib/server/methods/deleteUserOwnAccount.js +++ b/packages/rocketchat-lib/server/methods/deleteUserOwnAccount.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import s from 'underscore.string'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/models/Users.js b/packages/rocketchat-lib/server/models/Users.js index 87fe3900e332..cf968a47c15c 100644 --- a/packages/rocketchat-lib/server/models/Users.js +++ b/packages/rocketchat-lib/server/models/Users.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-lib/server/oauth/oauth.js b/packages/rocketchat-lib/server/oauth/oauth.js index 71cf29905869..49762204713c 100644 --- a/packages/rocketchat-lib/server/oauth/oauth.js +++ b/packages/rocketchat-lib/server/oauth/oauth.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import _ from 'underscore'; const AccessTokenServices = {}; diff --git a/packages/rocketchat-slackbridge/server/RocketAdapter.js b/packages/rocketchat-slackbridge/server/RocketAdapter.js index c4c6bc4054b9..9b92b9a25ce9 100644 --- a/packages/rocketchat-slackbridge/server/RocketAdapter.js +++ b/packages/rocketchat-slackbridge/server/RocketAdapter.js @@ -1,6 +1,7 @@ /* globals logger*/ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import { Random } from 'meteor/random'; import { HTTP } from 'meteor/http'; import _ from 'underscore'; diff --git a/packages/rocketchat-token-login/client/login_token_client.js b/packages/rocketchat-token-login/client/login_token_client.js index 9a850e3efe7c..d0c17e718b27 100644 --- a/packages/rocketchat-token-login/client/login_token_client.js +++ b/packages/rocketchat-token-login/client/login_token_client.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; Meteor.loginWithLoginToken = function(token) { Accounts.callLoginMethod({ diff --git a/packages/rocketchat-tokenpass/server/startup.js b/packages/rocketchat-tokenpass/server/startup.js index 97800dc2b274..883f2424062e 100644 --- a/packages/rocketchat-tokenpass/server/startup.js +++ b/packages/rocketchat-tokenpass/server/startup.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; RocketChat.settings.addGroup('OAuth', function() { this.section('Tokenpass', function() { diff --git a/packages/rocketchat-ui-login/client/reset-password/resetPassword.js b/packages/rocketchat-ui-login/client/reset-password/resetPassword.js index 2406d3a0b8d2..73dc8ad1697b 100644 --- a/packages/rocketchat-ui-login/client/reset-password/resetPassword.js +++ b/packages/rocketchat-ui-login/client/reset-password/resetPassword.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import toastr from 'toastr'; Template.resetPassword.helpers({ diff --git a/packages/rocketchat-ui/client/lib/accounts.js b/packages/rocketchat-ui/client/lib/accounts.js index 5380b57034d3..fa86205b546e 100644 --- a/packages/rocketchat-ui/client/lib/accounts.js +++ b/packages/rocketchat-ui/client/lib/accounts.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import toastr from 'toastr'; Accounts.onEmailVerificationLink(function(token, done) { diff --git a/packages/rocketchat-ui/client/lib/cordova/facebook-login.js b/packages/rocketchat-ui/client/lib/cordova/facebook-login.js index 51707369695a..32cf7486acfc 100644 --- a/packages/rocketchat-ui/client/lib/cordova/facebook-login.js +++ b/packages/rocketchat-ui/client/lib/cordova/facebook-login.js @@ -1,5 +1,6 @@ /* globals facebookConnectPlugin Facebook*/ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; Meteor.loginWithFacebookCordova = function(options, callback) { if (!callback && typeof options === 'function') { diff --git a/server/configuration/accounts_meld.js b/server/configuration/accounts_meld.js index d4f1280c03ca..777840e236fa 100644 --- a/server/configuration/accounts_meld.js +++ b/server/configuration/accounts_meld.js @@ -1,4 +1,5 @@ import _ from 'underscore'; +import { Accounts } from 'meteor/accounts-base'; const orig_updateOrCreateUserFromExternalService = Accounts.updateOrCreateUserFromExternalService; diff --git a/server/lib/accounts.js b/server/lib/accounts.js index 3d5670b2d692..145424cc3bd5 100644 --- a/server/lib/accounts.js +++ b/server/lib/accounts.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import _ from 'underscore'; import s from 'underscore.string'; import * as Mailer from 'meteor/rocketchat:mailer'; diff --git a/server/lib/cordova/facebook-login.js b/server/lib/cordova/facebook-login.js index 3e2a0f3fd748..1122635bfca9 100644 --- a/server/lib/cordova/facebook-login.js +++ b/server/lib/cordova/facebook-login.js @@ -1,4 +1,5 @@ import _ from 'underscore'; +import { Accounts } from 'meteor/accounts-base'; import { HTTP } from 'meteor/http'; function getIdentity(accessToken) { diff --git a/server/methods/registerUser.js b/server/methods/registerUser.js index 491aa23de9b7..8b85f6d8ef90 100644 --- a/server/methods/registerUser.js +++ b/server/methods/registerUser.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import s from 'underscore.string'; import * as Mailer from 'meteor/rocketchat:mailer'; let verifyEmailTemplate = ''; diff --git a/server/methods/saveUserProfile.js b/server/methods/saveUserProfile.js index 4aeaf9c701d7..cf7724e9a955 100644 --- a/server/methods/saveUserProfile.js +++ b/server/methods/saveUserProfile.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; Meteor.methods({ saveUserProfile(settings, customFields) { diff --git a/server/methods/sendConfirmationEmail.js b/server/methods/sendConfirmationEmail.js index bbc82f58f163..5564d3908cb4 100644 --- a/server/methods/sendConfirmationEmail.js +++ b/server/methods/sendConfirmationEmail.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import * as Mailer from 'meteor/rocketchat:mailer'; let subject = ''; diff --git a/server/methods/sendForgotPasswordEmail.js b/server/methods/sendForgotPasswordEmail.js index d763b495c019..10ae67042576 100644 --- a/server/methods/sendForgotPasswordEmail.js +++ b/server/methods/sendForgotPasswordEmail.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import s from 'underscore.string'; import * as Mailer from 'meteor/rocketchat:mailer'; diff --git a/server/methods/setUserActiveStatus.js b/server/methods/setUserActiveStatus.js index 202f02d39e19..3b52365416fa 100644 --- a/server/methods/setUserActiveStatus.js +++ b/server/methods/setUserActiveStatus.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import * as Mailer from 'meteor/rocketchat:mailer'; Meteor.methods({ diff --git a/server/methods/setUserPassword.js b/server/methods/setUserPassword.js index 7db9f90a3caf..3221f7ec17d7 100644 --- a/server/methods/setUserPassword.js +++ b/server/methods/setUserPassword.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; Meteor.methods({ setUserPassword(password) { diff --git a/server/startup/initialData.js b/server/startup/initialData.js index a502b3112cf1..9d3415bc4ec6 100644 --- a/server/startup/initialData.js +++ b/server/startup/initialData.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Accounts } from 'meteor/accounts-base'; import _ from 'underscore'; Meteor.startup(function() { From 7c997606a704f745a1651345797ed84191174f8f Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Wed, 24 Oct 2018 17:10:18 -0300 Subject: [PATCH 14/34] Remove globals variables Match and check --- .eslintrc | 2 -- packages/meteor-autocomplete/client/autocomplete-client.js | 1 + packages/rocketchat-api/server/v1/chat.js | 1 + packages/rocketchat-api/server/v1/integrations.js | 1 + packages/rocketchat-api/server/v1/misc.js | 1 + packages/rocketchat-api/server/v1/permissions.js | 1 + packages/rocketchat-api/server/v1/roles.js | 1 + packages/rocketchat-api/server/v1/settings.js | 1 + packages/rocketchat-api/server/v1/subscriptions.js | 1 + packages/rocketchat-api/server/v1/users.js | 1 + .../rocketchat-autotranslate/server/methods/saveSettings.js | 1 + .../server/methods/mailMessages.js | 1 + .../server/functions/saveReactWhenReadOnly.js | 1 + .../server/functions/saveRoomAnnouncement.js | 1 + .../server/functions/saveRoomCustomFields.js | 1 + .../server/functions/saveRoomDescription.js | 1 + .../server/functions/saveRoomReadOnly.js | 1 + .../server/functions/saveRoomSystemMessages.js | 1 + .../server/functions/saveRoomTopic.js | 1 + .../server/functions/saveRoomType.js | 1 + .../server/methods/saveRoomSettings.js | 1 + packages/rocketchat-custom-oauth/client/custom_oauth_client.js | 1 + packages/rocketchat-custom-oauth/server/custom_oauth_server.js | 1 + packages/rocketchat-file-upload/lib/FileUpload.js | 1 + .../rocketchat-file-upload/server/methods/sendFileMessage.js | 1 + packages/rocketchat-file-upload/ufs/AmazonS3/server.js | 1 + packages/rocketchat-file-upload/ufs/GoogleStorage/server.js | 1 + packages/rocketchat-file-upload/ufs/Webdav/server.js | 1 + packages/rocketchat-grant/server/settings.js | 2 +- packages/rocketchat-iframe-login/iframe_client.js | 1 + packages/rocketchat-importer/server/methods/prepareImport.js | 1 + packages/rocketchat-integrations/server/lib/validation.js | 1 + packages/rocketchat-lib/client/lib/cachedCollection.js | 1 + packages/rocketchat-lib/client/models/_Base.js | 1 + packages/rocketchat-lib/server/functions/sendMessage.js | 1 + packages/rocketchat-lib/server/methods/addOAuthService.js | 1 + packages/rocketchat-lib/server/methods/addUsersToRoom.js | 1 + packages/rocketchat-lib/server/methods/archiveRoom.js | 1 + packages/rocketchat-lib/server/methods/blockUser.js | 1 + .../rocketchat-lib/server/methods/checkRegistrationSecretURL.js | 1 + .../rocketchat-lib/server/methods/checkUsernameAvailability.js | 1 + packages/rocketchat-lib/server/methods/cleanRoomHistory.js | 1 + packages/rocketchat-lib/server/methods/createChannel.js | 1 + packages/rocketchat-lib/server/methods/createPrivateGroup.js | 1 + packages/rocketchat-lib/server/methods/deleteMessage.js | 1 + packages/rocketchat-lib/server/methods/deleteUserOwnAccount.js | 1 + packages/rocketchat-lib/server/methods/getChannelHistory.js | 1 + packages/rocketchat-lib/server/methods/getRoomJoinCode.js | 1 + packages/rocketchat-lib/server/methods/getRoomRoles.js | 1 + packages/rocketchat-lib/server/methods/getSingleMessage.js | 1 + packages/rocketchat-lib/server/methods/insertOrUpdateUser.js | 1 + packages/rocketchat-lib/server/methods/joinDefaultChannels.js | 1 + packages/rocketchat-lib/server/methods/joinRoom.js | 1 + packages/rocketchat-lib/server/methods/leaveRoom.js | 1 + packages/rocketchat-lib/server/methods/removeOAuthService.js | 1 + packages/rocketchat-lib/server/methods/robotMethods.js | 1 + packages/rocketchat-lib/server/methods/saveSetting.js | 1 + packages/rocketchat-lib/server/methods/sendInvitationEmail.js | 1 + packages/rocketchat-lib/server/methods/sendMessage.js | 1 + packages/rocketchat-lib/server/methods/setAdminStatus.js | 1 + packages/rocketchat-lib/server/methods/setEmail.js | 1 + packages/rocketchat-lib/server/methods/setRealName.js | 1 + packages/rocketchat-lib/server/methods/setUsername.js | 1 + packages/rocketchat-lib/server/methods/unarchiveRoom.js | 1 + packages/rocketchat-lib/server/methods/unblockUser.js | 1 + packages/rocketchat-lib/server/methods/updateMessage.js | 1 + packages/rocketchat-lib/server/models/Messages.js | 1 + packages/rocketchat-lib/server/models/Subscriptions.js | 2 ++ packages/rocketchat-lib/server/models/_Base.js | 1 + packages/rocketchat-lib/server/models/_BaseDb.js | 2 ++ packages/rocketchat-lib/server/oauth/facebook.js | 1 + packages/rocketchat-lib/server/oauth/google.js | 1 + packages/rocketchat-lib/server/oauth/oauth.js | 1 + packages/rocketchat-lib/server/oauth/twitter.js | 1 + packages/rocketchat-livechat/imports/server/rest/departments.js | 2 ++ packages/rocketchat-livechat/imports/server/rest/users.js | 1 + packages/rocketchat-livechat/server/api/v1/agent.js | 1 + packages/rocketchat-livechat/server/api/v1/config.js | 1 + packages/rocketchat-livechat/server/api/v1/customField.js | 1 + packages/rocketchat-livechat/server/api/v1/message.js | 1 + packages/rocketchat-livechat/server/api/v1/offlineMessage.js | 2 ++ packages/rocketchat-livechat/server/api/v1/pageVisited.js | 1 + packages/rocketchat-livechat/server/api/v1/room.js | 1 + packages/rocketchat-livechat/server/api/v1/transcript.js | 2 ++ packages/rocketchat-livechat/server/api/v1/videoCall.js | 1 + packages/rocketchat-livechat/server/api/v1/visitor.js | 1 + packages/rocketchat-livechat/server/lib/Livechat.js | 1 + packages/rocketchat-livechat/server/methods/getAgentData.js | 1 + packages/rocketchat-livechat/server/methods/getNextAgent.js | 1 + .../rocketchat-livechat/server/methods/removeCustomField.js | 1 + packages/rocketchat-livechat/server/methods/removeTrigger.js | 1 + packages/rocketchat-livechat/server/methods/saveCustomField.js | 1 + packages/rocketchat-livechat/server/methods/saveInfo.js | 1 + .../rocketchat-livechat/server/methods/saveSurveyFeedback.js | 1 + packages/rocketchat-livechat/server/methods/saveTrigger.js | 1 + .../server/methods/sendFileLivechatMessage.js | 1 + .../rocketchat-livechat/server/methods/sendMessageLivechat.js | 1 + .../rocketchat-livechat/server/methods/sendOfflineMessage.js | 1 + packages/rocketchat-livechat/server/methods/sendTranscript.js | 1 + .../server/methods/setDepartmentForVisitor.js | 1 + packages/rocketchat-livechat/server/methods/transfer.js | 1 + .../server/publications/livechatMonitoring.js | 1 + .../rocketchat-livechat/server/publications/livechatRooms.js | 1 + .../rocketchat-livechat/server/publications/livechatVisitors.js | 1 + .../server/functions/saveStreamingOptions.js | 1 + packages/rocketchat-logger/client/viewLogs.js | 1 + .../server/methods/getUserMentionsByChannel.js | 1 + packages/rocketchat-migrations/migrations.js | 1 + .../server/methods/saveNotificationSettings.js | 1 + .../rocketchat-slackbridge/server/slackbridge_import.server.js | 1 + packages/rocketchat-slashcommands-archiveroom/server/server.js | 1 + packages/rocketchat-slashcommands-create/server/server.js | 1 + packages/rocketchat-slashcommands-hide/server/hide.js | 1 + packages/rocketchat-slashcommands-invite/server/server.js | 1 + packages/rocketchat-slashcommands-inviteall/server/server.js | 1 + packages/rocketchat-slashcommands-join/server/server.js | 1 + packages/rocketchat-slashcommands-kick/server/server.js | 1 + packages/rocketchat-slashcommands-msg/server.js | 1 + packages/rocketchat-slashcommands-mute/server/mute.js | 1 + packages/rocketchat-slashcommands-mute/server/unmute.js | 1 + packages/rocketchat-slashcommands-open/client/client.js | 1 + .../rocketchat-slashcommands-unarchiveroom/server/server.js | 1 + .../rocketchat-tokenpass/server/functions/saveRoomTokens.js | 1 + .../server/functions/saveRoomTokensMinimumBalance.js | 1 + .../rocketchat-tokenpass/server/methods/getChannelTokenpass.js | 1 + packages/rocketchat-ui-master/client/main.js | 1 + packages/rocketchat-webdav/server/methods/addWebdavAccount.js | 1 + .../rocketchat-webdav/server/methods/removeWebdavAccount.js | 1 + server/lib/accounts.js | 1 + server/methods/addAllUserToRoom.js | 1 + server/methods/addRoomLeader.js | 1 + server/methods/addRoomModerator.js | 1 + server/methods/addRoomOwner.js | 1 + server/methods/canAccessRoom.js | 1 + server/methods/channelsList.js | 1 + server/methods/createDirectMessage.js | 1 + server/methods/deleteFileMessage.js | 1 + server/methods/deleteUser.js | 1 + server/methods/eraseRoom.js | 1 + server/methods/getAvatarSuggestion.js | 1 + server/methods/getRoomIdByNameOrId.js | 1 + server/methods/getRoomNameById.js | 1 + server/methods/getUsernameSuggestion.js | 1 + server/methods/hideRoom.js | 1 + server/methods/ignoreUser.js | 1 + server/methods/loadHistory.js | 1 + server/methods/loadLocale.js | 1 + server/methods/loadMissedMessages.js | 1 + server/methods/loadNextMessages.js | 1 + server/methods/loadSurroundingMessages.js | 1 + server/methods/logoutCleanUp.js | 1 + server/methods/messageSearch.js | 1 + server/methods/migrate.js | 1 + server/methods/muteUserInRoom.js | 1 + server/methods/openRoom.js | 1 + server/methods/readMessages.js | 1 + server/methods/registerUser.js | 1 + server/methods/removeRoomLeader.js | 1 + server/methods/removeRoomModerator.js | 1 + server/methods/removeRoomOwner.js | 1 + server/methods/removeUserFromRoom.js | 1 + server/methods/reportMessage.js | 1 + server/methods/roomNameExists.js | 1 + server/methods/saveUserPreferences.js | 1 + server/methods/saveUserProfile.js | 1 + server/methods/sendConfirmationEmail.js | 1 + server/methods/sendForgotPasswordEmail.js | 1 + server/methods/setAvatarFromService.js | 1 + server/methods/setUserActiveStatus.js | 1 + server/methods/setUserPassword.js | 1 + server/methods/toogleFavorite.js | 1 + server/methods/unmuteUserInRoom.js | 1 + server/methods/userSetUtcOffset.js | 1 + server/publications/messages.js | 1 + server/startup/migrations/v099.js | 1 + server/stream/streamBroadcast.js | 1 + 176 files changed, 180 insertions(+), 3 deletions(-) diff --git a/.eslintrc b/.eslintrc index 4142562873ce..26ba65dbac72 100644 --- a/.eslintrc +++ b/.eslintrc @@ -14,7 +14,6 @@ "ChatMessages" : false, "ChatRoom" : false, "ChatSubscription" : false, - "check" : false, "CryptoJS" : false, "Department" : false, "DDPRateLimiter" : false, @@ -31,7 +30,6 @@ "LivechatPageVisited" : false, "LivechatTrigger" : false, "Logger" : false, - "Match" : false, "modal" : false, "moment" : false, "Mongo" : false, diff --git a/packages/meteor-autocomplete/client/autocomplete-client.js b/packages/meteor-autocomplete/client/autocomplete-client.js index 2b325130d2b3..a861d5289a5b 100755 --- a/packages/meteor-autocomplete/client/autocomplete-client.js +++ b/packages/meteor-autocomplete/client/autocomplete-client.js @@ -1,5 +1,6 @@ /* globals Deps, getCaretCoordinates*/ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import _ from 'underscore'; import AutoCompleteRecords from './collection'; diff --git a/packages/rocketchat-api/server/v1/chat.js b/packages/rocketchat-api/server/v1/chat.js index 0d41305f9983..853c0608c8e5 100644 --- a/packages/rocketchat-api/server/v1/chat.js +++ b/packages/rocketchat-api/server/v1/chat.js @@ -1,5 +1,6 @@ /* global processWebhookMessage */ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; RocketChat.API.v1.addRoute('chat.delete', { authRequired: true }, { post() { diff --git a/packages/rocketchat-api/server/v1/integrations.js b/packages/rocketchat-api/server/v1/integrations.js index d300552e0fea..116b4269f08c 100644 --- a/packages/rocketchat-api/server/v1/integrations.js +++ b/packages/rocketchat-api/server/v1/integrations.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; RocketChat.API.v1.addRoute('integrations.create', { authRequired: true }, { post() { diff --git a/packages/rocketchat-api/server/v1/misc.js b/packages/rocketchat-api/server/v1/misc.js index d9e3df836533..14c4583227e8 100644 --- a/packages/rocketchat-api/server/v1/misc.js +++ b/packages/rocketchat-api/server/v1/misc.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; RocketChat.API.v1.addRoute('info', { authRequired: false }, { get() { diff --git a/packages/rocketchat-api/server/v1/permissions.js b/packages/rocketchat-api/server/v1/permissions.js index ad75c37855ea..9b74b41e7756 100644 --- a/packages/rocketchat-api/server/v1/permissions.js +++ b/packages/rocketchat-api/server/v1/permissions.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; /** This API returns all permissions that exists diff --git a/packages/rocketchat-api/server/v1/roles.js b/packages/rocketchat-api/server/v1/roles.js index 988c1523312c..034b5f41bc96 100644 --- a/packages/rocketchat-api/server/v1/roles.js +++ b/packages/rocketchat-api/server/v1/roles.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; RocketChat.API.v1.addRoute('roles.list', { authRequired: true }, { get() { diff --git a/packages/rocketchat-api/server/v1/settings.js b/packages/rocketchat-api/server/v1/settings.js index b67bfdfeb6de..a4ef4fdaa44b 100644 --- a/packages/rocketchat-api/server/v1/settings.js +++ b/packages/rocketchat-api/server/v1/settings.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import _ from 'underscore'; // settings endpoints diff --git a/packages/rocketchat-api/server/v1/subscriptions.js b/packages/rocketchat-api/server/v1/subscriptions.js index 7d1cf75507ff..e04348702a8e 100644 --- a/packages/rocketchat-api/server/v1/subscriptions.js +++ b/packages/rocketchat-api/server/v1/subscriptions.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; RocketChat.API.v1.addRoute('subscriptions.get', { authRequired: true }, { get() { diff --git a/packages/rocketchat-api/server/v1/users.js b/packages/rocketchat-api/server/v1/users.js index 88642100e9d2..88a6dadb2aee 100644 --- a/packages/rocketchat-api/server/v1/users.js +++ b/packages/rocketchat-api/server/v1/users.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import _ from 'underscore'; import Busboy from 'busboy'; diff --git a/packages/rocketchat-autotranslate/server/methods/saveSettings.js b/packages/rocketchat-autotranslate/server/methods/saveSettings.js index 4a05412d297b..d070189801e1 100644 --- a/packages/rocketchat-autotranslate/server/methods/saveSettings.js +++ b/packages/rocketchat-autotranslate/server/methods/saveSettings.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ 'autoTranslate.saveSettings'(rid, field, value, options) { diff --git a/packages/rocketchat-channel-settings-mail-messages/server/methods/mailMessages.js b/packages/rocketchat-channel-settings-mail-messages/server/methods/mailMessages.js index 9e404a03bbf5..90b758f21a9a 100644 --- a/packages/rocketchat-channel-settings-mail-messages/server/methods/mailMessages.js +++ b/packages/rocketchat-channel-settings-mail-messages/server/methods/mailMessages.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import _ from 'underscore'; import moment from 'moment'; import * as Mailer from 'meteor/rocketchat:mailer'; diff --git a/packages/rocketchat-channel-settings/server/functions/saveReactWhenReadOnly.js b/packages/rocketchat-channel-settings/server/functions/saveReactWhenReadOnly.js index 9ca9cea84cae..1d6a39572c5a 100644 --- a/packages/rocketchat-channel-settings/server/functions/saveReactWhenReadOnly.js +++ b/packages/rocketchat-channel-settings/server/functions/saveReactWhenReadOnly.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; RocketChat.saveReactWhenReadOnly = function(rid, allowReact) { if (!Match.test(rid, String)) { diff --git a/packages/rocketchat-channel-settings/server/functions/saveRoomAnnouncement.js b/packages/rocketchat-channel-settings/server/functions/saveRoomAnnouncement.js index 6335d845a0de..af039e578d9f 100644 --- a/packages/rocketchat-channel-settings/server/functions/saveRoomAnnouncement.js +++ b/packages/rocketchat-channel-settings/server/functions/saveRoomAnnouncement.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; RocketChat.saveRoomAnnouncement = function(rid, roomAnnouncement, user, sendMessage = true) { if (!Match.test(rid, String)) { diff --git a/packages/rocketchat-channel-settings/server/functions/saveRoomCustomFields.js b/packages/rocketchat-channel-settings/server/functions/saveRoomCustomFields.js index a29474ad1e7d..0904b8df0be5 100644 --- a/packages/rocketchat-channel-settings/server/functions/saveRoomCustomFields.js +++ b/packages/rocketchat-channel-settings/server/functions/saveRoomCustomFields.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; RocketChat.saveRoomCustomFields = function(rid, roomCustomFields) { if (!Match.test(rid, String)) { diff --git a/packages/rocketchat-channel-settings/server/functions/saveRoomDescription.js b/packages/rocketchat-channel-settings/server/functions/saveRoomDescription.js index 8ae6a4776505..fef1be51df1f 100644 --- a/packages/rocketchat-channel-settings/server/functions/saveRoomDescription.js +++ b/packages/rocketchat-channel-settings/server/functions/saveRoomDescription.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; RocketChat.saveRoomDescription = function(rid, roomDescription, user) { if (!Match.test(rid, String)) { diff --git a/packages/rocketchat-channel-settings/server/functions/saveRoomReadOnly.js b/packages/rocketchat-channel-settings/server/functions/saveRoomReadOnly.js index ccecee598ddf..d6bcd8f379a1 100644 --- a/packages/rocketchat-channel-settings/server/functions/saveRoomReadOnly.js +++ b/packages/rocketchat-channel-settings/server/functions/saveRoomReadOnly.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; RocketChat.saveRoomReadOnly = function(rid, readOnly) { if (!Match.test(rid, String)) { diff --git a/packages/rocketchat-channel-settings/server/functions/saveRoomSystemMessages.js b/packages/rocketchat-channel-settings/server/functions/saveRoomSystemMessages.js index aa0b5597c405..be89b765505b 100644 --- a/packages/rocketchat-channel-settings/server/functions/saveRoomSystemMessages.js +++ b/packages/rocketchat-channel-settings/server/functions/saveRoomSystemMessages.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; RocketChat.saveRoomSystemMessages = function(rid, systemMessages) { if (!Match.test(rid, String)) { diff --git a/packages/rocketchat-channel-settings/server/functions/saveRoomTopic.js b/packages/rocketchat-channel-settings/server/functions/saveRoomTopic.js index 431156a10fa8..a315880273d4 100644 --- a/packages/rocketchat-channel-settings/server/functions/saveRoomTopic.js +++ b/packages/rocketchat-channel-settings/server/functions/saveRoomTopic.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; RocketChat.saveRoomTopic = function(rid, roomTopic, user, sendMessage = true) { if (!Match.test(rid, String)) { diff --git a/packages/rocketchat-channel-settings/server/functions/saveRoomType.js b/packages/rocketchat-channel-settings/server/functions/saveRoomType.js index 6a35ba6b2d81..e407e56655ba 100644 --- a/packages/rocketchat-channel-settings/server/functions/saveRoomType.js +++ b/packages/rocketchat-channel-settings/server/functions/saveRoomType.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; RocketChat.saveRoomType = function(rid, roomType, user, sendMessage = true) { if (!Match.test(rid, String)) { diff --git a/packages/rocketchat-channel-settings/server/methods/saveRoomSettings.js b/packages/rocketchat-channel-settings/server/methods/saveRoomSettings.js index 77906a857c4e..91ced595653e 100644 --- a/packages/rocketchat-channel-settings/server/methods/saveRoomSettings.js +++ b/packages/rocketchat-channel-settings/server/methods/saveRoomSettings.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; const fields = ['roomName', 'roomTopic', 'roomAnnouncement', 'roomCustomFields', 'roomDescription', 'roomType', 'readOnly', 'reactWhenReadOnly', 'systemMessages', 'default', 'joinCode', 'tokenpass', 'streamingOptions', 'retentionEnabled', 'retentionMaxAge', 'retentionExcludePinned', 'retentionFilesOnly', 'retentionOverrideGlobal', 'encrypted']; Meteor.methods({ diff --git a/packages/rocketchat-custom-oauth/client/custom_oauth_client.js b/packages/rocketchat-custom-oauth/client/custom_oauth_client.js index f93ee32782d2..bf2fa7ab3064 100644 --- a/packages/rocketchat-custom-oauth/client/custom_oauth_client.js +++ b/packages/rocketchat-custom-oauth/client/custom_oauth_client.js @@ -1,5 +1,6 @@ /* globals OAuth*/ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import { Accounts } from 'meteor/accounts-base'; import { Random } from 'meteor/random'; import s from 'underscore.string'; diff --git a/packages/rocketchat-custom-oauth/server/custom_oauth_server.js b/packages/rocketchat-custom-oauth/server/custom_oauth_server.js index e0c5ba09c758..75c82b1a8d79 100644 --- a/packages/rocketchat-custom-oauth/server/custom_oauth_server.js +++ b/packages/rocketchat-custom-oauth/server/custom_oauth_server.js @@ -1,5 +1,6 @@ /* globals OAuth*/ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import { Accounts } from 'meteor/accounts-base'; import { HTTP } from 'meteor/http'; import _ from 'underscore'; diff --git a/packages/rocketchat-file-upload/lib/FileUpload.js b/packages/rocketchat-file-upload/lib/FileUpload.js index d2e03b1264a9..5a44f10e3369 100644 --- a/packages/rocketchat-file-upload/lib/FileUpload.js +++ b/packages/rocketchat-file-upload/lib/FileUpload.js @@ -2,6 +2,7 @@ /* exported FileUpload */ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import filesize from 'filesize'; let maxFileSize = 0; diff --git a/packages/rocketchat-file-upload/server/methods/sendFileMessage.js b/packages/rocketchat-file-upload/server/methods/sendFileMessage.js index 900a8ac214c1..133ff88bcda7 100644 --- a/packages/rocketchat-file-upload/server/methods/sendFileMessage.js +++ b/packages/rocketchat-file-upload/server/methods/sendFileMessage.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import { Random } from 'meteor/random'; import _ from 'underscore'; diff --git a/packages/rocketchat-file-upload/ufs/AmazonS3/server.js b/packages/rocketchat-file-upload/ufs/AmazonS3/server.js index db850f5ab171..b1442e07c925 100644 --- a/packages/rocketchat-file-upload/ufs/AmazonS3/server.js +++ b/packages/rocketchat-file-upload/ufs/AmazonS3/server.js @@ -1,3 +1,4 @@ +import { check } from 'meteor/check'; import { UploadFS } from 'meteor/jalik:ufs'; import { Random } from 'meteor/random'; import _ from 'underscore'; diff --git a/packages/rocketchat-file-upload/ufs/GoogleStorage/server.js b/packages/rocketchat-file-upload/ufs/GoogleStorage/server.js index 7fdb3e8ea397..8baa788ba6bc 100644 --- a/packages/rocketchat-file-upload/ufs/GoogleStorage/server.js +++ b/packages/rocketchat-file-upload/ufs/GoogleStorage/server.js @@ -1,3 +1,4 @@ +import { check } from 'meteor/check'; import { UploadFS } from 'meteor/jalik:ufs'; import { Random } from 'meteor/random'; import gcStorage from '@google-cloud/storage'; diff --git a/packages/rocketchat-file-upload/ufs/Webdav/server.js b/packages/rocketchat-file-upload/ufs/Webdav/server.js index ede964e158e6..1b56620a8926 100644 --- a/packages/rocketchat-file-upload/ufs/Webdav/server.js +++ b/packages/rocketchat-file-upload/ufs/Webdav/server.js @@ -1,3 +1,4 @@ +import { check } from 'meteor/check'; import { UploadFS } from 'meteor/jalik:ufs'; import { Random } from 'meteor/random'; import Webdav from 'webdav'; diff --git a/packages/rocketchat-grant/server/settings.js b/packages/rocketchat-grant/server/settings.js index 4a8664a56c29..2d426a614ed2 100644 --- a/packages/rocketchat-grant/server/settings.js +++ b/packages/rocketchat-grant/server/settings.js @@ -1,4 +1,4 @@ -import { check } from 'meteor/check'; +import { Match, check } from 'meteor/check'; import { Storage } from './storage'; diff --git a/packages/rocketchat-iframe-login/iframe_client.js b/packages/rocketchat-iframe-login/iframe_client.js index addb273fc868..1de83f541cac 100644 --- a/packages/rocketchat-iframe-login/iframe_client.js +++ b/packages/rocketchat-iframe-login/iframe_client.js @@ -1,6 +1,7 @@ /* globals Accounts, Tracker, ReactiveVar, FlowRouter, Accounts, HTTP, facebookConnectPlugin, TwitterConnect, OAuth */ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import _ from 'underscore'; const { _unstoreLoginToken } = Accounts; diff --git a/packages/rocketchat-importer/server/methods/prepareImport.js b/packages/rocketchat-importer/server/methods/prepareImport.js index 23dc03174876..0af27cb1e032 100644 --- a/packages/rocketchat-importer/server/methods/prepareImport.js +++ b/packages/rocketchat-importer/server/methods/prepareImport.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import { Importers } from 'meteor/rocketchat:importer'; Meteor.methods({ diff --git a/packages/rocketchat-integrations/server/lib/validation.js b/packages/rocketchat-integrations/server/lib/validation.js index 5b698104a984..df8abd749720 100644 --- a/packages/rocketchat-integrations/server/lib/validation.js +++ b/packages/rocketchat-integrations/server/lib/validation.js @@ -1,5 +1,6 @@ /* global Babel */ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import _ from 'underscore'; import s from 'underscore.string'; const scopedChannels = ['all_public_channels', 'all_private_groups', 'all_direct_messages']; diff --git a/packages/rocketchat-lib/client/lib/cachedCollection.js b/packages/rocketchat-lib/client/lib/cachedCollection.js index 24a07fbadbf0..1ef68ebd035c 100644 --- a/packages/rocketchat-lib/client/lib/cachedCollection.js +++ b/packages/rocketchat-lib/client/lib/cachedCollection.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import { Accounts } from 'meteor/accounts-base'; import { ReactiveVar } from 'meteor/reactive-var'; import localforage from 'localforage'; diff --git a/packages/rocketchat-lib/client/models/_Base.js b/packages/rocketchat-lib/client/models/_Base.js index 203a38597030..fc43e3b0924e 100644 --- a/packages/rocketchat-lib/client/models/_Base.js +++ b/packages/rocketchat-lib/client/models/_Base.js @@ -1,3 +1,4 @@ +import { check } from 'meteor/check'; RocketChat.models._Base = class { _baseName() { diff --git a/packages/rocketchat-lib/server/functions/sendMessage.js b/packages/rocketchat-lib/server/functions/sendMessage.js index 504d8a4a1092..4a5218e7ad65 100644 --- a/packages/rocketchat-lib/server/functions/sendMessage.js +++ b/packages/rocketchat-lib/server/functions/sendMessage.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; const objectMaybeIncluding = (types) => Match.Where((value) => { Object.keys(types).forEach((field) => { diff --git a/packages/rocketchat-lib/server/methods/addOAuthService.js b/packages/rocketchat-lib/server/methods/addOAuthService.js index 10b3a570ac0a..75e3d28d085e 100644 --- a/packages/rocketchat-lib/server/methods/addOAuthService.js +++ b/packages/rocketchat-lib/server/methods/addOAuthService.js @@ -1,6 +1,7 @@ /* eslint no-multi-spaces: 0 */ /* eslint comma-spacing: 0 */ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import s from 'underscore.string'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/methods/addUsersToRoom.js b/packages/rocketchat-lib/server/methods/addUsersToRoom.js index 5dae0b5ada50..cd75a356ecea 100644 --- a/packages/rocketchat-lib/server/methods/addUsersToRoom.js +++ b/packages/rocketchat-lib/server/methods/addUsersToRoom.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; Meteor.methods({ addUsersToRoom(data = {}) { diff --git a/packages/rocketchat-lib/server/methods/archiveRoom.js b/packages/rocketchat-lib/server/methods/archiveRoom.js index cc725c11611f..217fd59e39a1 100644 --- a/packages/rocketchat-lib/server/methods/archiveRoom.js +++ b/packages/rocketchat-lib/server/methods/archiveRoom.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ archiveRoom(rid) { diff --git a/packages/rocketchat-lib/server/methods/blockUser.js b/packages/rocketchat-lib/server/methods/blockUser.js index 957413911059..fd771a1dce68 100644 --- a/packages/rocketchat-lib/server/methods/blockUser.js +++ b/packages/rocketchat-lib/server/methods/blockUser.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ blockUser({ rid, blocked }) { diff --git a/packages/rocketchat-lib/server/methods/checkRegistrationSecretURL.js b/packages/rocketchat-lib/server/methods/checkRegistrationSecretURL.js index e996a7d503a5..96739aa7f87d 100644 --- a/packages/rocketchat-lib/server/methods/checkRegistrationSecretURL.js +++ b/packages/rocketchat-lib/server/methods/checkRegistrationSecretURL.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ checkRegistrationSecretURL(hash) { diff --git a/packages/rocketchat-lib/server/methods/checkUsernameAvailability.js b/packages/rocketchat-lib/server/methods/checkUsernameAvailability.js index 28cce1f0d9bd..302b02647b77 100644 --- a/packages/rocketchat-lib/server/methods/checkUsernameAvailability.js +++ b/packages/rocketchat-lib/server/methods/checkUsernameAvailability.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ checkUsernameAvailability(username) { diff --git a/packages/rocketchat-lib/server/methods/cleanRoomHistory.js b/packages/rocketchat-lib/server/methods/cleanRoomHistory.js index c2ae1ad78ab4..506091149fc6 100644 --- a/packages/rocketchat-lib/server/methods/cleanRoomHistory.js +++ b/packages/rocketchat-lib/server/methods/cleanRoomHistory.js @@ -1,5 +1,6 @@ /* globals FileUpload */ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; Meteor.methods({ cleanRoomHistory({ roomId, latest, oldest, inclusive = true, limit, excludePinned = false, filesOnly = false, fromUsers = [] }) { diff --git a/packages/rocketchat-lib/server/methods/createChannel.js b/packages/rocketchat-lib/server/methods/createChannel.js index fee80fdd4e58..df5b722cd407 100644 --- a/packages/rocketchat-lib/server/methods/createChannel.js +++ b/packages/rocketchat-lib/server/methods/createChannel.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; Meteor.methods({ createChannel(name, members, readOnly = false, customFields = {}, extraData = {}) { diff --git a/packages/rocketchat-lib/server/methods/createPrivateGroup.js b/packages/rocketchat-lib/server/methods/createPrivateGroup.js index 7f40cf14f141..cc75b89b5ef0 100644 --- a/packages/rocketchat-lib/server/methods/createPrivateGroup.js +++ b/packages/rocketchat-lib/server/methods/createPrivateGroup.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; Meteor.methods({ createPrivateGroup(name, members, readOnly = false, customFields = {}, extraData = {}) { diff --git a/packages/rocketchat-lib/server/methods/deleteMessage.js b/packages/rocketchat-lib/server/methods/deleteMessage.js index 928c59505878..31e6c6b3300d 100644 --- a/packages/rocketchat-lib/server/methods/deleteMessage.js +++ b/packages/rocketchat-lib/server/methods/deleteMessage.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import moment from 'moment'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/methods/deleteUserOwnAccount.js b/packages/rocketchat-lib/server/methods/deleteUserOwnAccount.js index 06a7ba4ad9b7..3d197e11cd04 100644 --- a/packages/rocketchat-lib/server/methods/deleteUserOwnAccount.js +++ b/packages/rocketchat-lib/server/methods/deleteUserOwnAccount.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import { Accounts } from 'meteor/accounts-base'; import s from 'underscore.string'; diff --git a/packages/rocketchat-lib/server/methods/getChannelHistory.js b/packages/rocketchat-lib/server/methods/getChannelHistory.js index 448133c7183b..9a551021f22d 100644 --- a/packages/rocketchat-lib/server/methods/getChannelHistory.js +++ b/packages/rocketchat-lib/server/methods/getChannelHistory.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import _ from 'underscore'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/methods/getRoomJoinCode.js b/packages/rocketchat-lib/server/methods/getRoomJoinCode.js index af4dd9515c97..2b2da233bf39 100644 --- a/packages/rocketchat-lib/server/methods/getRoomJoinCode.js +++ b/packages/rocketchat-lib/server/methods/getRoomJoinCode.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ getRoomJoinCode(rid) { diff --git a/packages/rocketchat-lib/server/methods/getRoomRoles.js b/packages/rocketchat-lib/server/methods/getRoomRoles.js index e05bb281657a..3a79f1551ddb 100644 --- a/packages/rocketchat-lib/server/methods/getRoomRoles.js +++ b/packages/rocketchat-lib/server/methods/getRoomRoles.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import _ from 'underscore'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/methods/getSingleMessage.js b/packages/rocketchat-lib/server/methods/getSingleMessage.js index e6c179a39d74..3317f03d3154 100644 --- a/packages/rocketchat-lib/server/methods/getSingleMessage.js +++ b/packages/rocketchat-lib/server/methods/getSingleMessage.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ getSingleMessage(msgId) { diff --git a/packages/rocketchat-lib/server/methods/insertOrUpdateUser.js b/packages/rocketchat-lib/server/methods/insertOrUpdateUser.js index 16a449b81204..c024e6ee242d 100644 --- a/packages/rocketchat-lib/server/methods/insertOrUpdateUser.js +++ b/packages/rocketchat-lib/server/methods/insertOrUpdateUser.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ insertOrUpdateUser(userData) { diff --git a/packages/rocketchat-lib/server/methods/joinDefaultChannels.js b/packages/rocketchat-lib/server/methods/joinDefaultChannels.js index 835e41d09f73..4e309f1d217a 100644 --- a/packages/rocketchat-lib/server/methods/joinDefaultChannels.js +++ b/packages/rocketchat-lib/server/methods/joinDefaultChannels.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; Meteor.methods({ joinDefaultChannels(silenced) { diff --git a/packages/rocketchat-lib/server/methods/joinRoom.js b/packages/rocketchat-lib/server/methods/joinRoom.js index 4d1416409c0c..fa75daabd992 100644 --- a/packages/rocketchat-lib/server/methods/joinRoom.js +++ b/packages/rocketchat-lib/server/methods/joinRoom.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ joinRoom(rid, code) { diff --git a/packages/rocketchat-lib/server/methods/leaveRoom.js b/packages/rocketchat-lib/server/methods/leaveRoom.js index 42e8733411c5..b7fe5324ada9 100644 --- a/packages/rocketchat-lib/server/methods/leaveRoom.js +++ b/packages/rocketchat-lib/server/methods/leaveRoom.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ leaveRoom(rid) { diff --git a/packages/rocketchat-lib/server/methods/removeOAuthService.js b/packages/rocketchat-lib/server/methods/removeOAuthService.js index 704dce2954e5..86ae0a11abe1 100644 --- a/packages/rocketchat-lib/server/methods/removeOAuthService.js +++ b/packages/rocketchat-lib/server/methods/removeOAuthService.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import s from 'underscore.string'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/methods/robotMethods.js b/packages/rocketchat-lib/server/methods/robotMethods.js index dca1f92cbcc2..a47fe562bd51 100644 --- a/packages/rocketchat-lib/server/methods/robotMethods.js +++ b/packages/rocketchat-lib/server/methods/robotMethods.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import _ from 'underscore'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/methods/saveSetting.js b/packages/rocketchat-lib/server/methods/saveSetting.js index 04f891f967ef..ae0817c389e4 100644 --- a/packages/rocketchat-lib/server/methods/saveSetting.js +++ b/packages/rocketchat-lib/server/methods/saveSetting.js @@ -1,5 +1,6 @@ /* eslint new-cap: 0 */ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; Meteor.methods({ saveSetting(_id, value, editor) { diff --git a/packages/rocketchat-lib/server/methods/sendInvitationEmail.js b/packages/rocketchat-lib/server/methods/sendInvitationEmail.js index 6dc9c0236966..1605855a812b 100644 --- a/packages/rocketchat-lib/server/methods/sendInvitationEmail.js +++ b/packages/rocketchat-lib/server/methods/sendInvitationEmail.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import * as Mailer from 'meteor/rocketchat:mailer'; let html = ''; diff --git a/packages/rocketchat-lib/server/methods/sendMessage.js b/packages/rocketchat-lib/server/methods/sendMessage.js index 5844d3d7697e..b888669b19c3 100644 --- a/packages/rocketchat-lib/server/methods/sendMessage.js +++ b/packages/rocketchat-lib/server/methods/sendMessage.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import { Random } from 'meteor/random'; import moment from 'moment'; diff --git a/packages/rocketchat-lib/server/methods/setAdminStatus.js b/packages/rocketchat-lib/server/methods/setAdminStatus.js index af2deea01945..00a79d2f199e 100644 --- a/packages/rocketchat-lib/server/methods/setAdminStatus.js +++ b/packages/rocketchat-lib/server/methods/setAdminStatus.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; Meteor.methods({ setAdminStatus(userId, admin) { diff --git a/packages/rocketchat-lib/server/methods/setEmail.js b/packages/rocketchat-lib/server/methods/setEmail.js index f0e8aac4e164..7d13ad2bc81f 100644 --- a/packages/rocketchat-lib/server/methods/setEmail.js +++ b/packages/rocketchat-lib/server/methods/setEmail.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ setEmail(email) { diff --git a/packages/rocketchat-lib/server/methods/setRealName.js b/packages/rocketchat-lib/server/methods/setRealName.js index ffbba773999f..bd1ddfd430ae 100644 --- a/packages/rocketchat-lib/server/methods/setRealName.js +++ b/packages/rocketchat-lib/server/methods/setRealName.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ setRealName(name) { diff --git a/packages/rocketchat-lib/server/methods/setUsername.js b/packages/rocketchat-lib/server/methods/setUsername.js index ca5ba332f3d7..4c6fb84eddc9 100644 --- a/packages/rocketchat-lib/server/methods/setUsername.js +++ b/packages/rocketchat-lib/server/methods/setUsername.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import _ from 'underscore'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/methods/unarchiveRoom.js b/packages/rocketchat-lib/server/methods/unarchiveRoom.js index 3028d09263e3..975c3162c938 100644 --- a/packages/rocketchat-lib/server/methods/unarchiveRoom.js +++ b/packages/rocketchat-lib/server/methods/unarchiveRoom.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ unarchiveRoom(rid) { diff --git a/packages/rocketchat-lib/server/methods/unblockUser.js b/packages/rocketchat-lib/server/methods/unblockUser.js index b04ccca58a20..21c8895e9283 100644 --- a/packages/rocketchat-lib/server/methods/unblockUser.js +++ b/packages/rocketchat-lib/server/methods/unblockUser.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ unblockUser({ rid, blocked }) { diff --git a/packages/rocketchat-lib/server/methods/updateMessage.js b/packages/rocketchat-lib/server/methods/updateMessage.js index 9ce9bb028280..f2769e629ab3 100644 --- a/packages/rocketchat-lib/server/methods/updateMessage.js +++ b/packages/rocketchat-lib/server/methods/updateMessage.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import moment from 'moment'; Meteor.methods({ diff --git a/packages/rocketchat-lib/server/models/Messages.js b/packages/rocketchat-lib/server/models/Messages.js index 970867400b66..bc11062fa660 100644 --- a/packages/rocketchat-lib/server/models/Messages.js +++ b/packages/rocketchat-lib/server/models/Messages.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import _ from 'underscore'; RocketChat.models.Messages = new class extends RocketChat.models._Base { diff --git a/packages/rocketchat-lib/server/models/Subscriptions.js b/packages/rocketchat-lib/server/models/Subscriptions.js index 0c413020da87..6b4728a7ead5 100644 --- a/packages/rocketchat-lib/server/models/Subscriptions.js +++ b/packages/rocketchat-lib/server/models/Subscriptions.js @@ -1,3 +1,5 @@ +import { Match } from 'meteor/check'; + class ModelSubscriptions extends RocketChat.models._Base { constructor(...args) { super(...args); diff --git a/packages/rocketchat-lib/server/models/_Base.js b/packages/rocketchat-lib/server/models/_Base.js index 18e7c471aa1d..5183d1f0e4ed 100644 --- a/packages/rocketchat-lib/server/models/_Base.js +++ b/packages/rocketchat-lib/server/models/_Base.js @@ -1,3 +1,4 @@ +import { check } from 'meteor/check'; import ModelsBaseDb from './_BaseDb'; import objectPath from 'object-path'; import _ from 'underscore'; diff --git a/packages/rocketchat-lib/server/models/_BaseDb.js b/packages/rocketchat-lib/server/models/_BaseDb.js index 9bf6e6e1102d..ede844222268 100644 --- a/packages/rocketchat-lib/server/models/_BaseDb.js +++ b/packages/rocketchat-lib/server/models/_BaseDb.js @@ -1,4 +1,6 @@ /* globals MongoInternals */ +import { Match } from 'meteor/check'; +import { Mongo } from 'meteor/mongo'; import _ from 'underscore'; const baseName = 'rocketchat_'; diff --git a/packages/rocketchat-lib/server/oauth/facebook.js b/packages/rocketchat-lib/server/oauth/facebook.js index 7f1bf4ab13ce..0bb04873083d 100644 --- a/packages/rocketchat-lib/server/oauth/facebook.js +++ b/packages/rocketchat-lib/server/oauth/facebook.js @@ -1,3 +1,4 @@ +import { Match, check } from 'meteor/check'; import _ from 'underscore'; import { OAuth } from 'meteor/oauth'; import { HTTP } from 'meteor/http'; diff --git a/packages/rocketchat-lib/server/oauth/google.js b/packages/rocketchat-lib/server/oauth/google.js index 068a288ddc2d..7da5f80d4f59 100644 --- a/packages/rocketchat-lib/server/oauth/google.js +++ b/packages/rocketchat-lib/server/oauth/google.js @@ -1,4 +1,5 @@ /* globals Google */ +import { Match, check } from 'meteor/check'; import _ from 'underscore'; import { HTTP } from 'meteor/http'; diff --git a/packages/rocketchat-lib/server/oauth/oauth.js b/packages/rocketchat-lib/server/oauth/oauth.js index 49762204713c..201c51474e24 100644 --- a/packages/rocketchat-lib/server/oauth/oauth.js +++ b/packages/rocketchat-lib/server/oauth/oauth.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import { Accounts } from 'meteor/accounts-base'; import _ from 'underscore'; diff --git a/packages/rocketchat-lib/server/oauth/twitter.js b/packages/rocketchat-lib/server/oauth/twitter.js index 1c542b1d8e7e..38d1bd9cb30a 100644 --- a/packages/rocketchat-lib/server/oauth/twitter.js +++ b/packages/rocketchat-lib/server/oauth/twitter.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import Twit from 'twit'; import _ from 'underscore'; diff --git a/packages/rocketchat-livechat/imports/server/rest/departments.js b/packages/rocketchat-livechat/imports/server/rest/departments.js index e5227b76af79..496eb683723b 100644 --- a/packages/rocketchat-livechat/imports/server/rest/departments.js +++ b/packages/rocketchat-livechat/imports/server/rest/departments.js @@ -1,3 +1,5 @@ +import { check } from 'meteor/check'; + RocketChat.API.v1.addRoute('livechat/department', { authRequired: true }, { get() { if (!RocketChat.authz.hasPermission(this.userId, 'view-livechat-manager')) { diff --git a/packages/rocketchat-livechat/imports/server/rest/users.js b/packages/rocketchat-livechat/imports/server/rest/users.js index 02452a1b6659..3342fbfbff25 100644 --- a/packages/rocketchat-livechat/imports/server/rest/users.js +++ b/packages/rocketchat-livechat/imports/server/rest/users.js @@ -1,3 +1,4 @@ +import { check } from 'meteor/check'; import _ from 'underscore'; RocketChat.API.v1.addRoute('livechat/users/:type', { authRequired: true }, { diff --git a/packages/rocketchat-livechat/server/api/v1/agent.js b/packages/rocketchat-livechat/server/api/v1/agent.js index c69b432e365e..75ac4c8f0c17 100644 --- a/packages/rocketchat-livechat/server/api/v1/agent.js +++ b/packages/rocketchat-livechat/server/api/v1/agent.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import { findRoom, findGuest, findAgent } from '../lib/livechat'; RocketChat.API.v1.addRoute('livechat/agent.info/:rid/:token', { diff --git a/packages/rocketchat-livechat/server/api/v1/config.js b/packages/rocketchat-livechat/server/api/v1/config.js index 2dfd7746eddd..1ddb8938102d 100644 --- a/packages/rocketchat-livechat/server/api/v1/config.js +++ b/packages/rocketchat-livechat/server/api/v1/config.js @@ -1,4 +1,5 @@ import { findRoom, findGuest, settings, online } from '../lib/livechat'; +import { Match, check } from 'meteor/check'; RocketChat.API.v1.addRoute('livechat/config', { get() { diff --git a/packages/rocketchat-livechat/server/api/v1/customField.js b/packages/rocketchat-livechat/server/api/v1/customField.js index a1467f7062e8..43a6367e8426 100644 --- a/packages/rocketchat-livechat/server/api/v1/customField.js +++ b/packages/rocketchat-livechat/server/api/v1/customField.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import { findGuest } from '../lib/livechat'; RocketChat.API.v1.addRoute('livechat/custom.field', { diff --git a/packages/rocketchat-livechat/server/api/v1/message.js b/packages/rocketchat-livechat/server/api/v1/message.js index 47719369865a..61d6144e1be1 100644 --- a/packages/rocketchat-livechat/server/api/v1/message.js +++ b/packages/rocketchat-livechat/server/api/v1/message.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import { Random } from 'meteor/random'; import LivechatVisitors from '../../../server/models/LivechatVisitors'; import { findGuest, findRoom } from '../lib/livechat'; diff --git a/packages/rocketchat-livechat/server/api/v1/offlineMessage.js b/packages/rocketchat-livechat/server/api/v1/offlineMessage.js index 219f65819601..3edd4330e61d 100644 --- a/packages/rocketchat-livechat/server/api/v1/offlineMessage.js +++ b/packages/rocketchat-livechat/server/api/v1/offlineMessage.js @@ -1,3 +1,5 @@ +import { check } from 'meteor/check'; + RocketChat.API.v1.addRoute('livechat/offline.message', { post() { try { diff --git a/packages/rocketchat-livechat/server/api/v1/pageVisited.js b/packages/rocketchat-livechat/server/api/v1/pageVisited.js index c917d224a2ed..8ac49c75fd30 100644 --- a/packages/rocketchat-livechat/server/api/v1/pageVisited.js +++ b/packages/rocketchat-livechat/server/api/v1/pageVisited.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import _ from 'underscore'; import { findGuest, findRoom } from '../lib/livechat'; diff --git a/packages/rocketchat-livechat/server/api/v1/room.js b/packages/rocketchat-livechat/server/api/v1/room.js index 4229100d3250..81e1000f9070 100644 --- a/packages/rocketchat-livechat/server/api/v1/room.js +++ b/packages/rocketchat-livechat/server/api/v1/room.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import { Random } from 'meteor/random'; import { findGuest, findRoom, getRoom, settings } from '../lib/livechat'; diff --git a/packages/rocketchat-livechat/server/api/v1/transcript.js b/packages/rocketchat-livechat/server/api/v1/transcript.js index 447310198d95..c8a922c36a4e 100644 --- a/packages/rocketchat-livechat/server/api/v1/transcript.js +++ b/packages/rocketchat-livechat/server/api/v1/transcript.js @@ -1,3 +1,5 @@ +import { check } from 'meteor/check'; + RocketChat.API.v1.addRoute('livechat/transcript', { post() { try { diff --git a/packages/rocketchat-livechat/server/api/v1/videoCall.js b/packages/rocketchat-livechat/server/api/v1/videoCall.js index 249cf59407e1..dbb99179c840 100644 --- a/packages/rocketchat-livechat/server/api/v1/videoCall.js +++ b/packages/rocketchat-livechat/server/api/v1/videoCall.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import { Random } from 'meteor/random'; import { findGuest, getRoom, settings } from '../lib/livechat'; diff --git a/packages/rocketchat-livechat/server/api/v1/visitor.js b/packages/rocketchat-livechat/server/api/v1/visitor.js index 74f51e172ccd..c495568382a9 100644 --- a/packages/rocketchat-livechat/server/api/v1/visitor.js +++ b/packages/rocketchat-livechat/server/api/v1/visitor.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import LivechatVisitors from '../../../server/models/LivechatVisitors'; RocketChat.API.v1.addRoute('livechat/visitor', { diff --git a/packages/rocketchat-livechat/server/lib/Livechat.js b/packages/rocketchat-livechat/server/lib/Livechat.js index 129d30f8d549..6af1d6dfd8ee 100644 --- a/packages/rocketchat-livechat/server/lib/Livechat.js +++ b/packages/rocketchat-livechat/server/lib/Livechat.js @@ -1,5 +1,6 @@ /* globals HTTP */ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import { Random } from 'meteor/random'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-livechat/server/methods/getAgentData.js b/packages/rocketchat-livechat/server/methods/getAgentData.js index c8c8ca4d3d70..1711bdbbf814 100644 --- a/packages/rocketchat-livechat/server/methods/getAgentData.js +++ b/packages/rocketchat-livechat/server/methods/getAgentData.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/methods/getNextAgent.js b/packages/rocketchat-livechat/server/methods/getNextAgent.js index a6b1959a307d..8fc2781f3024 100644 --- a/packages/rocketchat-livechat/server/methods/getNextAgent.js +++ b/packages/rocketchat-livechat/server/methods/getNextAgent.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ 'livechat:getNextAgent'({ token, department }) { diff --git a/packages/rocketchat-livechat/server/methods/removeCustomField.js b/packages/rocketchat-livechat/server/methods/removeCustomField.js index c9968ba1fdb9..58013bd7ce84 100644 --- a/packages/rocketchat-livechat/server/methods/removeCustomField.js +++ b/packages/rocketchat-livechat/server/methods/removeCustomField.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ 'livechat:removeCustomField'(_id) { diff --git a/packages/rocketchat-livechat/server/methods/removeTrigger.js b/packages/rocketchat-livechat/server/methods/removeTrigger.js index a6f8319c4284..de7eb7316bf6 100644 --- a/packages/rocketchat-livechat/server/methods/removeTrigger.js +++ b/packages/rocketchat-livechat/server/methods/removeTrigger.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ 'livechat:removeTrigger'(triggerId) { diff --git a/packages/rocketchat-livechat/server/methods/saveCustomField.js b/packages/rocketchat-livechat/server/methods/saveCustomField.js index 300b411ea334..da51d96f7825 100644 --- a/packages/rocketchat-livechat/server/methods/saveCustomField.js +++ b/packages/rocketchat-livechat/server/methods/saveCustomField.js @@ -1,5 +1,6 @@ /* eslint new-cap: [2, {"capIsNewExceptions": ["Match.ObjectIncluding", "Match.Optional"]}] */ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; Meteor.methods({ 'livechat:saveCustomField'(_id, customFieldData) { diff --git a/packages/rocketchat-livechat/server/methods/saveInfo.js b/packages/rocketchat-livechat/server/methods/saveInfo.js index 24b0c5404eeb..152cf5affaae 100644 --- a/packages/rocketchat-livechat/server/methods/saveInfo.js +++ b/packages/rocketchat-livechat/server/methods/saveInfo.js @@ -1,5 +1,6 @@ /* eslint new-cap: [2, {"capIsNewExceptions": ["Match.ObjectIncluding", "Match.Optional"]}] */ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; Meteor.methods({ 'livechat:saveInfo'(guestData, roomData) { diff --git a/packages/rocketchat-livechat/server/methods/saveSurveyFeedback.js b/packages/rocketchat-livechat/server/methods/saveSurveyFeedback.js index 01ff77fcd379..56cd820a5957 100644 --- a/packages/rocketchat-livechat/server/methods/saveSurveyFeedback.js +++ b/packages/rocketchat-livechat/server/methods/saveSurveyFeedback.js @@ -1,5 +1,6 @@ /* eslint new-cap: [2, {"capIsNewExceptions": ["Match.ObjectIncluding"]}] */ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import LivechatVisitors from '../models/LivechatVisitors'; import _ from 'underscore'; diff --git a/packages/rocketchat-livechat/server/methods/saveTrigger.js b/packages/rocketchat-livechat/server/methods/saveTrigger.js index 9ad08dbc5c57..fec339955003 100644 --- a/packages/rocketchat-livechat/server/methods/saveTrigger.js +++ b/packages/rocketchat-livechat/server/methods/saveTrigger.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; Meteor.methods({ 'livechat:saveTrigger'(trigger) { diff --git a/packages/rocketchat-livechat/server/methods/sendFileLivechatMessage.js b/packages/rocketchat-livechat/server/methods/sendFileLivechatMessage.js index 6aac9de7b337..0968b8e5a2e6 100644 --- a/packages/rocketchat-livechat/server/methods/sendFileLivechatMessage.js +++ b/packages/rocketchat-livechat/server/methods/sendFileLivechatMessage.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import { Random } from 'meteor/random'; import LivechatVisitors from '../models/LivechatVisitors'; diff --git a/packages/rocketchat-livechat/server/methods/sendMessageLivechat.js b/packages/rocketchat-livechat/server/methods/sendMessageLivechat.js index 3fbeeb07df11..2efafe1ef788 100644 --- a/packages/rocketchat-livechat/server/methods/sendMessageLivechat.js +++ b/packages/rocketchat-livechat/server/methods/sendMessageLivechat.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/methods/sendOfflineMessage.js b/packages/rocketchat-livechat/server/methods/sendOfflineMessage.js index f39d12b8db23..b8c00c98c31c 100644 --- a/packages/rocketchat-livechat/server/methods/sendOfflineMessage.js +++ b/packages/rocketchat-livechat/server/methods/sendOfflineMessage.js @@ -1,5 +1,6 @@ /* globals DDPRateLimiter */ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ 'livechat:sendOfflineMessage'(data) { diff --git a/packages/rocketchat-livechat/server/methods/sendTranscript.js b/packages/rocketchat-livechat/server/methods/sendTranscript.js index 7e0b02db570a..65b582f88ea4 100644 --- a/packages/rocketchat-livechat/server/methods/sendTranscript.js +++ b/packages/rocketchat-livechat/server/methods/sendTranscript.js @@ -1,5 +1,6 @@ /* globals DDPRateLimiter */ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ 'livechat:sendTranscript'(token, rid, email) { diff --git a/packages/rocketchat-livechat/server/methods/setDepartmentForVisitor.js b/packages/rocketchat-livechat/server/methods/setDepartmentForVisitor.js index 2c15a0b74ddc..b3303d31de7c 100644 --- a/packages/rocketchat-livechat/server/methods/setDepartmentForVisitor.js +++ b/packages/rocketchat-livechat/server/methods/setDepartmentForVisitor.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/methods/transfer.js b/packages/rocketchat-livechat/server/methods/transfer.js index c377ec7808fa..9e25c450a6c5 100644 --- a/packages/rocketchat-livechat/server/methods/transfer.js +++ b/packages/rocketchat-livechat/server/methods/transfer.js @@ -1,6 +1,7 @@ /* eslint new-cap: [2, {"capIsNewExceptions": ["Match.Optional"]}] */ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/publications/livechatMonitoring.js b/packages/rocketchat-livechat/server/publications/livechatMonitoring.js index 6768d08c76ce..8fa094e38242 100644 --- a/packages/rocketchat-livechat/server/publications/livechatMonitoring.js +++ b/packages/rocketchat-livechat/server/publications/livechatMonitoring.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.publish('livechat:monitoring', function(date) { if (!this.userId) { diff --git a/packages/rocketchat-livechat/server/publications/livechatRooms.js b/packages/rocketchat-livechat/server/publications/livechatRooms.js index df96866a2a30..da8ae754c412 100644 --- a/packages/rocketchat-livechat/server/publications/livechatRooms.js +++ b/packages/rocketchat-livechat/server/publications/livechatRooms.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; Meteor.publish('livechat:rooms', function(filter = {}, offset = 0, limit = 20) { if (!this.userId) { diff --git a/packages/rocketchat-livechat/server/publications/livechatVisitors.js b/packages/rocketchat-livechat/server/publications/livechatVisitors.js index 0de54aeeff93..b14726acc2ee 100644 --- a/packages/rocketchat-livechat/server/publications/livechatVisitors.js +++ b/packages/rocketchat-livechat/server/publications/livechatVisitors.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.publish('livechat:visitors', function(date) { diff --git a/packages/rocketchat-livestream/server/functions/saveStreamingOptions.js b/packages/rocketchat-livestream/server/functions/saveStreamingOptions.js index 8699facf7238..f215d28309ee 100644 --- a/packages/rocketchat-livestream/server/functions/saveStreamingOptions.js +++ b/packages/rocketchat-livestream/server/functions/saveStreamingOptions.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; RocketChat.saveStreamingOptions = function(rid, options) { if (!Match.test(rid, String)) { diff --git a/packages/rocketchat-logger/client/viewLogs.js b/packages/rocketchat-logger/client/viewLogs.js index fc12b7b50317..d2acf944e079 100644 --- a/packages/rocketchat-logger/client/viewLogs.js +++ b/packages/rocketchat-logger/client/viewLogs.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Mongo } from 'meteor/mongo'; this.stdout = new Mongo.Collection('stdout'); diff --git a/packages/rocketchat-mentions/server/methods/getUserMentionsByChannel.js b/packages/rocketchat-mentions/server/methods/getUserMentionsByChannel.js index 2cf9d29b0d7e..41c7af9f60d4 100644 --- a/packages/rocketchat-mentions/server/methods/getUserMentionsByChannel.js +++ b/packages/rocketchat-mentions/server/methods/getUserMentionsByChannel.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ getUserMentionsByChannel({ roomId, options }) { diff --git a/packages/rocketchat-migrations/migrations.js b/packages/rocketchat-migrations/migrations.js index 0d5e50581142..298ea76eae9d 100644 --- a/packages/rocketchat-migrations/migrations.js +++ b/packages/rocketchat-migrations/migrations.js @@ -1,6 +1,7 @@ /* eslint no-use-before-define:0 */ /* globals Log*/ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-push-notifications/server/methods/saveNotificationSettings.js b/packages/rocketchat-push-notifications/server/methods/saveNotificationSettings.js index 9f445eb9fe33..e4ff4c3ea50b 100644 --- a/packages/rocketchat-push-notifications/server/methods/saveNotificationSettings.js +++ b/packages/rocketchat-push-notifications/server/methods/saveNotificationSettings.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ saveNotificationSettings(roomId, field, value) { diff --git a/packages/rocketchat-slackbridge/server/slackbridge_import.server.js b/packages/rocketchat-slackbridge/server/slackbridge_import.server.js index 2a33a0b8dfc8..29de87498e90 100644 --- a/packages/rocketchat-slackbridge/server/slackbridge_import.server.js +++ b/packages/rocketchat-slackbridge/server/slackbridge_import.server.js @@ -1,5 +1,6 @@ /* globals msgStream */ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; function SlackBridgeImport(command, params, item) { diff --git a/packages/rocketchat-slashcommands-archiveroom/server/server.js b/packages/rocketchat-slashcommands-archiveroom/server/server.js index 93436a758a89..ddb74a79b3d4 100644 --- a/packages/rocketchat-slashcommands-archiveroom/server/server.js +++ b/packages/rocketchat-slashcommands-archiveroom/server/server.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; function Archive(command, params, item) { diff --git a/packages/rocketchat-slashcommands-create/server/server.js b/packages/rocketchat-slashcommands-create/server/server.js index 0d86c318dbf6..75582a52d0f2 100644 --- a/packages/rocketchat-slashcommands-create/server/server.js +++ b/packages/rocketchat-slashcommands-create/server/server.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; function Create(command, params, item) { diff --git a/packages/rocketchat-slashcommands-hide/server/hide.js b/packages/rocketchat-slashcommands-hide/server/hide.js index 30e575704951..4a68c9f1de15 100644 --- a/packages/rocketchat-slashcommands-hide/server/hide.js +++ b/packages/rocketchat-slashcommands-hide/server/hide.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; /* diff --git a/packages/rocketchat-slashcommands-invite/server/server.js b/packages/rocketchat-slashcommands-invite/server/server.js index b1847b6f95d6..28a37d365b3e 100644 --- a/packages/rocketchat-slashcommands-invite/server/server.js +++ b/packages/rocketchat-slashcommands-invite/server/server.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; /* diff --git a/packages/rocketchat-slashcommands-inviteall/server/server.js b/packages/rocketchat-slashcommands-inviteall/server/server.js index 794e6b31e902..4cb6531c50a2 100644 --- a/packages/rocketchat-slashcommands-inviteall/server/server.js +++ b/packages/rocketchat-slashcommands-inviteall/server/server.js @@ -3,6 +3,7 @@ * @param {Object} message - The message object */ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; function inviteAll(type) { diff --git a/packages/rocketchat-slashcommands-join/server/server.js b/packages/rocketchat-slashcommands-join/server/server.js index d46e571b6817..c3ca93a99528 100644 --- a/packages/rocketchat-slashcommands-join/server/server.js +++ b/packages/rocketchat-slashcommands-join/server/server.js @@ -4,6 +4,7 @@ * @param {Object} message - The message object */ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; RocketChat.slashCommands.add('join', function Join(command, params, item) { diff --git a/packages/rocketchat-slashcommands-kick/server/server.js b/packages/rocketchat-slashcommands-kick/server/server.js index 0699d4366c1c..af95c42b4d6c 100644 --- a/packages/rocketchat-slashcommands-kick/server/server.js +++ b/packages/rocketchat-slashcommands-kick/server/server.js @@ -1,6 +1,7 @@ // Kick is a named function that will replace /kick commands import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; const Kick = function(command, params, { rid }) { diff --git a/packages/rocketchat-slashcommands-msg/server.js b/packages/rocketchat-slashcommands-msg/server.js index faa6950d1a2f..be0253d4a3b9 100644 --- a/packages/rocketchat-slashcommands-msg/server.js +++ b/packages/rocketchat-slashcommands-msg/server.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; /* diff --git a/packages/rocketchat-slashcommands-mute/server/mute.js b/packages/rocketchat-slashcommands-mute/server/mute.js index 4f51032ab878..8d5d3cde96e2 100644 --- a/packages/rocketchat-slashcommands-mute/server/mute.js +++ b/packages/rocketchat-slashcommands-mute/server/mute.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; /* diff --git a/packages/rocketchat-slashcommands-mute/server/unmute.js b/packages/rocketchat-slashcommands-mute/server/unmute.js index 568d7e00ba1c..c8952970a565 100644 --- a/packages/rocketchat-slashcommands-mute/server/unmute.js +++ b/packages/rocketchat-slashcommands-mute/server/unmute.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; /* diff --git a/packages/rocketchat-slashcommands-open/client/client.js b/packages/rocketchat-slashcommands-open/client/client.js index 2491ef010716..35257e71aabb 100644 --- a/packages/rocketchat-slashcommands-open/client/client.js +++ b/packages/rocketchat-slashcommands-open/client/client.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; function Open(command, params /* , item*/) { const dict = { diff --git a/packages/rocketchat-slashcommands-unarchiveroom/server/server.js b/packages/rocketchat-slashcommands-unarchiveroom/server/server.js index 54e7a033dfab..d0cccc4b9670 100644 --- a/packages/rocketchat-slashcommands-unarchiveroom/server/server.js +++ b/packages/rocketchat-slashcommands-unarchiveroom/server/server.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; function Unarchive(command, params, item) { diff --git a/packages/rocketchat-tokenpass/server/functions/saveRoomTokens.js b/packages/rocketchat-tokenpass/server/functions/saveRoomTokens.js index a90272f48c02..c591baefb7c7 100644 --- a/packages/rocketchat-tokenpass/server/functions/saveRoomTokens.js +++ b/packages/rocketchat-tokenpass/server/functions/saveRoomTokens.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; RocketChat.saveRoomTokenpass = function(rid, tokenpass) { if (!Match.test(rid, String)) { diff --git a/packages/rocketchat-tokenpass/server/functions/saveRoomTokensMinimumBalance.js b/packages/rocketchat-tokenpass/server/functions/saveRoomTokensMinimumBalance.js index 8600eae78970..00f1eb809dbe 100644 --- a/packages/rocketchat-tokenpass/server/functions/saveRoomTokensMinimumBalance.js +++ b/packages/rocketchat-tokenpass/server/functions/saveRoomTokensMinimumBalance.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import s from 'underscore.string'; RocketChat.saveRoomTokensMinimumBalance = function(rid, roomTokensMinimumBalance) { diff --git a/packages/rocketchat-tokenpass/server/methods/getChannelTokenpass.js b/packages/rocketchat-tokenpass/server/methods/getChannelTokenpass.js index ae4d8e14ef31..0f39a5684b2a 100644 --- a/packages/rocketchat-tokenpass/server/methods/getChannelTokenpass.js +++ b/packages/rocketchat-tokenpass/server/methods/getChannelTokenpass.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ getChannelTokenpass(rid) { diff --git a/packages/rocketchat-ui-master/client/main.js b/packages/rocketchat-ui-master/client/main.js index be1701753980..c69ecf0145b7 100644 --- a/packages/rocketchat-ui-master/client/main.js +++ b/packages/rocketchat-ui-master/client/main.js @@ -1,5 +1,6 @@ /* globals toolbarSearch, menu, fireGlobalEvent, CachedChatSubscription, DynamicCss, popover */ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import { ReactiveVar } from 'meteor/reactive-var'; import Clipboard from 'clipboard'; import s from 'underscore.string'; diff --git a/packages/rocketchat-webdav/server/methods/addWebdavAccount.js b/packages/rocketchat-webdav/server/methods/addWebdavAccount.js index 0fb3c019b09e..004b6bc55b9c 100644 --- a/packages/rocketchat-webdav/server/methods/addWebdavAccount.js +++ b/packages/rocketchat-webdav/server/methods/addWebdavAccount.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import Webdav from 'webdav'; Meteor.methods({ diff --git a/packages/rocketchat-webdav/server/methods/removeWebdavAccount.js b/packages/rocketchat-webdav/server/methods/removeWebdavAccount.js index 78870aaca1a5..c184b339b565 100644 --- a/packages/rocketchat-webdav/server/methods/removeWebdavAccount.js +++ b/packages/rocketchat-webdav/server/methods/removeWebdavAccount.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ removeWebdavAccount(accountId) { diff --git a/server/lib/accounts.js b/server/lib/accounts.js index 145424cc3bd5..7ce9c42c76b3 100644 --- a/server/lib/accounts.js +++ b/server/lib/accounts.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import { Accounts } from 'meteor/accounts-base'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/server/methods/addAllUserToRoom.js b/server/methods/addAllUserToRoom.js index b59e7a37c2db..c696218ec16d 100644 --- a/server/methods/addAllUserToRoom.js +++ b/server/methods/addAllUserToRoom.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ addAllUserToRoom(rid, activeUsersOnly = false) { diff --git a/server/methods/addRoomLeader.js b/server/methods/addRoomLeader.js index 9fc171e5c6e5..1c0fd31d4d13 100644 --- a/server/methods/addRoomLeader.js +++ b/server/methods/addRoomLeader.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ addRoomLeader(rid, userId) { diff --git a/server/methods/addRoomModerator.js b/server/methods/addRoomModerator.js index 9cd63c86c300..eaf2f5a69bc5 100644 --- a/server/methods/addRoomModerator.js +++ b/server/methods/addRoomModerator.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ addRoomModerator(rid, userId) { diff --git a/server/methods/addRoomOwner.js b/server/methods/addRoomOwner.js index b43e0442b746..a1507147488f 100644 --- a/server/methods/addRoomOwner.js +++ b/server/methods/addRoomOwner.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ addRoomOwner(rid, userId) { diff --git a/server/methods/canAccessRoom.js b/server/methods/canAccessRoom.js index 5adb9edda2d0..2f6f1e6a6130 100644 --- a/server/methods/canAccessRoom.js +++ b/server/methods/canAccessRoom.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; Meteor.methods({ canAccessRoom(rid, userId, extraData) { diff --git a/server/methods/channelsList.js b/server/methods/channelsList.js index 1fd0584f10e0..4e4c6dab90b1 100644 --- a/server/methods/channelsList.js +++ b/server/methods/channelsList.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/server/methods/createDirectMessage.js b/server/methods/createDirectMessage.js index 2faa73d5fb34..1fb380ad8368 100644 --- a/server/methods/createDirectMessage.js +++ b/server/methods/createDirectMessage.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ createDirectMessage(username) { diff --git a/server/methods/deleteFileMessage.js b/server/methods/deleteFileMessage.js index c11dd3955cab..3fdc4ca43d9d 100644 --- a/server/methods/deleteFileMessage.js +++ b/server/methods/deleteFileMessage.js @@ -1,5 +1,6 @@ /* global FileUpload */ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ deleteFileMessage(fileID) { diff --git a/server/methods/deleteUser.js b/server/methods/deleteUser.js index 504e67e05f4e..7b69e55b1cbb 100644 --- a/server/methods/deleteUser.js +++ b/server/methods/deleteUser.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ deleteUser(userId) { diff --git a/server/methods/eraseRoom.js b/server/methods/eraseRoom.js index 8347ceeeb1be..b4f901643d2d 100644 --- a/server/methods/eraseRoom.js +++ b/server/methods/eraseRoom.js @@ -1,5 +1,6 @@ /* globals RocketChat */ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ eraseRoom(rid) { diff --git a/server/methods/getAvatarSuggestion.js b/server/methods/getAvatarSuggestion.js index 3b831c5620b4..12cfcc2337a3 100644 --- a/server/methods/getAvatarSuggestion.js +++ b/server/methods/getAvatarSuggestion.js @@ -1,5 +1,6 @@ /* global Gravatar */ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import { HTTP } from 'meteor/http'; function getAvatarSuggestionForUser(user) { diff --git a/server/methods/getRoomIdByNameOrId.js b/server/methods/getRoomIdByNameOrId.js index 3e229480de8e..786fbed4a05e 100644 --- a/server/methods/getRoomIdByNameOrId.js +++ b/server/methods/getRoomIdByNameOrId.js @@ -1,5 +1,6 @@ // DEPRECATE import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ getRoomIdByNameOrId(rid) { diff --git a/server/methods/getRoomNameById.js b/server/methods/getRoomNameById.js index 189e265f6357..389e4c52a5d4 100644 --- a/server/methods/getRoomNameById.js +++ b/server/methods/getRoomNameById.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ getRoomNameById(rid) { diff --git a/server/methods/getUsernameSuggestion.js b/server/methods/getUsernameSuggestion.js index 45e241e43306..1dd7b6c270b6 100644 --- a/server/methods/getUsernameSuggestion.js +++ b/server/methods/getUsernameSuggestion.js @@ -1,5 +1,6 @@ /* global slugify */ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import _ from 'underscore'; function slug(text) { diff --git a/server/methods/hideRoom.js b/server/methods/hideRoom.js index b3f75b693a0b..baa285ad3adf 100644 --- a/server/methods/hideRoom.js +++ b/server/methods/hideRoom.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ hideRoom(rid) { diff --git a/server/methods/ignoreUser.js b/server/methods/ignoreUser.js index 9fd96daea204..ac171cdcbf48 100644 --- a/server/methods/ignoreUser.js +++ b/server/methods/ignoreUser.js @@ -1,5 +1,6 @@ /* globals RocketChat */ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ ignoreUser({ rid, userId: ignoredUser, ignore = true }) { diff --git a/server/methods/loadHistory.js b/server/methods/loadHistory.js index 3d278405becf..5b5ab09035c9 100644 --- a/server/methods/loadHistory.js +++ b/server/methods/loadHistory.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; const hideMessagesOfType = []; diff --git a/server/methods/loadLocale.js b/server/methods/loadLocale.js index 35b0beed0e22..aa3d0302a4f2 100644 --- a/server/methods/loadLocale.js +++ b/server/methods/loadLocale.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ loadLocale(locale) { diff --git a/server/methods/loadMissedMessages.js b/server/methods/loadMissedMessages.js index 92950f91fbb1..af01894e5d33 100644 --- a/server/methods/loadMissedMessages.js +++ b/server/methods/loadMissedMessages.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ loadMissedMessages(rid, start) { diff --git a/server/methods/loadNextMessages.js b/server/methods/loadNextMessages.js index 49a3f96b0122..242632335941 100644 --- a/server/methods/loadNextMessages.js +++ b/server/methods/loadNextMessages.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import _ from 'underscore'; Meteor.methods({ diff --git a/server/methods/loadSurroundingMessages.js b/server/methods/loadSurroundingMessages.js index a8437274a48f..2c451531a0a7 100644 --- a/server/methods/loadSurroundingMessages.js +++ b/server/methods/loadSurroundingMessages.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import _ from 'underscore'; Meteor.methods({ diff --git a/server/methods/logoutCleanUp.js b/server/methods/logoutCleanUp.js index 81d99b65ff45..157db2896cb7 100644 --- a/server/methods/logoutCleanUp.js +++ b/server/methods/logoutCleanUp.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ logoutCleanUp(user) { diff --git a/server/methods/messageSearch.js b/server/methods/messageSearch.js index 55ab07814f9d..dd40f392928e 100644 --- a/server/methods/messageSearch.js +++ b/server/methods/messageSearch.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import s from 'underscore.string'; Meteor.methods({ diff --git a/server/methods/migrate.js b/server/methods/migrate.js index 49bc531fdae1..e46e7dc11993 100644 --- a/server/methods/migrate.js +++ b/server/methods/migrate.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ migrateTo(version) { diff --git a/server/methods/muteUserInRoom.js b/server/methods/muteUserInRoom.js index 92421bdcb3db..b63c3e4a1729 100644 --- a/server/methods/muteUserInRoom.js +++ b/server/methods/muteUserInRoom.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; Meteor.methods({ muteUserInRoom(data) { diff --git a/server/methods/openRoom.js b/server/methods/openRoom.js index 9d299c4d63c1..2a9af14d3e07 100644 --- a/server/methods/openRoom.js +++ b/server/methods/openRoom.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ openRoom(rid) { diff --git a/server/methods/readMessages.js b/server/methods/readMessages.js index 99b703305420..939cfc9a471b 100644 --- a/server/methods/readMessages.js +++ b/server/methods/readMessages.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import { ReadReceipt } from '../../imports/message-read-receipt/server/lib/ReadReceipt'; Meteor.methods({ diff --git a/server/methods/registerUser.js b/server/methods/registerUser.js index 8b85f6d8ef90..fd990df7f4f2 100644 --- a/server/methods/registerUser.js +++ b/server/methods/registerUser.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import { Accounts } from 'meteor/accounts-base'; import s from 'underscore.string'; import * as Mailer from 'meteor/rocketchat:mailer'; diff --git a/server/methods/removeRoomLeader.js b/server/methods/removeRoomLeader.js index 7d9ad71b6a14..935c10966fc8 100644 --- a/server/methods/removeRoomLeader.js +++ b/server/methods/removeRoomLeader.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ removeRoomLeader(rid, userId) { diff --git a/server/methods/removeRoomModerator.js b/server/methods/removeRoomModerator.js index 0ba3b840d48c..bf0f09f63b0d 100644 --- a/server/methods/removeRoomModerator.js +++ b/server/methods/removeRoomModerator.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ removeRoomModerator(rid, userId) { diff --git a/server/methods/removeRoomOwner.js b/server/methods/removeRoomOwner.js index a9a91cbcc214..a1e80af51c8f 100644 --- a/server/methods/removeRoomOwner.js +++ b/server/methods/removeRoomOwner.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ removeRoomOwner(rid, userId) { diff --git a/server/methods/removeUserFromRoom.js b/server/methods/removeUserFromRoom.js index 4ef4bc6037fb..c82e7c64a22c 100644 --- a/server/methods/removeUserFromRoom.js +++ b/server/methods/removeUserFromRoom.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; Meteor.methods({ removeUserFromRoom(data) { diff --git a/server/methods/reportMessage.js b/server/methods/reportMessage.js index 25ad24d5f1b7..90215f6a2e68 100644 --- a/server/methods/reportMessage.js +++ b/server/methods/reportMessage.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ reportMessage(messageId, description) { diff --git a/server/methods/roomNameExists.js b/server/methods/roomNameExists.js index 8942ce2b4c78..064f7ae28546 100644 --- a/server/methods/roomNameExists.js +++ b/server/methods/roomNameExists.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ roomNameExists(rid) { diff --git a/server/methods/saveUserPreferences.js b/server/methods/saveUserPreferences.js index 129a3bb13dc9..8b5b4ca71bdf 100644 --- a/server/methods/saveUserPreferences.js +++ b/server/methods/saveUserPreferences.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; Meteor.methods({ saveUserPreferences(settings) { diff --git a/server/methods/saveUserProfile.js b/server/methods/saveUserProfile.js index cf7724e9a955..b50d17059617 100644 --- a/server/methods/saveUserProfile.js +++ b/server/methods/saveUserProfile.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; import { Accounts } from 'meteor/accounts-base'; Meteor.methods({ diff --git a/server/methods/sendConfirmationEmail.js b/server/methods/sendConfirmationEmail.js index 5564d3908cb4..b90721f3c05f 100644 --- a/server/methods/sendConfirmationEmail.js +++ b/server/methods/sendConfirmationEmail.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import { Accounts } from 'meteor/accounts-base'; import * as Mailer from 'meteor/rocketchat:mailer'; diff --git a/server/methods/sendForgotPasswordEmail.js b/server/methods/sendForgotPasswordEmail.js index 10ae67042576..f9c7de21f159 100644 --- a/server/methods/sendForgotPasswordEmail.js +++ b/server/methods/sendForgotPasswordEmail.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import { Accounts } from 'meteor/accounts-base'; import s from 'underscore.string'; import * as Mailer from 'meteor/rocketchat:mailer'; diff --git a/server/methods/setAvatarFromService.js b/server/methods/setAvatarFromService.js index be2298e6d919..7cac0ccfe5ae 100644 --- a/server/methods/setAvatarFromService.js +++ b/server/methods/setAvatarFromService.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; Meteor.methods({ setAvatarFromService(dataURI, contentType, service) { diff --git a/server/methods/setUserActiveStatus.js b/server/methods/setUserActiveStatus.js index 3b52365416fa..35e82ec642bb 100644 --- a/server/methods/setUserActiveStatus.js +++ b/server/methods/setUserActiveStatus.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import { Accounts } from 'meteor/accounts-base'; import * as Mailer from 'meteor/rocketchat:mailer'; diff --git a/server/methods/setUserPassword.js b/server/methods/setUserPassword.js index 3221f7ec17d7..a4ee82116815 100644 --- a/server/methods/setUserPassword.js +++ b/server/methods/setUserPassword.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import { Accounts } from 'meteor/accounts-base'; Meteor.methods({ diff --git a/server/methods/toogleFavorite.js b/server/methods/toogleFavorite.js index 24467ff439f0..4259c233cb57 100644 --- a/server/methods/toogleFavorite.js +++ b/server/methods/toogleFavorite.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; Meteor.methods({ toggleFavorite(rid, f) { diff --git a/server/methods/unmuteUserInRoom.js b/server/methods/unmuteUserInRoom.js index 05703b9ab432..0349a0d797cd 100644 --- a/server/methods/unmuteUserInRoom.js +++ b/server/methods/unmuteUserInRoom.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Match, check } from 'meteor/check'; Meteor.methods({ unmuteUserInRoom(data) { diff --git a/server/methods/userSetUtcOffset.js b/server/methods/userSetUtcOffset.js index 5860d6884840..5b82d3ff61d8 100644 --- a/server/methods/userSetUtcOffset.js +++ b/server/methods/userSetUtcOffset.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; Meteor.methods({ userSetUtcOffset(utcOffset) { diff --git a/server/publications/messages.js b/server/publications/messages.js index f7a3dfc3889f..f0e464bcbf82 100644 --- a/server/publications/messages.js +++ b/server/publications/messages.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import _ from 'underscore'; Meteor.publish('messages', function(rid/* , start*/) { diff --git a/server/startup/migrations/v099.js b/server/startup/migrations/v099.js index 94a450260eef..cdfda628222f 100644 --- a/server/startup/migrations/v099.js +++ b/server/startup/migrations/v099.js @@ -1,6 +1,7 @@ /* globals SystemLogger */ import { Meteor } from 'meteor/meteor'; +import { Match } from 'meteor/check'; import fs from 'fs'; import path from 'path'; diff --git a/server/stream/streamBroadcast.js b/server/stream/streamBroadcast.js index 9ef9df178941..1cc32a45eca9 100644 --- a/server/stream/streamBroadcast.js +++ b/server/stream/streamBroadcast.js @@ -1,6 +1,7 @@ /* global InstanceStatus, DDP, LoggerManager */ import { Meteor } from 'meteor/meteor'; +import { check } from 'meteor/check'; import _ from 'underscore'; import { DDPCommon } from 'meteor/ddp-common'; From b4dc88d150dc4175510c0ee541e6ac9d171b68e4 Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Wed, 24 Oct 2018 17:12:27 -0300 Subject: [PATCH 15/34] Remove global variable Mongo --- .eslintrc | 1 - imports/personal-access-tokens/client/personalAccessTokens.js | 1 + packages/meteor-autocomplete/client/collection.js | 2 ++ packages/meteor-autocomplete/server/autocomplete-server.js | 1 + packages/rocketchat-authorization/client/lib/models/Roles.js | 2 ++ packages/rocketchat-integrations/client/collections.js | 2 ++ packages/rocketchat-lib/client/lib/cachedCollection.js | 1 + packages/rocketchat-lib/client/models/_Base.js | 2 ++ packages/rocketchat-livechat/.app/client/lib/collections.js | 2 ++ packages/rocketchat-livechat/client/collections/AgentUsers.js | 2 ++ .../client/collections/LivechatCustomField.js | 2 ++ .../client/collections/LivechatDepartment.js | 2 ++ .../client/collections/LivechatDepartmentAgents.js | 2 ++ .../rocketchat-livechat/client/collections/LivechatInquiry.js | 2 ++ .../client/collections/LivechatIntegration.js | 2 ++ .../client/collections/LivechatMonitoring.js | 2 ++ .../client/collections/LivechatPageVisited.js | 2 ++ .../client/collections/LivechatQueueUser.js | 2 ++ .../rocketchat-livechat/client/collections/LivechatTrigger.js | 2 ++ .../rocketchat-livechat/client/collections/LivechatVisitor.js | 2 ++ .../client/collections/livechatOfficeHour.js | 2 ++ .../client/views/app/analytics/livechatRealTimeMonitoring.js | 1 + .../rocketchat-livechat/client/views/app/livechatAppearance.js | 1 + .../client/views/app/livechatCurrentChats.js | 1 + packages/rocketchat-livechat/client/views/app/livechatUsers.js | 1 + .../client/views/app/tabbar/visitorHistory.js | 1 + .../client/views/app/tabbar/visitorNavigation.js | 2 ++ .../rocketchat-mentions-flextab/client/lib/MentionedMessage.js | 2 ++ packages/rocketchat-message-pin/client/lib/PinnedMessage.js | 2 ++ packages/rocketchat-message-snippet/client/lib/collections.js | 2 ++ packages/rocketchat-message-star/client/lib/StarredMessage.js | 2 ++ packages/rocketchat-migrations/migrations.js | 1 + .../rocketchat-oauth2-server-config/admin/client/collection.js | 2 ++ packages/rocketchat-ui-admin/client/admin.js | 1 + packages/rocketchat-ui-admin/client/rooms/adminRooms.js | 1 + .../rocketchat-ui-flextab/client/tabs/uploadedFilesList.js | 1 + .../rocketchat-ui-message/client/popup/messagePopupConfig.js | 1 + packages/rocketchat-ui/client/lib/collections.js | 1 + .../rocketchat-webdav/client/collections/WebdavAccounts.js | 3 +++ server/startup/migrations/v009.js | 1 + server/startup/migrations/v015.js | 1 + server/startup/migrations/v042.js | 2 ++ server/startup/migrations/v099.js | 1 + 43 files changed, 68 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index 26ba65dbac72..9f0e6819193d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -32,7 +32,6 @@ "Logger" : false, "modal" : false, "moment" : false, - "Mongo" : false, "Npm" : false, "Package" : false, "parentCall" : false, diff --git a/imports/personal-access-tokens/client/personalAccessTokens.js b/imports/personal-access-tokens/client/personalAccessTokens.js index f16fec08470d..e4e7c894e8c8 100644 --- a/imports/personal-access-tokens/client/personalAccessTokens.js +++ b/imports/personal-access-tokens/client/personalAccessTokens.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Mongo } from 'meteor/mongo'; import { ReactiveVar } from 'meteor/reactive-var'; import toastr from 'toastr'; import moment from 'moment'; diff --git a/packages/meteor-autocomplete/client/collection.js b/packages/meteor-autocomplete/client/collection.js index 0e701754b2dc..ff2606e9d3c5 100644 --- a/packages/meteor-autocomplete/client/collection.js +++ b/packages/meteor-autocomplete/client/collection.js @@ -1 +1,3 @@ +import { Mongo } from 'meteor/mongo'; + export default new Mongo.Collection('autocompleteRecords'); diff --git a/packages/meteor-autocomplete/server/autocomplete-server.js b/packages/meteor-autocomplete/server/autocomplete-server.js index 75b18f10d153..9a86670214dd 100755 --- a/packages/meteor-autocomplete/server/autocomplete-server.js +++ b/packages/meteor-autocomplete/server/autocomplete-server.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Mongo } from 'meteor/mongo'; // This also attaches an onStop callback to sub, so we don't need to worry about that. // https://github.com/meteor/meteor/blob/devel/packages/mongo/collection.js const Autocomplete = class { diff --git a/packages/rocketchat-authorization/client/lib/models/Roles.js b/packages/rocketchat-authorization/client/lib/models/Roles.js index f00332c0aba9..37fb91417335 100644 --- a/packages/rocketchat-authorization/client/lib/models/Roles.js +++ b/packages/rocketchat-authorization/client/lib/models/Roles.js @@ -1,3 +1,5 @@ +import { Mongo } from 'meteor/mongo'; + RocketChat.models.Roles = new Mongo.Collection('rocketchat_roles'); Object.assign(RocketChat.models.Roles, { diff --git a/packages/rocketchat-integrations/client/collections.js b/packages/rocketchat-integrations/client/collections.js index 6f5327b62b57..67782a80d7f6 100644 --- a/packages/rocketchat-integrations/client/collections.js +++ b/packages/rocketchat-integrations/client/collections.js @@ -1,2 +1,4 @@ +import { Mongo } from 'meteor/mongo'; + this.ChatIntegrations = new Mongo.Collection('rocketchat_integrations'); this.ChatIntegrationHistory = new Mongo.Collection('rocketchat_integration_history'); diff --git a/packages/rocketchat-lib/client/lib/cachedCollection.js b/packages/rocketchat-lib/client/lib/cachedCollection.js index 1ef68ebd035c..04620b33790e 100644 --- a/packages/rocketchat-lib/client/lib/cachedCollection.js +++ b/packages/rocketchat-lib/client/lib/cachedCollection.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { check } from 'meteor/check'; +import { Mongo } from 'meteor/mongo'; import { Accounts } from 'meteor/accounts-base'; import { ReactiveVar } from 'meteor/reactive-var'; import localforage from 'localforage'; diff --git a/packages/rocketchat-lib/client/models/_Base.js b/packages/rocketchat-lib/client/models/_Base.js index fc43e3b0924e..5a283e2ebcbc 100644 --- a/packages/rocketchat-lib/client/models/_Base.js +++ b/packages/rocketchat-lib/client/models/_Base.js @@ -1,4 +1,6 @@ import { check } from 'meteor/check'; +import { Mongo } from 'meteor/mongo'; + RocketChat.models._Base = class { _baseName() { diff --git a/packages/rocketchat-livechat/.app/client/lib/collections.js b/packages/rocketchat-livechat/.app/client/lib/collections.js index 1feb9caace84..2b102423f7bc 100644 --- a/packages/rocketchat-livechat/.app/client/lib/collections.js +++ b/packages/rocketchat-livechat/.app/client/lib/collections.js @@ -1,2 +1,4 @@ +import { Mongo } from 'meteor/mongo'; + this.ChatMessage = new Mongo.Collection(null); this.Department = new Mongo.Collection(null); diff --git a/packages/rocketchat-livechat/client/collections/AgentUsers.js b/packages/rocketchat-livechat/client/collections/AgentUsers.js index e571fad61d2b..c5b9b7d6f60c 100644 --- a/packages/rocketchat-livechat/client/collections/AgentUsers.js +++ b/packages/rocketchat-livechat/client/collections/AgentUsers.js @@ -1 +1,3 @@ +import { Mongo } from 'meteor/mongo'; + this.AgentUsers = new Mongo.Collection('agentUsers'); diff --git a/packages/rocketchat-livechat/client/collections/LivechatCustomField.js b/packages/rocketchat-livechat/client/collections/LivechatCustomField.js index 050c6f4cbafa..c7252cb4e30e 100644 --- a/packages/rocketchat-livechat/client/collections/LivechatCustomField.js +++ b/packages/rocketchat-livechat/client/collections/LivechatCustomField.js @@ -1 +1,3 @@ +import { Mongo } from 'meteor/mongo'; + this.LivechatCustomField = new Mongo.Collection('rocketchat_livechat_custom_field'); diff --git a/packages/rocketchat-livechat/client/collections/LivechatDepartment.js b/packages/rocketchat-livechat/client/collections/LivechatDepartment.js index 3a8d17776056..c046403664d2 100644 --- a/packages/rocketchat-livechat/client/collections/LivechatDepartment.js +++ b/packages/rocketchat-livechat/client/collections/LivechatDepartment.js @@ -1 +1,3 @@ +import { Mongo } from 'meteor/mongo'; + this.LivechatDepartment = new Mongo.Collection('rocketchat_livechat_department'); diff --git a/packages/rocketchat-livechat/client/collections/LivechatDepartmentAgents.js b/packages/rocketchat-livechat/client/collections/LivechatDepartmentAgents.js index 08ea1741134b..fb285079268c 100644 --- a/packages/rocketchat-livechat/client/collections/LivechatDepartmentAgents.js +++ b/packages/rocketchat-livechat/client/collections/LivechatDepartmentAgents.js @@ -1 +1,3 @@ +import { Mongo } from 'meteor/mongo'; + this.LivechatDepartmentAgents = new Mongo.Collection('rocketchat_livechat_department_agents'); diff --git a/packages/rocketchat-livechat/client/collections/LivechatInquiry.js b/packages/rocketchat-livechat/client/collections/LivechatInquiry.js index 9bfd938f2dbc..82d7d36eafcb 100644 --- a/packages/rocketchat-livechat/client/collections/LivechatInquiry.js +++ b/packages/rocketchat-livechat/client/collections/LivechatInquiry.js @@ -1 +1,3 @@ +import { Mongo } from 'meteor/mongo'; + this.LivechatInquiry = new Mongo.Collection('rocketchat_livechat_inquiry'); diff --git a/packages/rocketchat-livechat/client/collections/LivechatIntegration.js b/packages/rocketchat-livechat/client/collections/LivechatIntegration.js index c52fa0010666..de6fb6224558 100644 --- a/packages/rocketchat-livechat/client/collections/LivechatIntegration.js +++ b/packages/rocketchat-livechat/client/collections/LivechatIntegration.js @@ -1 +1,3 @@ +import { Mongo } from 'meteor/mongo'; + this.LivechatIntegration = new Mongo.Collection('livechatIntegration'); diff --git a/packages/rocketchat-livechat/client/collections/LivechatMonitoring.js b/packages/rocketchat-livechat/client/collections/LivechatMonitoring.js index e86134dee85a..b028b208083c 100644 --- a/packages/rocketchat-livechat/client/collections/LivechatMonitoring.js +++ b/packages/rocketchat-livechat/client/collections/LivechatMonitoring.js @@ -1 +1,3 @@ +import { Mongo } from 'meteor/mongo'; + this.LivechatMonitoring = new Mongo.Collection('livechatMonitoring'); diff --git a/packages/rocketchat-livechat/client/collections/LivechatPageVisited.js b/packages/rocketchat-livechat/client/collections/LivechatPageVisited.js index f2f4fc2a60d7..86a18ae89851 100644 --- a/packages/rocketchat-livechat/client/collections/LivechatPageVisited.js +++ b/packages/rocketchat-livechat/client/collections/LivechatPageVisited.js @@ -1 +1,3 @@ +import { Mongo } from 'meteor/mongo'; + this.LivechatPageVisited = new Mongo.Collection('rocketchat_livechat_page_visited'); diff --git a/packages/rocketchat-livechat/client/collections/LivechatQueueUser.js b/packages/rocketchat-livechat/client/collections/LivechatQueueUser.js index f615f812c8f6..da2cc2896ade 100644 --- a/packages/rocketchat-livechat/client/collections/LivechatQueueUser.js +++ b/packages/rocketchat-livechat/client/collections/LivechatQueueUser.js @@ -1 +1,3 @@ +import { Mongo } from 'meteor/mongo'; + this.LivechatQueueUser = new Mongo.Collection('livechatQueueUser'); diff --git a/packages/rocketchat-livechat/client/collections/LivechatTrigger.js b/packages/rocketchat-livechat/client/collections/LivechatTrigger.js index 8cca1caa586d..4cc6118b60af 100644 --- a/packages/rocketchat-livechat/client/collections/LivechatTrigger.js +++ b/packages/rocketchat-livechat/client/collections/LivechatTrigger.js @@ -1 +1,3 @@ +import { Mongo } from 'meteor/mongo'; + this.LivechatTrigger = new Mongo.Collection('rocketchat_livechat_trigger'); diff --git a/packages/rocketchat-livechat/client/collections/LivechatVisitor.js b/packages/rocketchat-livechat/client/collections/LivechatVisitor.js index e2b44ef3f14f..8a5adb6a31cc 100644 --- a/packages/rocketchat-livechat/client/collections/LivechatVisitor.js +++ b/packages/rocketchat-livechat/client/collections/LivechatVisitor.js @@ -1 +1,3 @@ +import { Mongo } from 'meteor/mongo'; + this.LivechatVisitor = new Mongo.Collection('rocketchat_livechat_visitor'); diff --git a/packages/rocketchat-livechat/client/collections/livechatOfficeHour.js b/packages/rocketchat-livechat/client/collections/livechatOfficeHour.js index 0cb4a81530ee..44948375e44e 100644 --- a/packages/rocketchat-livechat/client/collections/livechatOfficeHour.js +++ b/packages/rocketchat-livechat/client/collections/livechatOfficeHour.js @@ -1 +1,3 @@ +import { Mongo } from 'meteor/mongo'; + this.LivechatOfficeHour = new Mongo.Collection('rocketchat_livechat_office_hour'); diff --git a/packages/rocketchat-livechat/client/views/app/analytics/livechatRealTimeMonitoring.js b/packages/rocketchat-livechat/client/views/app/analytics/livechatRealTimeMonitoring.js index 6d1cb7495bbd..b1a085b06218 100644 --- a/packages/rocketchat-livechat/client/views/app/analytics/livechatRealTimeMonitoring.js +++ b/packages/rocketchat-livechat/client/views/app/analytics/livechatRealTimeMonitoring.js @@ -1,3 +1,4 @@ +import { Mongo } from 'meteor/mongo'; import moment from 'moment'; import { ReactiveVar } from 'meteor/reactive-var'; import { drawLineChart, drawDoughnutChart, updateChart } from '../../../lib/chartHandler'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatAppearance.js b/packages/rocketchat-livechat/client/views/app/livechatAppearance.js index 4fe233c3f568..2b9c6c173dfb 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatAppearance.js +++ b/packages/rocketchat-livechat/client/views/app/livechatAppearance.js @@ -1,6 +1,7 @@ /* globals jscolor*/ /* eslint new-cap: ["error", { "newIsCapExceptions": ["jscolor"] }]*/ import { Meteor } from 'meteor/meteor'; +import { Mongo } from 'meteor/mongo'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import s from 'underscore.string'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js b/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js index 847231745d25..bd0d4545cd66 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js +++ b/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Mongo } from 'meteor/mongo'; import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; import moment from 'moment'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatUsers.js b/packages/rocketchat-livechat/client/views/app/livechatUsers.js index b0ef030c6a0d..483115261542 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatUsers.js +++ b/packages/rocketchat-livechat/client/views/app/livechatUsers.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Mongo } from 'meteor/mongo'; import _ from 'underscore'; import toastr from 'toastr'; let ManagerUsers; diff --git a/packages/rocketchat-livechat/client/views/app/tabbar/visitorHistory.js b/packages/rocketchat-livechat/client/views/app/tabbar/visitorHistory.js index 87efe06b1f4a..9f9b7ae7dec7 100644 --- a/packages/rocketchat-livechat/client/views/app/tabbar/visitorHistory.js +++ b/packages/rocketchat-livechat/client/views/app/tabbar/visitorHistory.js @@ -1,4 +1,5 @@ import { ReactiveVar } from 'meteor/reactive-var'; +import { Mongo } from 'meteor/mongo'; import moment from 'moment'; const visitorHistory = new Mongo.Collection('visitor_history'); diff --git a/packages/rocketchat-livechat/client/views/app/tabbar/visitorNavigation.js b/packages/rocketchat-livechat/client/views/app/tabbar/visitorNavigation.js index 7e6e66dcb66a..acc3307d16cc 100644 --- a/packages/rocketchat-livechat/client/views/app/tabbar/visitorNavigation.js +++ b/packages/rocketchat-livechat/client/views/app/tabbar/visitorNavigation.js @@ -1,4 +1,6 @@ +import { Mongo } from 'meteor/mongo'; import moment from 'moment'; + const visitorNavigationHistory = new Mongo.Collection('visitor_navigation_history'); Template.visitorNavigation.helpers({ diff --git a/packages/rocketchat-mentions-flextab/client/lib/MentionedMessage.js b/packages/rocketchat-mentions-flextab/client/lib/MentionedMessage.js index fffbdd257eba..2f10c002b3b3 100644 --- a/packages/rocketchat-mentions-flextab/client/lib/MentionedMessage.js +++ b/packages/rocketchat-mentions-flextab/client/lib/MentionedMessage.js @@ -1 +1,3 @@ +import { Mongo } from 'meteor/mongo'; + this.MentionedMessage = new Mongo.Collection('rocketchat_mentioned_message'); diff --git a/packages/rocketchat-message-pin/client/lib/PinnedMessage.js b/packages/rocketchat-message-pin/client/lib/PinnedMessage.js index a6c9b072f915..79a571cc6b4a 100644 --- a/packages/rocketchat-message-pin/client/lib/PinnedMessage.js +++ b/packages/rocketchat-message-pin/client/lib/PinnedMessage.js @@ -1 +1,3 @@ +import { Mongo } from 'meteor/mongo'; + this.PinnedMessage = new Mongo.Collection('rocketchat_pinned_message'); diff --git a/packages/rocketchat-message-snippet/client/lib/collections.js b/packages/rocketchat-message-snippet/client/lib/collections.js index 6182ddb3b235..c0091ff67218 100644 --- a/packages/rocketchat-message-snippet/client/lib/collections.js +++ b/packages/rocketchat-message-snippet/client/lib/collections.js @@ -1 +1,3 @@ +import { Mongo } from 'meteor/mongo'; + this.SnippetedMessages = new Mongo.Collection('rocketchat_snippeted_message'); diff --git a/packages/rocketchat-message-star/client/lib/StarredMessage.js b/packages/rocketchat-message-star/client/lib/StarredMessage.js index cd014935ac3f..083be7cd3070 100644 --- a/packages/rocketchat-message-star/client/lib/StarredMessage.js +++ b/packages/rocketchat-message-star/client/lib/StarredMessage.js @@ -1 +1,3 @@ +import { Mongo } from 'meteor/mongo'; + this.StarredMessage = new Mongo.Collection('rocketchat_starred_message'); diff --git a/packages/rocketchat-migrations/migrations.js b/packages/rocketchat-migrations/migrations.js index 298ea76eae9d..a8cfbf6421e7 100644 --- a/packages/rocketchat-migrations/migrations.js +++ b/packages/rocketchat-migrations/migrations.js @@ -2,6 +2,7 @@ /* globals Log*/ import { Meteor } from 'meteor/meteor'; import { Match, check } from 'meteor/check'; +import { Mongo } from 'meteor/mongo'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-oauth2-server-config/admin/client/collection.js b/packages/rocketchat-oauth2-server-config/admin/client/collection.js index f196d7dc17eb..5fbd5c5042c3 100644 --- a/packages/rocketchat-oauth2-server-config/admin/client/collection.js +++ b/packages/rocketchat-oauth2-server-config/admin/client/collection.js @@ -1 +1,3 @@ +import { Mongo } from 'meteor/mongo'; + this.ChatOAuthApps = new Mongo.Collection('rocketchat_oauth_apps'); diff --git a/packages/rocketchat-ui-admin/client/admin.js b/packages/rocketchat-ui-admin/client/admin.js index b0d1ee8fc997..755f4c3346fc 100644 --- a/packages/rocketchat-ui-admin/client/admin.js +++ b/packages/rocketchat-ui-admin/client/admin.js @@ -1,5 +1,6 @@ /* globals jscolor, i18nDefaultQuery */ import { Meteor } from 'meteor/meteor'; +import { Mongo } from 'meteor/mongo'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import _ from 'underscore'; diff --git a/packages/rocketchat-ui-admin/client/rooms/adminRooms.js b/packages/rocketchat-ui-admin/client/rooms/adminRooms.js index 0e9ca6da055e..bc919f9a0512 100644 --- a/packages/rocketchat-ui-admin/client/rooms/adminRooms.js +++ b/packages/rocketchat-ui-admin/client/rooms/adminRooms.js @@ -1,4 +1,5 @@ /* globals AdminChatRoom, RocketChat */ +import { Mongo } from 'meteor/mongo'; import _ from 'underscore'; import { ReactiveVar } from 'meteor/reactive-var'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-flextab/client/tabs/uploadedFilesList.js b/packages/rocketchat-ui-flextab/client/tabs/uploadedFilesList.js index cfbb4e17ebf1..7d677fd9f203 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/uploadedFilesList.js +++ b/packages/rocketchat-ui-flextab/client/tabs/uploadedFilesList.js @@ -1,3 +1,4 @@ +import { Mongo } from 'meteor/mongo'; import { fixCordova } from 'meteor/rocketchat:lazy-load'; import { ReactiveVar } from 'meteor/reactive-var'; import { DateFormat } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js b/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js index 5b10f06f8b32..6c3045357857 100644 --- a/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js +++ b/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Mongo } from 'meteor/mongo'; import _ from 'underscore'; const usersFromRoomMessages = new Mongo.Collection(null); diff --git a/packages/rocketchat-ui/client/lib/collections.js b/packages/rocketchat-ui/client/lib/collections.js index fd04ac7b2e61..f77f224b644c 100644 --- a/packages/rocketchat-ui/client/lib/collections.js +++ b/packages/rocketchat-ui/client/lib/collections.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Mongo } from 'meteor/mongo'; import _ from 'underscore'; this.ChatMessage = new Mongo.Collection(null); diff --git a/packages/rocketchat-webdav/client/collections/WebdavAccounts.js b/packages/rocketchat-webdav/client/collections/WebdavAccounts.js index 9844a1169235..1742fd6c4c09 100644 --- a/packages/rocketchat-webdav/client/collections/WebdavAccounts.js +++ b/packages/rocketchat-webdav/client/collections/WebdavAccounts.js @@ -1 +1,4 @@ + +import { Mongo } from 'meteor/mongo'; + RocketChat.models.WebdavAccounts = new Mongo.Collection('rocketchat_webdav_accounts'); diff --git a/server/startup/migrations/v009.js b/server/startup/migrations/v009.js index 61aaadeec9c4..73469d1db595 100644 --- a/server/startup/migrations/v009.js +++ b/server/startup/migrations/v009.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Mongo } from 'meteor/mongo'; RocketChat.Migrations.add({ version: 9, diff --git a/server/startup/migrations/v015.js b/server/startup/migrations/v015.js index 3add3aacb4cb..040d0953e4cd 100644 --- a/server/startup/migrations/v015.js +++ b/server/startup/migrations/v015.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Mongo } from 'meteor/mongo'; RocketChat.Migrations.add({ version: 15, diff --git a/server/startup/migrations/v042.js b/server/startup/migrations/v042.js index e11db8b7ee2b..e97cb83bf8c9 100644 --- a/server/startup/migrations/v042.js +++ b/server/startup/migrations/v042.js @@ -1,3 +1,5 @@ +import { Mongo } from 'meteor/mongo'; + RocketChat.Migrations.add({ version: 42, up() { diff --git a/server/startup/migrations/v099.js b/server/startup/migrations/v099.js index cdfda628222f..4c736a786daa 100644 --- a/server/startup/migrations/v099.js +++ b/server/startup/migrations/v099.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; +import { Mongo } from 'meteor/mongo'; import fs from 'fs'; import path from 'path'; From c813f5ed0c2d641567caa439e29e2c25878a5c76 Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Wed, 24 Oct 2018 17:13:06 -0300 Subject: [PATCH 16/34] Remove global variable moment --- .eslintrc | 1 - packages/rocketchat-message-snippet/client/page/snippetPage.js | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index 9f0e6819193d..ea97f1a7cca6 100644 --- a/.eslintrc +++ b/.eslintrc @@ -31,7 +31,6 @@ "LivechatTrigger" : false, "Logger" : false, "modal" : false, - "moment" : false, "Npm" : false, "Package" : false, "parentCall" : false, diff --git a/packages/rocketchat-message-snippet/client/page/snippetPage.js b/packages/rocketchat-message-snippet/client/page/snippetPage.js index dbbd77140588..9851dafbe84d 100644 --- a/packages/rocketchat-message-snippet/client/page/snippetPage.js +++ b/packages/rocketchat-message-snippet/client/page/snippetPage.js @@ -1,6 +1,7 @@ /* global SnippetedMessages */ import { Meteor } from 'meteor/meteor'; import { DateFormat } from 'meteor/rocketchat:lib'; +import moment from 'moment'; Template.snippetPage.helpers({ snippet() { From c3b98865cdbac258a8b51f3f4ac6692848ae0511 Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Wed, 24 Oct 2018 17:32:58 -0300 Subject: [PATCH 17/34] Remove global variable Tracker --- .eslintrc | 1 - client/methods/deleteMessage.js | 1 + client/methods/updateMessage.js | 1 + client/notifications/notification.js | 1 + client/routes/router.js | 1 + client/startup/emailVerification.js | 2 ++ client/startup/i18n.js | 1 + client/startup/startup.js | 1 + client/startup/unread.js | 2 ++ client/startup/userSetUtcOffset.js | 1 + imports/personal-access-tokens/client/personalAccessTokens.js | 1 + packages/rocketchat-analytics/client/loadScript.js | 2 ++ packages/rocketchat-authorization/client/views/permissions.js | 1 + packages/rocketchat-autotranslate/client/lib/actionButton.js | 1 + packages/rocketchat-autotranslate/client/lib/autotranslate.js | 1 + packages/rocketchat-autotranslate/client/lib/tabBar.js | 1 + .../rocketchat-channel-settings/client/lib/ChannelSettings.js | 1 + .../client/startup/trackSettingsChange.js | 1 + packages/rocketchat-custom-sounds/client/admin/adminSounds.js | 2 +- packages/rocketchat-dolphin/common.js | 1 + packages/rocketchat-drupal/common.js | 1 + packages/rocketchat-emoji-custom/admin/adminEmoji.js | 1 + packages/rocketchat-emoji-emojione/rocketchat.js | 1 + packages/rocketchat-file-upload/client/lib/fileUploadHandler.js | 1 + packages/rocketchat-github-enterprise/common.js | 1 + packages/rocketchat-gitlab/common.js | 1 + packages/rocketchat-google-vision/client/googlevision.js | 1 + packages/rocketchat-lib/client/AdminBox.js | 1 + packages/rocketchat-lib/client/MessageAction.js | 1 + packages/rocketchat-lib/client/Notifications.js | 1 + packages/rocketchat-lib/client/lib/Layout.js | 2 ++ packages/rocketchat-lib/client/lib/RocketChatTabBar.js | 1 + packages/rocketchat-lib/client/lib/cachedCollection.js | 1 + packages/rocketchat-lib/client/lib/openRoom.js | 1 + packages/rocketchat-lib/client/lib/settings.js | 1 + packages/rocketchat-lib/client/lib/userRoles.js | 1 + packages/rocketchat-lib/client/views/customFieldsForm.js | 1 + packages/rocketchat-livechat/.app/client/lib/CustomFields.js | 1 + packages/rocketchat-livechat/.app/client/lib/_livechat.js | 1 + .../.app/client/lib/fromApp/Notifications.js | 1 + packages/rocketchat-livechat/.app/client/lib/hooks.js | 1 + packages/rocketchat-livechat/.app/client/lib/msgTyping.js | 1 + packages/rocketchat-livechat/.app/client/startup/visitor.js | 1 + .../rocketchat-livechat/client/startup/notifyUnreadRooms.js | 1 + .../client/views/app/analytics/livechatAnalytics.js | 1 + packages/rocketchat-livestream/client/tabBar.js | 1 + packages/rocketchat-message-pin/client/tabBar.js | 1 + packages/rocketchat-message-snippet/client/tabBar/tabBar.js | 1 + packages/rocketchat-otr/client/rocketchat.otr.js | 1 + packages/rocketchat-otr/client/rocketchat.otr.room.js | 1 + packages/rocketchat-otr/client/tabBar.js | 1 + packages/rocketchat-tokenpass/client/tokenChannelsList.js | 1 + packages/rocketchat-tokenpass/common.js | 1 + packages/rocketchat-ui-account/client/account.js | 2 ++ packages/rocketchat-ui-account/client/accountPreferences.js | 1 + packages/rocketchat-ui-account/client/accountProfile.js | 1 + packages/rocketchat-ui-account/client/avatar/prompt.js | 1 + packages/rocketchat-ui-admin/client/admin.js | 1 + packages/rocketchat-ui-admin/client/adminInfo.js | 1 + packages/rocketchat-ui-admin/client/rooms/adminRooms.js | 1 + packages/rocketchat-ui-admin/client/users/adminUsers.js | 1 + .../rocketchat-ui-clean-history/client/views/cleanHistory.js | 1 + packages/rocketchat-ui-flextab/client/tabs/membersList.js | 1 + packages/rocketchat-ui-login/client/login/form.js | 1 + packages/rocketchat-ui-master/client/main.js | 1 + packages/rocketchat-ui-message/client/messageBox.js | 1 + packages/rocketchat-ui-message/client/popup/messagePopup.js | 1 + .../rocketchat-ui-message/client/popup/messagePopupConfig.js | 1 + packages/rocketchat-ui-sidenav/client/chatRoomItem.js | 2 ++ packages/rocketchat-ui-sidenav/client/toolbar.js | 1 + packages/rocketchat-ui/client/lib/RoomManager.js | 1 + packages/rocketchat-ui/client/lib/accountBox.js | 1 + packages/rocketchat-ui/client/lib/chatMessages.js | 1 + packages/rocketchat-ui/client/lib/collections.js | 1 + packages/rocketchat-ui/client/lib/cordova/push.js | 1 + packages/rocketchat-ui/client/lib/fileUpload.js | 1 + packages/rocketchat-ui/client/lib/fireEvent.js | 2 ++ packages/rocketchat-ui/client/lib/msgTyping.js | 1 + packages/rocketchat-ui/client/lib/notification.js | 1 + packages/rocketchat-ui/client/views/app/createChannel.js | 1 + packages/rocketchat-ui/client/views/app/directory.js | 1 + packages/rocketchat-ui/client/views/app/room.js | 1 + packages/rocketchat-version-check/client/client.js | 1 + packages/rocketchat-videobridge/client/tabBar.js | 1 + packages/rocketchat-webdav/startup/messageBoxActions.js | 1 + packages/rocketchat-webrtc/client/WebRTCClass.js | 1 + packages/rocketchat-wordpress/common.js | 1 + 87 files changed, 93 insertions(+), 2 deletions(-) diff --git a/.eslintrc b/.eslintrc index ea97f1a7cca6..b90540e2c8dc 100644 --- a/.eslintrc +++ b/.eslintrc @@ -50,7 +50,6 @@ "Template" : false, "TimeSync" : false, "toastr" : false, - "Tracker" : false, "Trigger" : false, "Triggers" : false, "UAParser" : false, diff --git a/client/methods/deleteMessage.js b/client/methods/deleteMessage.js index 006b837c0206..3988d0cccf21 100644 --- a/client/methods/deleteMessage.js +++ b/client/methods/deleteMessage.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; import moment from 'moment'; diff --git a/client/methods/updateMessage.js b/client/methods/updateMessage.js index 803505ff3aa2..86e40640ce85 100644 --- a/client/methods/updateMessage.js +++ b/client/methods/updateMessage.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; import moment from 'moment'; import toastr from 'toastr'; diff --git a/client/notifications/notification.js b/client/notifications/notification.js index 691fe24bfbd6..e421ba11efe3 100644 --- a/client/notifications/notification.js +++ b/client/notifications/notification.js @@ -1,5 +1,6 @@ /* globals KonchatNotification, fireGlobalEvent, readMessage, CachedChatSubscription */ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; // Show notifications and play a sound for new messages. // We trust the server to only send notifications for interesting messages, e.g. direct messages or diff --git a/client/routes/router.js b/client/routes/router.js index 748f329da75f..147424decced 100644 --- a/client/routes/router.js +++ b/client/routes/router.js @@ -1,6 +1,7 @@ /* globals KonchatNotification */ import { Meteor } from 'meteor/meteor'; import { Accounts } from 'meteor/accounts-base'; +import { Tracker } from 'meteor/tracker'; import s from 'underscore.string'; Blaze.registerHelper('pathFor', function(path, kw) { diff --git a/client/startup/emailVerification.js b/client/startup/emailVerification.js index 7c8c7587666f..364b87e77ed8 100644 --- a/client/startup/emailVerification.js +++ b/client/startup/emailVerification.js @@ -1,5 +1,7 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; import toastr from 'toastr'; + Meteor.startup(function() { Tracker.autorun(function() { const user = Meteor.user(); diff --git a/client/startup/i18n.js b/client/startup/i18n.js index 3819f82c0edd..19e5ce25e34c 100644 --- a/client/startup/i18n.js +++ b/client/startup/i18n.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import moment from 'moment'; const currentLanguage = new ReactiveVar(); diff --git a/client/startup/startup.js b/client/startup/startup.js index 72304967d342..80c6075e0fbb 100644 --- a/client/startup/startup.js +++ b/client/startup/startup.js @@ -1,5 +1,6 @@ /* globals UserPresence, fireGlobalEvent */ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; import toastr from 'toastr'; import hljs from 'highlight.js'; import 'highlight.js/styles/github.css'; diff --git a/client/startup/unread.js b/client/startup/unread.js index 4b51dab637b0..4b7f141db993 100644 --- a/client/startup/unread.js +++ b/client/startup/unread.js @@ -1,5 +1,7 @@ /* globals fireGlobalEvent, readMessage, Favico, favico, menu */ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; + Meteor.startup(function() { Tracker.autorun(function() { let unreadCount = 0; diff --git a/client/startup/userSetUtcOffset.js b/client/startup/userSetUtcOffset.js index cfe05fdc4a70..a266acb05978 100644 --- a/client/startup/userSetUtcOffset.js +++ b/client/startup/userSetUtcOffset.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; import moment from 'moment'; Meteor.startup(function() { diff --git a/imports/personal-access-tokens/client/personalAccessTokens.js b/imports/personal-access-tokens/client/personalAccessTokens.js index e4e7c894e8c8..c7530530e9a4 100644 --- a/imports/personal-access-tokens/client/personalAccessTokens.js +++ b/imports/personal-access-tokens/client/personalAccessTokens.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Mongo } from 'meteor/mongo'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import toastr from 'toastr'; import moment from 'moment'; diff --git a/packages/rocketchat-analytics/client/loadScript.js b/packages/rocketchat-analytics/client/loadScript.js index b70fd29fa62b..d07e263bafc5 100644 --- a/packages/rocketchat-analytics/client/loadScript.js +++ b/packages/rocketchat-analytics/client/loadScript.js @@ -1,4 +1,6 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; + Template.body.onRendered(() => { Tracker.autorun((c) => { const piwikUrl = RocketChat.settings.get('PiwikAnalytics_enabled') && RocketChat.settings.get('PiwikAnalytics_url'); diff --git a/packages/rocketchat-authorization/client/views/permissions.js b/packages/rocketchat-authorization/client/views/permissions.js index b77c8daab9be..4aa6d34850d7 100644 --- a/packages/rocketchat-authorization/client/views/permissions.js +++ b/packages/rocketchat-authorization/client/views/permissions.js @@ -1,6 +1,7 @@ /* globals ChatPermissions */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; Template.permissions.helpers({ role() { diff --git a/packages/rocketchat-autotranslate/client/lib/actionButton.js b/packages/rocketchat-autotranslate/client/lib/actionButton.js index 506a7d99077f..71ba4764e642 100644 --- a/packages/rocketchat-autotranslate/client/lib/actionButton.js +++ b/packages/rocketchat-autotranslate/client/lib/actionButton.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; Meteor.startup(function() { Tracker.autorun(function() { diff --git a/packages/rocketchat-autotranslate/client/lib/autotranslate.js b/packages/rocketchat-autotranslate/client/lib/autotranslate.js index cdfb6f4a56d4..d7d8672c03a6 100644 --- a/packages/rocketchat-autotranslate/client/lib/autotranslate.js +++ b/packages/rocketchat-autotranslate/client/lib/autotranslate.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; RocketChat.AutoTranslate = { diff --git a/packages/rocketchat-autotranslate/client/lib/tabBar.js b/packages/rocketchat-autotranslate/client/lib/tabBar.js index a0b250731338..438f029b0a6f 100644 --- a/packages/rocketchat-autotranslate/client/lib/tabBar.js +++ b/packages/rocketchat-autotranslate/client/lib/tabBar.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; Meteor.startup(function() { Tracker.autorun(function() { diff --git a/packages/rocketchat-channel-settings/client/lib/ChannelSettings.js b/packages/rocketchat-channel-settings/client/lib/ChannelSettings.js index d5ec4375bef8..b3e0cb815864 100644 --- a/packages/rocketchat-channel-settings/client/lib/ChannelSettings.js +++ b/packages/rocketchat-channel-settings/client/lib/ChannelSettings.js @@ -1,4 +1,5 @@ import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; RocketChat.ChannelSettings = new class { diff --git a/packages/rocketchat-channel-settings/client/startup/trackSettingsChange.js b/packages/rocketchat-channel-settings/client/startup/trackSettingsChange.js index ad493f1f3867..741944e4e47b 100644 --- a/packages/rocketchat-channel-settings/client/startup/trackSettingsChange.js +++ b/packages/rocketchat-channel-settings/client/startup/trackSettingsChange.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; Meteor.startup(function() { const roomSettingsChangedCallback = (msg) => { diff --git a/packages/rocketchat-custom-sounds/client/admin/adminSounds.js b/packages/rocketchat-custom-sounds/client/admin/adminSounds.js index 61f3ba8c463a..fba5e8c831d5 100644 --- a/packages/rocketchat-custom-sounds/client/admin/adminSounds.js +++ b/packages/rocketchat-custom-sounds/client/admin/adminSounds.js @@ -1,7 +1,7 @@ import s from 'underscore.string'; import { ReactiveVar } from 'meteor/reactive-var'; - import { RocketChatTabBar } from 'meteor/rocketchat:lib'; +import { Tracker } from 'meteor/tracker'; Template.adminSounds.helpers({ isReady() { diff --git a/packages/rocketchat-dolphin/common.js b/packages/rocketchat-dolphin/common.js index 2500b703937c..6ebd8602b80b 100644 --- a/packages/rocketchat-dolphin/common.js +++ b/packages/rocketchat-dolphin/common.js @@ -1,6 +1,7 @@ // Dolphin OAuth2 /* globals CustomOAuth */ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; const config = { serverURL: '', diff --git a/packages/rocketchat-drupal/common.js b/packages/rocketchat-drupal/common.js index 1aac96edf577..c18895806e41 100644 --- a/packages/rocketchat-drupal/common.js +++ b/packages/rocketchat-drupal/common.js @@ -1,5 +1,6 @@ /* global CustomOAuth */ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; // Drupal Server CallBack URL needs to be http(s)://{rocketchat.server}[:port]/_oauth/drupal // In RocketChat -> Administration the URL needs to be http(s)://{drupal.server}/ diff --git a/packages/rocketchat-emoji-custom/admin/adminEmoji.js b/packages/rocketchat-emoji-custom/admin/adminEmoji.js index 7071f93e5761..b248771e970d 100644 --- a/packages/rocketchat-emoji-custom/admin/adminEmoji.js +++ b/packages/rocketchat-emoji-custom/admin/adminEmoji.js @@ -1,6 +1,7 @@ import s from 'underscore.string'; import { ReactiveVar } from 'meteor/reactive-var'; import { RocketChatTabBar } from 'meteor/rocketchat:lib'; +import { Tracker } from 'meteor/tracker'; Template.adminEmoji.helpers({ isReady() { diff --git a/packages/rocketchat-emoji-emojione/rocketchat.js b/packages/rocketchat-emoji-emojione/rocketchat.js index 6bc8b22fb634..f2636c6ff451 100644 --- a/packages/rocketchat-emoji-emojione/rocketchat.js +++ b/packages/rocketchat-emoji-emojione/rocketchat.js @@ -1,5 +1,6 @@ /* globals emojione, emojisByCategory, emojiCategories, toneList */ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; RocketChat.emoji.packages.emojione = emojione; RocketChat.emoji.packages.emojione.imageType = 'png'; diff --git a/packages/rocketchat-file-upload/client/lib/fileUploadHandler.js b/packages/rocketchat-file-upload/client/lib/fileUploadHandler.js index b6e2f55310cc..0ad23ff54dbd 100644 --- a/packages/rocketchat-file-upload/client/lib/fileUploadHandler.js +++ b/packages/rocketchat-file-upload/client/lib/fileUploadHandler.js @@ -2,6 +2,7 @@ /* exported fileUploadHandler */ import { Meteor } from 'meteor/meteor'; import { Accounts } from 'meteor/accounts-base'; +import { Tracker } from 'meteor/tracker'; new UploadFS.Store({ collection: RocketChat.models.Uploads.model, diff --git a/packages/rocketchat-github-enterprise/common.js b/packages/rocketchat-github-enterprise/common.js index 3bdcf9977a85..39dfc05b140a 100644 --- a/packages/rocketchat-github-enterprise/common.js +++ b/packages/rocketchat-github-enterprise/common.js @@ -1,5 +1,6 @@ /* global CustomOAuth */ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; // GitHub Enterprise Server CallBack URL needs to be http(s)://{rocketchat.server}[:port]/_oauth/github_enterprise // In RocketChat -> Administration the URL needs to be http(s)://{github.enterprise.server}/ diff --git a/packages/rocketchat-gitlab/common.js b/packages/rocketchat-gitlab/common.js index 96a920952e6b..56fd0f24ea1a 100644 --- a/packages/rocketchat-gitlab/common.js +++ b/packages/rocketchat-gitlab/common.js @@ -1,5 +1,6 @@ /* global CustomOAuth */ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; const config = { serverURL: 'https://gitlab.com', diff --git a/packages/rocketchat-google-vision/client/googlevision.js b/packages/rocketchat-google-vision/client/googlevision.js index 16de6ceedc15..a8a21b3b8d0d 100644 --- a/packages/rocketchat-google-vision/client/googlevision.js +++ b/packages/rocketchat-google-vision/client/googlevision.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; RocketChat.GoogleVision = { getVisionAttributes(attachment) { diff --git a/packages/rocketchat-lib/client/AdminBox.js b/packages/rocketchat-lib/client/AdminBox.js index 15253eb648b6..5cb3438bb26c 100644 --- a/packages/rocketchat-lib/client/AdminBox.js +++ b/packages/rocketchat-lib/client/AdminBox.js @@ -1,4 +1,5 @@ import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; RocketChat.AdminBox = new class { diff --git a/packages/rocketchat-lib/client/MessageAction.js b/packages/rocketchat-lib/client/MessageAction.js index 7e891f19d5ed..9b787b07dbac 100644 --- a/packages/rocketchat-lib/client/MessageAction.js +++ b/packages/rocketchat-lib/client/MessageAction.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; import moment from 'moment'; import toastr from 'toastr'; diff --git a/packages/rocketchat-lib/client/Notifications.js b/packages/rocketchat-lib/client/Notifications.js index 86e0e2727dce..e24840f2baae 100644 --- a/packages/rocketchat-lib/client/Notifications.js +++ b/packages/rocketchat-lib/client/Notifications.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; RocketChat.Notifications = new class { constructor(...args) { diff --git a/packages/rocketchat-lib/client/lib/Layout.js b/packages/rocketchat-lib/client/lib/Layout.js index 3e231a4d8661..385e6e12fad3 100644 --- a/packages/rocketchat-lib/client/lib/Layout.js +++ b/packages/rocketchat-lib/client/lib/Layout.js @@ -1,3 +1,5 @@ +import { Tracker } from 'meteor/tracker'; + RocketChat.Layout = new (class RocketChatLayout { constructor() { Tracker.autorun(() => { diff --git a/packages/rocketchat-lib/client/lib/RocketChatTabBar.js b/packages/rocketchat-lib/client/lib/RocketChatTabBar.js index c891c13278cd..9f6301d955e1 100644 --- a/packages/rocketchat-lib/client/lib/RocketChatTabBar.js +++ b/packages/rocketchat-lib/client/lib/RocketChatTabBar.js @@ -1,4 +1,5 @@ import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; export class RocketChatTabBar { constructor() { diff --git a/packages/rocketchat-lib/client/lib/cachedCollection.js b/packages/rocketchat-lib/client/lib/cachedCollection.js index 04620b33790e..7a2609e663fb 100644 --- a/packages/rocketchat-lib/client/lib/cachedCollection.js +++ b/packages/rocketchat-lib/client/lib/cachedCollection.js @@ -3,6 +3,7 @@ import { check } from 'meteor/check'; import { Mongo } from 'meteor/mongo'; import { Accounts } from 'meteor/accounts-base'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import localforage from 'localforage'; import _ from 'underscore'; diff --git a/packages/rocketchat-lib/client/lib/openRoom.js b/packages/rocketchat-lib/client/lib/openRoom.js index abaa75cb12e4..c602aefbf301 100644 --- a/packages/rocketchat-lib/client/lib/openRoom.js +++ b/packages/rocketchat-lib/client/lib/openRoom.js @@ -1,5 +1,6 @@ /* globals fireGlobalEvent readMessage currentTracker*/ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; currentTracker = undefined; diff --git a/packages/rocketchat-lib/client/lib/settings.js b/packages/rocketchat-lib/client/lib/settings.js index 4d4bd241b3d8..7516f5aef277 100644 --- a/packages/rocketchat-lib/client/lib/settings.js +++ b/packages/rocketchat-lib/client/lib/settings.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; /* * RocketChat.settings holds all packages settings diff --git a/packages/rocketchat-lib/client/lib/userRoles.js b/packages/rocketchat-lib/client/lib/userRoles.js index 585acdb0f322..11a1380aeb63 100644 --- a/packages/rocketchat-lib/client/lib/userRoles.js +++ b/packages/rocketchat-lib/client/lib/userRoles.js @@ -1,5 +1,6 @@ /* globals UserRoles, RoomRoles */ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; Meteor.startup(function() { Tracker.autorun(function() { diff --git a/packages/rocketchat-lib/client/views/customFieldsForm.js b/packages/rocketchat-lib/client/views/customFieldsForm.js index f631f6400bdc..40b4f4873eba 100644 --- a/packages/rocketchat-lib/client/views/customFieldsForm.js +++ b/packages/rocketchat-lib/client/views/customFieldsForm.js @@ -1,4 +1,5 @@ import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; Template.customFieldsForm.helpers({ new() { diff --git a/packages/rocketchat-livechat/.app/client/lib/CustomFields.js b/packages/rocketchat-livechat/.app/client/lib/CustomFields.js index fe1bb0df99a1..f9968cfe2223 100644 --- a/packages/rocketchat-livechat/.app/client/lib/CustomFields.js +++ b/packages/rocketchat-livechat/.app/client/lib/CustomFields.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; import visitor from '../../imports/client/visitor'; this.CustomFields = (function() { diff --git a/packages/rocketchat-livechat/.app/client/lib/_livechat.js b/packages/rocketchat-livechat/.app/client/lib/_livechat.js index ee2ab10a6cab..d2eeca5eb322 100644 --- a/packages/rocketchat-livechat/.app/client/lib/_livechat.js +++ b/packages/rocketchat-livechat/.app/client/lib/_livechat.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import visitor from '../../imports/client/visitor'; this.Livechat = new (class Livechat { diff --git a/packages/rocketchat-livechat/.app/client/lib/fromApp/Notifications.js b/packages/rocketchat-livechat/.app/client/lib/fromApp/Notifications.js index 4a544ca9678f..4dcdab907990 100644 --- a/packages/rocketchat-livechat/.app/client/lib/fromApp/Notifications.js +++ b/packages/rocketchat-livechat/.app/client/lib/fromApp/Notifications.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; import visitor from '../../../imports/client/visitor'; this.Notifications = new class { diff --git a/packages/rocketchat-livechat/.app/client/lib/hooks.js b/packages/rocketchat-livechat/.app/client/lib/hooks.js index 862417b1c185..4f66f2aec9fe 100644 --- a/packages/rocketchat-livechat/.app/client/lib/hooks.js +++ b/packages/rocketchat-livechat/.app/client/lib/hooks.js @@ -1,6 +1,7 @@ /* globals CustomFields, Livechat */ import { Meteor } from 'meteor/meteor'; import { Random } from 'meteor/random'; +import { Tracker } from 'meteor/tracker'; import visitor from '../../imports/client/visitor'; const api = { diff --git a/packages/rocketchat-livechat/.app/client/lib/msgTyping.js b/packages/rocketchat-livechat/.app/client/lib/msgTyping.js index ee50da90fa22..1231daad287f 100644 --- a/packages/rocketchat-livechat/.app/client/lib/msgTyping.js +++ b/packages/rocketchat-livechat/.app/client/lib/msgTyping.js @@ -1,6 +1,7 @@ /* globals Notifications, Livechat */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import visitor from '../../imports/client/visitor'; import _ from 'underscore'; diff --git a/packages/rocketchat-livechat/.app/client/startup/visitor.js b/packages/rocketchat-livechat/.app/client/startup/visitor.js index 6bf40b2579e9..f30e4cc806cd 100644 --- a/packages/rocketchat-livechat/.app/client/startup/visitor.js +++ b/packages/rocketchat-livechat/.app/client/startup/visitor.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Random } from 'meteor/random'; +import { Tracker } from 'meteor/tracker'; import visitor from '../../imports/client/visitor'; Meteor.startup(() => { diff --git a/packages/rocketchat-livechat/client/startup/notifyUnreadRooms.js b/packages/rocketchat-livechat/client/startup/notifyUnreadRooms.js index b2330ad5e00c..dada344aa3f6 100644 --- a/packages/rocketchat-livechat/client/startup/notifyUnreadRooms.js +++ b/packages/rocketchat-livechat/client/startup/notifyUnreadRooms.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; let audio = null; diff --git a/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalytics.js b/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalytics.js index bf22bcfd3035..5511dafb5ae4 100644 --- a/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalytics.js +++ b/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalytics.js @@ -1,6 +1,7 @@ /* globals popover */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import moment from 'moment'; import { drawLineChart } from '../../../lib/chartHandler'; diff --git a/packages/rocketchat-livestream/client/tabBar.js b/packages/rocketchat-livestream/client/tabBar.js index d3efa341e945..28a3d45e3a69 100644 --- a/packages/rocketchat-livestream/client/tabBar.js +++ b/packages/rocketchat-livestream/client/tabBar.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; Meteor.startup(function() { Tracker.autorun(function() { diff --git a/packages/rocketchat-message-pin/client/tabBar.js b/packages/rocketchat-message-pin/client/tabBar.js index fccd92eb2a3d..879f5b6ca2a8 100644 --- a/packages/rocketchat-message-pin/client/tabBar.js +++ b/packages/rocketchat-message-pin/client/tabBar.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; Meteor.startup(function() { return Tracker.autorun(function() { diff --git a/packages/rocketchat-message-snippet/client/tabBar/tabBar.js b/packages/rocketchat-message-snippet/client/tabBar/tabBar.js index 3c7763d409b4..850f8ba5fc75 100644 --- a/packages/rocketchat-message-snippet/client/tabBar/tabBar.js +++ b/packages/rocketchat-message-snippet/client/tabBar/tabBar.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; Meteor.startup(function() { Tracker.autorun(function() { diff --git a/packages/rocketchat-otr/client/rocketchat.otr.js b/packages/rocketchat-otr/client/rocketchat.otr.js index e167ea328a7d..f0ce0a582017 100644 --- a/packages/rocketchat-otr/client/rocketchat.otr.js +++ b/packages/rocketchat-otr/client/rocketchat.otr.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; class OTR { constructor() { diff --git a/packages/rocketchat-otr/client/rocketchat.otr.room.js b/packages/rocketchat-otr/client/rocketchat.otr.room.js index a2dd3f4b6f9c..2a68e0a31de7 100644 --- a/packages/rocketchat-otr/client/rocketchat.otr.room.js +++ b/packages/rocketchat-otr/client/rocketchat.otr.room.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import { EJSON } from 'meteor/ejson'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; import toastr from 'toastr'; /* globals crypto */ diff --git a/packages/rocketchat-otr/client/tabBar.js b/packages/rocketchat-otr/client/tabBar.js index 42806dd4a2e6..9ea07136c7c8 100644 --- a/packages/rocketchat-otr/client/tabBar.js +++ b/packages/rocketchat-otr/client/tabBar.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; Meteor.startup(function() { Tracker.autorun(function() { diff --git a/packages/rocketchat-tokenpass/client/tokenChannelsList.js b/packages/rocketchat-tokenpass/client/tokenChannelsList.js index 505c3a1d7805..9ca7ba12ec70 100644 --- a/packages/rocketchat-tokenpass/client/tokenChannelsList.js +++ b/packages/rocketchat-tokenpass/client/tokenChannelsList.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; Template.tokenChannelsList.helpers({ rooms() { diff --git a/packages/rocketchat-tokenpass/common.js b/packages/rocketchat-tokenpass/common.js index 26f41eb15b8f..ecc3d6ddc319 100644 --- a/packages/rocketchat-tokenpass/common.js +++ b/packages/rocketchat-tokenpass/common.js @@ -1,5 +1,6 @@ /* global CustomOAuth */ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; const config = { serverURL: '', diff --git a/packages/rocketchat-ui-account/client/account.js b/packages/rocketchat-ui-account/client/account.js index 214d55abe8c6..561564d499d9 100644 --- a/packages/rocketchat-ui-account/client/account.js +++ b/packages/rocketchat-ui-account/client/account.js @@ -1,3 +1,5 @@ +import { Tracker } from 'meteor/tracker'; + Template.account.onRendered(function() { Tracker.afterFlush(function() { SideNav.setFlex('accountFlex'); diff --git a/packages/rocketchat-ui-account/client/accountPreferences.js b/packages/rocketchat-ui-account/client/accountPreferences.js index 03a5c77fed59..c9af7737e24a 100644 --- a/packages/rocketchat-ui-account/client/accountPreferences.js +++ b/packages/rocketchat-ui-account/client/accountPreferences.js @@ -1,6 +1,7 @@ /* globals KonchatNotification */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-account/client/accountProfile.js b/packages/rocketchat-ui-account/client/accountProfile.js index 7fdda834c7a3..b59c68541dde 100644 --- a/packages/rocketchat-ui-account/client/accountProfile.js +++ b/packages/rocketchat-ui-account/client/accountProfile.js @@ -1,6 +1,7 @@ import { SHA256 } from 'meteor/sha'; import { ReactiveVar } from 'meteor/reactive-var'; import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-account/client/avatar/prompt.js b/packages/rocketchat-ui-account/client/avatar/prompt.js index a3ac7cf4ea2b..bd1e8a9cbde6 100644 --- a/packages/rocketchat-ui-account/client/avatar/prompt.js +++ b/packages/rocketchat-ui-account/client/avatar/prompt.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import s from 'underscore.string'; import toastr from 'toastr'; import mime from 'mime-type/with-db'; diff --git a/packages/rocketchat-ui-admin/client/admin.js b/packages/rocketchat-ui-admin/client/admin.js index 755f4c3346fc..206fa2faaf6c 100644 --- a/packages/rocketchat-ui-admin/client/admin.js +++ b/packages/rocketchat-ui-admin/client/admin.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { Mongo } from 'meteor/mongo'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-admin/client/adminInfo.js b/packages/rocketchat-ui-admin/client/adminInfo.js index f6afb15fdb6b..578ea470c4b4 100644 --- a/packages/rocketchat-ui-admin/client/adminInfo.js +++ b/packages/rocketchat-ui-admin/client/adminInfo.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-ui-admin/client/rooms/adminRooms.js b/packages/rocketchat-ui-admin/client/rooms/adminRooms.js index bc919f9a0512..34ea97fb89cd 100644 --- a/packages/rocketchat-ui-admin/client/rooms/adminRooms.js +++ b/packages/rocketchat-ui-admin/client/rooms/adminRooms.js @@ -1,5 +1,6 @@ /* globals AdminChatRoom, RocketChat */ import { Mongo } from 'meteor/mongo'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; import { ReactiveVar } from 'meteor/reactive-var'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-admin/client/users/adminUsers.js b/packages/rocketchat-ui-admin/client/users/adminUsers.js index e6637e38264f..4be5e52da3aa 100644 --- a/packages/rocketchat-ui-admin/client/users/adminUsers.js +++ b/packages/rocketchat-ui-admin/client/users/adminUsers.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js b/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js index d1e62a41b65a..054f345129bb 100644 --- a/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js +++ b/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js @@ -1,4 +1,5 @@ /* globals AutoComplete */ +import { Tracker } from 'meteor/tracker'; import moment from 'moment'; import { ReactiveVar } from 'meteor/reactive-var'; diff --git a/packages/rocketchat-ui-flextab/client/tabs/membersList.js b/packages/rocketchat-ui-flextab/client/tabs/membersList.js index 0561bab537e7..4d89e826a417 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/membersList.js +++ b/packages/rocketchat-ui-flextab/client/tabs/membersList.js @@ -1,6 +1,7 @@ /* globals WebRTC popover isRtl */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; import { getActions } from './userActions'; diff --git a/packages/rocketchat-ui-login/client/login/form.js b/packages/rocketchat-ui-login/client/login/form.js index 4afce63c4d9d..077a23ae85fe 100644 --- a/packages/rocketchat-ui-login/client/login/form.js +++ b/packages/rocketchat-ui-login/client/login/form.js @@ -1,6 +1,7 @@ /* globals OnePassword, device */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-master/client/main.js b/packages/rocketchat-ui-master/client/main.js index c69ecf0145b7..fad29e6f8480 100644 --- a/packages/rocketchat-ui-master/client/main.js +++ b/packages/rocketchat-ui-master/client/main.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import Clipboard from 'clipboard'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-message/client/messageBox.js b/packages/rocketchat-ui-message/client/messageBox.js index ea5e76811264..22310f48a101 100644 --- a/packages/rocketchat-ui-message/client/messageBox.js +++ b/packages/rocketchat-ui-message/client/messageBox.js @@ -1,6 +1,7 @@ /* globals fileUpload KonchatNotification chatMessages popover AudioRecorder chatMessages fileUploadHandler*/ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import toastr from 'toastr'; import moment from 'moment'; import _ from 'underscore'; diff --git a/packages/rocketchat-ui-message/client/popup/messagePopup.js b/packages/rocketchat-ui-message/client/popup/messagePopup.js index 902327d963b9..8d44708cf0f3 100644 --- a/packages/rocketchat-ui-message/client/popup/messagePopup.js +++ b/packages/rocketchat-ui-message/client/popup/messagePopup.js @@ -4,6 +4,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; import { lazyloadtick } from 'meteor/rocketchat:lazy-load'; diff --git a/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js b/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js index 6c3045357857..c56ecbccec4a 100644 --- a/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js +++ b/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Mongo } from 'meteor/mongo'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; const usersFromRoomMessages = new Mongo.Collection(null); diff --git a/packages/rocketchat-ui-sidenav/client/chatRoomItem.js b/packages/rocketchat-ui-sidenav/client/chatRoomItem.js index c88b7903d363..acf630abce83 100644 --- a/packages/rocketchat-ui-sidenav/client/chatRoomItem.js +++ b/packages/rocketchat-ui-sidenav/client/chatRoomItem.js @@ -1,3 +1,5 @@ +import { Tracker } from 'meteor/tracker'; + Template.chatRoomItem.helpers({ roomData() { let { name } = this; diff --git a/packages/rocketchat-ui-sidenav/client/toolbar.js b/packages/rocketchat-ui-sidenav/client/toolbar.js index 838494996070..da1e23689453 100644 --- a/packages/rocketchat-ui-sidenav/client/toolbar.js +++ b/packages/rocketchat-ui-sidenav/client/toolbar.js @@ -2,6 +2,7 @@ /* global menu */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; let isLoading; diff --git a/packages/rocketchat-ui/client/lib/RoomManager.js b/packages/rocketchat-ui/client/lib/RoomManager.js index 0a4e11960883..7868698be264 100644 --- a/packages/rocketchat-ui/client/lib/RoomManager.js +++ b/packages/rocketchat-ui/client/lib/RoomManager.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; import { upsertMessage } from './RoomHistoryManager'; diff --git a/packages/rocketchat-ui/client/lib/accountBox.js b/packages/rocketchat-ui/client/lib/accountBox.js index de096a06f023..9895a948e12f 100644 --- a/packages/rocketchat-ui/client/lib/accountBox.js +++ b/packages/rocketchat-ui/client/lib/accountBox.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; this.AccountBox = (function() { diff --git a/packages/rocketchat-ui/client/lib/chatMessages.js b/packages/rocketchat-ui/client/lib/chatMessages.js index 7494bcec7662..7eec56942814 100644 --- a/packages/rocketchat-ui/client/lib/chatMessages.js +++ b/packages/rocketchat-ui/client/lib/chatMessages.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-ui/client/lib/collections.js b/packages/rocketchat-ui/client/lib/collections.js index f77f224b644c..d350d3e7cd99 100644 --- a/packages/rocketchat-ui/client/lib/collections.js +++ b/packages/rocketchat-ui/client/lib/collections.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Mongo } from 'meteor/mongo'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; this.ChatMessage = new Mongo.Collection(null); diff --git a/packages/rocketchat-ui/client/lib/cordova/push.js b/packages/rocketchat-ui/client/lib/cordova/push.js index d597ca07296c..ca0416d1e380 100644 --- a/packages/rocketchat-ui/client/lib/cordova/push.js +++ b/packages/rocketchat-ui/client/lib/cordova/push.js @@ -1,5 +1,6 @@ /* globals Push Servers*/ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; if (Meteor.isCordova) { // Push.addListener 'token', (token) -> diff --git a/packages/rocketchat-ui/client/lib/fileUpload.js b/packages/rocketchat-ui/client/lib/fileUpload.js index 50e674692d7d..1dbca636d794 100644 --- a/packages/rocketchat-ui/client/lib/fileUpload.js +++ b/packages/rocketchat-ui/client/lib/fileUpload.js @@ -1,6 +1,7 @@ /* globals fileUploadHandler, Handlebars, fileUpload, modal, t */ /* exported fileUpload */ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; import s from 'underscore.string'; const readAsDataURL = (file, callback) => { diff --git a/packages/rocketchat-ui/client/lib/fireEvent.js b/packages/rocketchat-ui/client/lib/fireEvent.js index 229bd6693c36..0c0cc7b646f0 100644 --- a/packages/rocketchat-ui/client/lib/fireEvent.js +++ b/packages/rocketchat-ui/client/lib/fireEvent.js @@ -1,3 +1,5 @@ +import { Tracker } from 'meteor/tracker'; + window.fireGlobalEvent = function _fireGlobalEvent(eventName, params) { window.dispatchEvent(new CustomEvent(eventName, { detail: params })); diff --git a/packages/rocketchat-ui/client/lib/msgTyping.js b/packages/rocketchat-ui/client/lib/msgTyping.js index 621c5a623bb9..d942c812d229 100644 --- a/packages/rocketchat-ui/client/lib/msgTyping.js +++ b/packages/rocketchat-ui/client/lib/msgTyping.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; import { ReactiveVar } from 'meteor/reactive-var'; import _ from 'underscore'; diff --git a/packages/rocketchat-ui/client/lib/notification.js b/packages/rocketchat-ui/client/lib/notification.js index ba8796d41ad5..50f847114de8 100644 --- a/packages/rocketchat-ui/client/lib/notification.js +++ b/packages/rocketchat-ui/client/lib/notification.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; import s from 'underscore.string'; import { e2e } from 'meteor/rocketchat:e2e'; diff --git a/packages/rocketchat-ui/client/views/app/createChannel.js b/packages/rocketchat-ui/client/views/app/createChannel.js index c84097acb76d..980ea64b7421 100644 --- a/packages/rocketchat-ui/client/views/app/createChannel.js +++ b/packages/rocketchat-ui/client/views/app/createChannel.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; const acEvents = { diff --git a/packages/rocketchat-ui/client/views/app/directory.js b/packages/rocketchat-ui/client/views/app/directory.js index d206f0fb1d55..fbb1847c34fc 100644 --- a/packages/rocketchat-ui/client/views/app/directory.js +++ b/packages/rocketchat-ui/client/views/app/directory.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; import { timeAgo } from './helpers'; diff --git a/packages/rocketchat-ui/client/views/app/room.js b/packages/rocketchat-ui/client/views/app/room.js index e0be722dc5f8..e4a10dc10c99 100644 --- a/packages/rocketchat-ui/client/views/app/room.js +++ b/packages/rocketchat-ui/client/views/app/room.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; +import { Tracker } from 'meteor/tracker'; import { RocketChatTabBar } from 'meteor/rocketchat:lib'; import _ from 'underscore'; diff --git a/packages/rocketchat-version-check/client/client.js b/packages/rocketchat-version-check/client/client.js index d7b7217d8604..0a6f8c156ce6 100644 --- a/packages/rocketchat-version-check/client/client.js +++ b/packages/rocketchat-version-check/client/client.js @@ -1,5 +1,6 @@ /* globals alerts */ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; Meteor.startup(function() { Tracker.autorun(() => { diff --git a/packages/rocketchat-videobridge/client/tabBar.js b/packages/rocketchat-videobridge/client/tabBar.js index f33e071fb68f..0de3bd29e685 100644 --- a/packages/rocketchat-videobridge/client/tabBar.js +++ b/packages/rocketchat-videobridge/client/tabBar.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; Meteor.startup(function() { diff --git a/packages/rocketchat-webdav/startup/messageBoxActions.js b/packages/rocketchat-webdav/startup/messageBoxActions.js index 8695122ccdf4..c8ccf193b429 100644 --- a/packages/rocketchat-webdav/startup/messageBoxActions.js +++ b/packages/rocketchat-webdav/startup/messageBoxActions.js @@ -1,5 +1,6 @@ /* globals modal, RocketChat */ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; RocketChat.messageBox.actions.add('WebDAV', 'Add Server', { id: 'add-webdav', diff --git a/packages/rocketchat-webrtc/client/WebRTCClass.js b/packages/rocketchat-webrtc/client/WebRTCClass.js index adb6b79bc54f..c2157b0572e2 100644 --- a/packages/rocketchat-webrtc/client/WebRTCClass.js +++ b/packages/rocketchat-webrtc/client/WebRTCClass.js @@ -1,5 +1,6 @@ /* globals chrome, ChromeScreenShare */ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; import { ReactiveVar } from 'meteor/reactive-var'; class WebRTCTransportClass { diff --git a/packages/rocketchat-wordpress/common.js b/packages/rocketchat-wordpress/common.js index b86878542583..7bd8bf3090bd 100644 --- a/packages/rocketchat-wordpress/common.js +++ b/packages/rocketchat-wordpress/common.js @@ -1,5 +1,6 @@ /* globals CustomOAuth */ import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; const config = { From a3e965f41f0eb246c9c6cfc82029949bfe317f08 Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Thu, 25 Oct 2018 10:09:04 -0300 Subject: [PATCH 18/34] Remove global variable Blaze --- .eslintrc | 1 - client/routes/router.js | 1 + packages/meteor-autocomplete/client/autocomplete-client.js | 1 + packages/meteor-autocomplete/client/templates.js | 1 + packages/rocketchat-action-links/client/init.js | 2 ++ .../client/resetSelection.js | 2 ++ .../client/views/mailMessagesInstructions.js | 1 + packages/rocketchat-emoji-custom/client/lib/emojiCustom.js | 1 + packages/rocketchat-emoji/client/lib/emojiRenderer.js | 2 ++ packages/rocketchat-katex/katex.js | 1 + packages/rocketchat-lazy-load/client/index.js | 2 ++ packages/rocketchat-lib/client/lib/roomExit.js | 2 ++ packages/rocketchat-livechat/.app/client/lib/commands.js | 1 + .../.app/client/lib/fromApp/RoomHistoryManager.js | 1 + packages/rocketchat-livechat/.app/client/views/message.js | 1 + packages/rocketchat-livestream/client/views/liveStreamTab.js | 1 + packages/rocketchat-oembed/client/oembedUrlWidget.js | 1 + packages/rocketchat-reactions/client/init.js | 1 + .../rocketchat-ui-clean-history/client/views/cleanHistory.js | 1 + packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js | 1 + packages/rocketchat-ui-message/client/message.js | 1 + .../rocketchat-ui-message/client/popup/messagePopupConfig.js | 1 + packages/rocketchat-ui-vrecord/client/VRecDialog.js | 1 + packages/rocketchat-ui/client/lib/RoomHistoryManager.js | 1 + packages/rocketchat-ui/client/lib/RoomManager.js | 1 + packages/rocketchat-ui/client/lib/avatar.js | 2 ++ packages/rocketchat-ui/client/lib/modal.js | 2 ++ packages/rocketchat-ui/client/lib/parentTemplate.js | 2 ++ packages/rocketchat-ui/client/views/404/roomNotFound.js | 1 + packages/rocketchat-ui/client/views/app/alerts.js | 2 ++ packages/rocketchat-ui/client/views/app/createChannel.js | 1 + packages/rocketchat-ui/client/views/app/fullModal.js | 1 + packages/rocketchat-ui/client/views/app/modal.js | 1 + packages/rocketchat-ui/client/views/app/popout.js | 1 + packages/rocketchat-ui/client/views/app/popover.js | 1 + packages/rocketchat-ui/client/views/app/room.js | 1 + 36 files changed, 44 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index b90540e2c8dc..0c4917af74d7 100644 --- a/.eslintrc +++ b/.eslintrc @@ -7,7 +7,6 @@ "AgentUsers" : false, "Apps" : false, "Assets" : false, - "Blaze" : false, "BlazeLayout" : false, "browser" : false, "ChatMessage" : false, diff --git a/client/routes/router.js b/client/routes/router.js index 147424decced..ef25e75b89e1 100644 --- a/client/routes/router.js +++ b/client/routes/router.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { Accounts } from 'meteor/accounts-base'; import { Tracker } from 'meteor/tracker'; +import { Blaze } from 'meteor/blaze'; import s from 'underscore.string'; Blaze.registerHelper('pathFor', function(path, kw) { diff --git a/packages/meteor-autocomplete/client/autocomplete-client.js b/packages/meteor-autocomplete/client/autocomplete-client.js index a861d5289a5b..2476c42db373 100755 --- a/packages/meteor-autocomplete/client/autocomplete-client.js +++ b/packages/meteor-autocomplete/client/autocomplete-client.js @@ -1,6 +1,7 @@ /* globals Deps, getCaretCoordinates*/ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; +import { Blaze } from 'meteor/blaze'; import _ from 'underscore'; import AutoCompleteRecords from './collection'; diff --git a/packages/meteor-autocomplete/client/templates.js b/packages/meteor-autocomplete/client/templates.js index 4ed6be7fca72..f09892f6b2b7 100755 --- a/packages/meteor-autocomplete/client/templates.js +++ b/packages/meteor-autocomplete/client/templates.js @@ -1,4 +1,5 @@ /* globals AutoComplete */ +import { Blaze } from 'meteor/blaze'; import _ from 'underscore'; // Events on template instances, sent to the autocomplete class diff --git a/packages/rocketchat-action-links/client/init.js b/packages/rocketchat-action-links/client/init.js index 6ef0a25fc88f..9a5969e84285 100644 --- a/packages/rocketchat-action-links/client/init.js +++ b/packages/rocketchat-action-links/client/init.js @@ -1,4 +1,6 @@ /* globals fireGlobalEvent */ +import { Blaze } from 'meteor/blaze'; + Template.room.events({ 'click .action-link'(event, instance) { event.preventDefault(); diff --git a/packages/rocketchat-channel-settings-mail-messages/client/resetSelection.js b/packages/rocketchat-channel-settings-mail-messages/client/resetSelection.js index a8493df545d0..ef62124d9c7c 100644 --- a/packages/rocketchat-channel-settings-mail-messages/client/resetSelection.js +++ b/packages/rocketchat-channel-settings-mail-messages/client/resetSelection.js @@ -1,3 +1,5 @@ +import { Blaze } from 'meteor/blaze'; + export default function resetSelection(reset) { const [el] = $('.messages-box'); if (!el) { diff --git a/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js b/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js index 41363fa2bc3b..c76793bce75a 100644 --- a/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js +++ b/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js @@ -1,6 +1,7 @@ /* global AutoComplete Deps */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Blaze } from 'meteor/blaze'; import toastr from 'toastr'; import resetSelection from '../resetSelection'; diff --git a/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js b/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js index c7e3af1786b0..fc7669498b41 100644 --- a/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js +++ b/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js @@ -1,5 +1,6 @@ /* globals getEmojiUrlFromName:true, updateEmojiCustom:true, deleteEmojiCustom:true, isSetNotNull */ import { Meteor } from 'meteor/meteor'; +import { Blaze } from 'meteor/blaze'; RocketChat.emoji.packages.emojiCustom = { emojiCategories: { rocket: 'Custom' }, diff --git a/packages/rocketchat-emoji/client/lib/emojiRenderer.js b/packages/rocketchat-emoji/client/lib/emojiRenderer.js index 6e70f4d28c74..bd36c0c02198 100644 --- a/packages/rocketchat-emoji/client/lib/emojiRenderer.js +++ b/packages/rocketchat-emoji/client/lib/emojiRenderer.js @@ -1,4 +1,6 @@ /* globals HTML, isSetNotNull, renderEmoji:true */ +import { Blaze } from 'meteor/blaze'; + renderEmoji = function(emoji) { if (isSetNotNull(() => RocketChat.emoji.list[emoji].emojiPackage)) { const { emojiPackage } = RocketChat.emoji.list[emoji]; diff --git a/packages/rocketchat-katex/katex.js b/packages/rocketchat-katex/katex.js index bd233d87caa8..14a5bc4f0f81 100644 --- a/packages/rocketchat-katex/katex.js +++ b/packages/rocketchat-katex/katex.js @@ -4,6 +4,7 @@ */ import { Meteor } from 'meteor/meteor'; import { Random } from 'meteor/random'; +import { Blaze } from 'meteor/blaze'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-lazy-load/client/index.js b/packages/rocketchat-lazy-load/client/index.js index 46edfbc9f11f..884a7e46b5bd 100644 --- a/packages/rocketchat-lazy-load/client/index.js +++ b/packages/rocketchat-lazy-load/client/index.js @@ -1,6 +1,8 @@ import { Meteor } from 'meteor/meteor'; +import { Blaze } from 'meteor/blaze'; import _ from 'underscore'; import './lazyloadImage'; + export const fixCordova = function(url) { if (url && url.indexOf('data:image') === 0) { return url; diff --git a/packages/rocketchat-lib/client/lib/roomExit.js b/packages/rocketchat-lib/client/lib/roomExit.js index ff9bc87c509c..a0169313667c 100644 --- a/packages/rocketchat-lib/client/lib/roomExit.js +++ b/packages/rocketchat-lib/client/lib/roomExit.js @@ -1,4 +1,6 @@ /* globals currentTracker */ +import { Blaze } from 'meteor/blaze'; + this.roomExit = function() { // 7370 - Close flex-tab when opening a room on mobile UI if (window.matchMedia('(max-width: 500px)').matches) { diff --git a/packages/rocketchat-livechat/.app/client/lib/commands.js b/packages/rocketchat-livechat/.app/client/lib/commands.js index 8fdc0dc0bd88..be002cbf4078 100644 --- a/packages/rocketchat-livechat/.app/client/lib/commands.js +++ b/packages/rocketchat-livechat/.app/client/lib/commands.js @@ -1,5 +1,6 @@ /* globals LivechatVideoCall, Livechat */ import { Meteor } from 'meteor/meteor'; +import { Blaze } from 'meteor/blaze'; import swal from 'sweetalert2'; import visitor from '../../imports/client/visitor'; diff --git a/packages/rocketchat-livechat/.app/client/lib/fromApp/RoomHistoryManager.js b/packages/rocketchat-livechat/.app/client/lib/fromApp/RoomHistoryManager.js index dabc2282d6ba..aec7846d3ddc 100644 --- a/packages/rocketchat-livechat/.app/client/lib/fromApp/RoomHistoryManager.js +++ b/packages/rocketchat-livechat/.app/client/lib/fromApp/RoomHistoryManager.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Blaze } from 'meteor/blaze'; import visitor from '../../../imports/client/visitor'; import _ from 'underscore'; diff --git a/packages/rocketchat-livechat/.app/client/views/message.js b/packages/rocketchat-livechat/.app/client/views/message.js index b10a98ff15bc..ea9fd66476ca 100644 --- a/packages/rocketchat-livechat/.app/client/views/message.js +++ b/packages/rocketchat-livechat/.app/client/views/message.js @@ -1,4 +1,5 @@ /* globals Livechat, t, tr, livechatAutolinker */ +import { Blaze } from 'meteor/blaze'; import moment from 'moment'; import visitor from '../../imports/client/visitor'; import s from 'underscore.string'; diff --git a/packages/rocketchat-livestream/client/views/liveStreamTab.js b/packages/rocketchat-livestream/client/views/liveStreamTab.js index f0bbce9d51af..2551ec1fd0fd 100644 --- a/packages/rocketchat-livestream/client/views/liveStreamTab.js +++ b/packages/rocketchat-livestream/client/views/liveStreamTab.js @@ -1,6 +1,7 @@ /* globals popout */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Blaze } from 'meteor/blaze'; import toastr from 'toastr'; import { auth } from '../oauth.js'; import { RocketChatAnnouncement } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-oembed/client/oembedUrlWidget.js b/packages/rocketchat-oembed/client/oembedUrlWidget.js index d814522b0720..5e82730aa87a 100644 --- a/packages/rocketchat-oembed/client/oembedUrlWidget.js +++ b/packages/rocketchat-oembed/client/oembedUrlWidget.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Blaze } from 'meteor/blaze'; import _ from 'underscore'; const getTitle = function(self) { diff --git a/packages/rocketchat-reactions/client/init.js b/packages/rocketchat-reactions/client/init.js index 0ecbc81c3f41..8cd88a5dc980 100644 --- a/packages/rocketchat-reactions/client/init.js +++ b/packages/rocketchat-reactions/client/init.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Blaze } from 'meteor/blaze'; Template.room.events({ 'click .add-reaction, click [data-message-action="reaction-message"]'(event) { diff --git a/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js b/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js index 054f345129bb..3550a4af531d 100644 --- a/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js +++ b/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js @@ -1,5 +1,6 @@ /* globals AutoComplete */ import { Tracker } from 'meteor/tracker'; +import { Blaze } from 'meteor/blaze'; import moment from 'moment'; import { ReactiveVar } from 'meteor/reactive-var'; diff --git a/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js b/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js index ada8c736badc..950372a6b23f 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js +++ b/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Blaze } from 'meteor/blaze'; import toastr from 'toastr'; const acEvents = { diff --git a/packages/rocketchat-ui-message/client/message.js b/packages/rocketchat-ui-message/client/message.js index 14a07fe472df..6c678b07193c 100644 --- a/packages/rocketchat-ui-message/client/message.js +++ b/packages/rocketchat-ui-message/client/message.js @@ -1,5 +1,6 @@ /* globals renderEmoji renderMessageBody */ import { Meteor } from 'meteor/meteor'; +import { Blaze } from 'meteor/blaze'; import _ from 'underscore'; import moment from 'moment'; import { DateFormat } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js b/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js index c56ecbccec4a..8862ce928e9c 100644 --- a/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js +++ b/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Mongo } from 'meteor/mongo'; import { Tracker } from 'meteor/tracker'; +import { Blaze } from 'meteor/blaze'; import _ from 'underscore'; const usersFromRoomMessages = new Mongo.Collection(null); diff --git a/packages/rocketchat-ui-vrecord/client/VRecDialog.js b/packages/rocketchat-ui-vrecord/client/VRecDialog.js index b9f0b347d3f7..8c331d1c817f 100644 --- a/packages/rocketchat-ui-vrecord/client/VRecDialog.js +++ b/packages/rocketchat-ui-vrecord/client/VRecDialog.js @@ -1,3 +1,4 @@ +import { Blaze } from 'meteor/blaze'; import _ from 'underscore'; export const VRecDialog = new class { diff --git a/packages/rocketchat-ui/client/lib/RoomHistoryManager.js b/packages/rocketchat-ui/client/lib/RoomHistoryManager.js index c8a4a14b84d6..cc9970d3b02e 100644 --- a/packages/rocketchat-ui/client/lib/RoomHistoryManager.js +++ b/packages/rocketchat-ui/client/lib/RoomHistoryManager.js @@ -1,6 +1,7 @@ /* globals readMessage UserRoles RoomRoles*/ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Blaze } from 'meteor/blaze'; import _ from 'underscore'; export const upsertMessage = ({ msg, subscription }) => { diff --git a/packages/rocketchat-ui/client/lib/RoomManager.js b/packages/rocketchat-ui/client/lib/RoomManager.js index 7868698be264..8ed136df58a0 100644 --- a/packages/rocketchat-ui/client/lib/RoomManager.js +++ b/packages/rocketchat-ui/client/lib/RoomManager.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { Blaze } from 'meteor/blaze'; import _ from 'underscore'; import { upsertMessage } from './RoomHistoryManager'; diff --git a/packages/rocketchat-ui/client/lib/avatar.js b/packages/rocketchat-ui/client/lib/avatar.js index becdf58db651..80d37fdc26e0 100644 --- a/packages/rocketchat-ui/client/lib/avatar.js +++ b/packages/rocketchat-ui/client/lib/avatar.js @@ -1,3 +1,5 @@ +import { Blaze } from 'meteor/blaze'; + Blaze.registerHelper('avatarUrlFromUsername', getAvatarUrlFromUsername); this.getAvatarAsPng = function(username, cb) { diff --git a/packages/rocketchat-ui/client/lib/modal.js b/packages/rocketchat-ui/client/lib/modal.js index 32d72453fa9a..f09195e9b0e5 100644 --- a/packages/rocketchat-ui/client/lib/modal.js +++ b/packages/rocketchat-ui/client/lib/modal.js @@ -1,3 +1,5 @@ +import { Blaze } from 'meteor/blaze'; + this.Modal = (function() { const self = {}; diff --git a/packages/rocketchat-ui/client/lib/parentTemplate.js b/packages/rocketchat-ui/client/lib/parentTemplate.js index b7c24c25b62b..fb2d2a03569b 100644 --- a/packages/rocketchat-ui/client/lib/parentTemplate.js +++ b/packages/rocketchat-ui/client/lib/parentTemplate.js @@ -1,3 +1,5 @@ +import { Blaze } from 'meteor/blaze'; + /** * Get the parent template instance * @param {Number} [levels] How many levels to go up. Default is 1 diff --git a/packages/rocketchat-ui/client/views/404/roomNotFound.js b/packages/rocketchat-ui/client/views/404/roomNotFound.js index 04685b1382e4..1a1b19f90467 100644 --- a/packages/rocketchat-ui/client/views/404/roomNotFound.js +++ b/packages/rocketchat-ui/client/views/404/roomNotFound.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Blaze } from 'meteor/blaze'; Template.roomNotFound.helpers({ data() { diff --git a/packages/rocketchat-ui/client/views/app/alerts.js b/packages/rocketchat-ui/client/views/app/alerts.js index 679b5f06567c..d62ff6d88317 100644 --- a/packages/rocketchat-ui/client/views/app/alerts.js +++ b/packages/rocketchat-ui/client/views/app/alerts.js @@ -1,4 +1,6 @@ /* globals alerts */ +import { Blaze } from 'meteor/blaze'; + this.alerts = { renderedAlert: null, open(config) { diff --git a/packages/rocketchat-ui/client/views/app/createChannel.js b/packages/rocketchat-ui/client/views/app/createChannel.js index 980ea64b7421..ab8315bd9a63 100644 --- a/packages/rocketchat-ui/client/views/app/createChannel.js +++ b/packages/rocketchat-ui/client/views/app/createChannel.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { Blaze } from 'meteor/blaze'; import _ from 'underscore'; const acEvents = { diff --git a/packages/rocketchat-ui/client/views/app/fullModal.js b/packages/rocketchat-ui/client/views/app/fullModal.js index ca8046f1e275..5c90bfdcf5b9 100644 --- a/packages/rocketchat-ui/client/views/app/fullModal.js +++ b/packages/rocketchat-ui/client/views/app/fullModal.js @@ -1,3 +1,4 @@ +import { Blaze } from 'meteor/blaze'; let oldRoute = ''; const parent = document.querySelector('.main-content'); diff --git a/packages/rocketchat-ui/client/views/app/modal.js b/packages/rocketchat-ui/client/views/app/modal.js index 6851f811b945..e23c2d43dbc3 100644 --- a/packages/rocketchat-ui/client/views/app/modal.js +++ b/packages/rocketchat-ui/client/views/app/modal.js @@ -1,5 +1,6 @@ /* globals modal */ import { Meteor } from 'meteor/meteor'; +import { Blaze } from 'meteor/blaze'; this.modal = { renderedModal: null, diff --git a/packages/rocketchat-ui/client/views/app/popout.js b/packages/rocketchat-ui/client/views/app/popout.js index eb704e739007..4730be49a93a 100644 --- a/packages/rocketchat-ui/client/views/app/popout.js +++ b/packages/rocketchat-ui/client/views/app/popout.js @@ -1,4 +1,5 @@ /* globals popout */ +import { Blaze } from 'meteor/blaze'; import { ReactiveVar } from 'meteor/reactive-var'; this.popout = { diff --git a/packages/rocketchat-ui/client/views/app/popover.js b/packages/rocketchat-ui/client/views/app/popover.js index c91ee1af0827..8d94e1ec6060 100644 --- a/packages/rocketchat-ui/client/views/app/popover.js +++ b/packages/rocketchat-ui/client/views/app/popover.js @@ -1,5 +1,6 @@ /* globals popover isRtl */ import { Meteor } from 'meteor/meteor'; +import { Blaze } from 'meteor/blaze'; import _ from 'underscore'; import { hide, leave } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-ui/client/views/app/room.js b/packages/rocketchat-ui/client/views/app/room.js index e4a10dc10c99..fb51c95c7541 100644 --- a/packages/rocketchat-ui/client/views/app/room.js +++ b/packages/rocketchat-ui/client/views/app/room.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import { Tracker } from 'meteor/tracker'; +import { Blaze } from 'meteor/blaze'; import { RocketChatTabBar } from 'meteor/rocketchat:lib'; import _ from 'underscore'; From 577acf71b060cea104c7a42212c183e2fa744060 Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Thu, 25 Oct 2018 16:26:44 -0300 Subject: [PATCH 19/34] Remove global variables FlowRouter and BlazeLayout --- .eslintrc | 2 -- client/notifications/notification.js | 1 + client/routes/adminRouter.js | 3 +++ client/routes/roomRoute.js | 2 ++ client/routes/router.js | 3 +++ client/startup/loginViaQuery.js | 2 ++ client/startup/unread.js | 1 + packages/chatpal-search/client/route.js | 3 +++ packages/chatpal-search/package.js | 1 + packages/rocketchat-analytics/client/trackEvents.js | 2 ++ packages/rocketchat-apps/client/admin/appInstall.js | 1 + packages/rocketchat-apps/client/admin/appLogs.js | 1 + packages/rocketchat-apps/client/admin/appManage.js | 1 + packages/rocketchat-apps/client/admin/appWhatIsIt.js | 1 + packages/rocketchat-apps/client/admin/apps.js | 1 + packages/rocketchat-apps/client/orchestrator.js | 2 ++ packages/rocketchat-apps/package.js | 2 +- packages/rocketchat-authorization/client/route.js | 3 +++ .../rocketchat-authorization/client/views/permissionsRole.js | 1 + packages/rocketchat-authorization/package.js | 1 + .../client/startup/trackSettingsChange.js | 1 + packages/rocketchat-custom-sounds/client/admin/adminSounds.js | 3 ++- packages/rocketchat-custom-sounds/client/admin/route.js | 2 ++ packages/rocketchat-custom-sounds/package.js | 1 + packages/rocketchat-emoji-custom/admin/adminEmoji.js | 3 ++- packages/rocketchat-emoji-custom/admin/route.js | 2 ++ packages/rocketchat-emoji-custom/package.js | 1 + packages/rocketchat-iframe-login/iframe_client.js | 2 +- packages/rocketchat-importer/client/admin/adminImport.js | 1 + .../rocketchat-importer/client/admin/adminImportPrepare.js | 1 + .../rocketchat-importer/client/admin/adminImportProgress.js | 1 + packages/rocketchat-integrations/client/route.js | 2 ++ .../client/views/integrationsIncoming.js | 1 + .../client/views/integrationsOutgoing.js | 1 + .../client/views/integrationsOutgoingHistory.js | 1 + packages/rocketchat-integrations/package.js | 1 + packages/rocketchat-lib/client/lib/ChannelActions.js | 1 + packages/rocketchat-lib/client/lib/Layout.js | 1 + packages/rocketchat-lib/client/lib/openRoom.js | 2 ++ packages/rocketchat-lib/client/lib/roomExit.js | 1 + packages/rocketchat-lib/client/lib/roomTypes.js | 4 ++-- packages/rocketchat-lib/lib/RoomTypesCommon.js | 1 + packages/rocketchat-lib/package.js | 1 + packages/rocketchat-livechat/.app/client/routes/router.js | 2 ++ .../rocketchat-livechat/.app/client/views/livechatWindow.js | 1 + packages/rocketchat-livechat/client/route.js | 2 ++ .../client/views/app/livechatCurrentChats.js | 1 + .../client/views/app/livechatCustomFieldForm.js | 1 + .../client/views/app/livechatCustomFields.js | 1 + .../client/views/app/livechatDepartmentForm.js | 1 + .../client/views/app/livechatDepartments.js | 1 + .../rocketchat-livechat/client/views/app/livechatTriggers.js | 1 + .../client/views/app/livechatTriggersForm.js | 1 + .../client/views/app/tabbar/visitorForward.js | 1 + .../client/views/app/tabbar/visitorInfo.js | 1 + packages/rocketchat-livechat/client/views/sideNav/livechat.js | 1 + packages/rocketchat-livechat/package.js | 1 + packages/rocketchat-logger/client/viewLogs.js | 2 ++ packages/rocketchat-logger/package.js | 2 +- packages/rocketchat-mail-messages/client/router.js | 2 ++ packages/rocketchat-mail-messages/package.js | 1 + .../rocketchat-mail-messages/server/functions/sendMail.js | 1 + .../rocketchat-message-mark-as-unread/client/actionButton.js | 1 + .../rocketchat-message-snippet/client/page/snippetPage.js | 1 + packages/rocketchat-message-snippet/client/router.js | 4 +++- packages/rocketchat-message-snippet/package.js | 1 + .../rocketchat-oauth2-server-config/admin/client/route.js | 3 +++ .../admin/client/views/oauthApp.js | 1 + .../oauth/client/oauth2-client.js | 2 ++ packages/rocketchat-oauth2-server-config/package.js | 1 + packages/rocketchat-otr/client/rocketchat.otr.room.js | 1 + packages/rocketchat-sandstorm/client/setPath.js | 1 + packages/rocketchat-search/client/provider/result.js | 3 ++- packages/rocketchat-setup-wizard/client/final.js | 1 + packages/rocketchat-setup-wizard/client/setupWizard.js | 1 + packages/rocketchat-slashcommands-open/client/client.js | 1 + packages/rocketchat-token-login/client/login_token_client.js | 2 ++ packages/rocketchat-token-login/package.js | 1 + packages/rocketchat-ui-account/client/accountProfile.js | 1 + packages/rocketchat-ui-account/client/avatar/prompt.js | 1 + packages/rocketchat-ui-admin/client/admin.js | 1 + packages/rocketchat-ui-admin/client/rooms/adminRooms.js | 3 ++- .../rocketchat-ui-admin/client/users/adminUserChannels.js | 2 ++ packages/rocketchat-ui-admin/client/users/adminUsers.js | 1 + packages/rocketchat-ui-flextab/client/tabs/userActions.js | 1 + packages/rocketchat-ui-login/client/login/form.js | 1 + .../client/reset-password/resetPassword.js | 1 + packages/rocketchat-ui-login/client/routes.js | 3 +++ packages/rocketchat-ui-login/package.js | 1 + packages/rocketchat-ui-master/client/main.js | 1 + packages/rocketchat-ui-sidenav/client/createCombinedFlex.js | 1 + packages/rocketchat-ui-sidenav/client/sideNav.js | 1 + packages/rocketchat-ui-sidenav/client/sidebarHeader.js | 1 + packages/rocketchat-ui-sidenav/client/toolbar.js | 1 + packages/rocketchat-ui/client/components/icon.js | 1 + packages/rocketchat-ui/client/lib/RoomManager.js | 1 + packages/rocketchat-ui/client/lib/accountBox.js | 2 ++ packages/rocketchat-ui/client/lib/chatMessages.js | 1 + packages/rocketchat-ui/client/lib/cordova/push.js | 1 + packages/rocketchat-ui/client/lib/iframeCommands.js | 1 + packages/rocketchat-ui/client/lib/notification.js | 1 + packages/rocketchat-ui/client/lib/sideNav.js | 2 ++ packages/rocketchat-ui/client/views/app/createChannel.js | 1 + packages/rocketchat-ui/client/views/app/fullModal.js | 2 ++ packages/rocketchat-ui/client/views/app/popover.js | 1 + packages/rocketchat-ui/client/views/app/room.js | 1 + packages/rocketchat-ui/client/views/app/secretURL.js | 1 + packages/rocketchat-ui/client/views/cmsPage.js | 1 + packages/rocketchat-ui/client/views/fxos.js | 2 ++ packages/rocketchat-ui/package.js | 1 + packages/rocketchat-webrtc/client/WebRTCClass.js | 1 + 111 files changed, 148 insertions(+), 12 deletions(-) diff --git a/.eslintrc b/.eslintrc index 0c4917af74d7..8f80e25c296c 100644 --- a/.eslintrc +++ b/.eslintrc @@ -7,7 +7,6 @@ "AgentUsers" : false, "Apps" : false, "Assets" : false, - "BlazeLayout" : false, "browser" : false, "ChatMessage" : false, "ChatMessages" : false, @@ -16,7 +15,6 @@ "CryptoJS" : false, "Department" : false, "DDPRateLimiter" : false, - "FlowRouter" : false, "FileUpload" : false, "getNextAgent" : false, "handleError" : false, diff --git a/client/notifications/notification.js b/client/notifications/notification.js index e421ba11efe3..f7cfcde98d9c 100644 --- a/client/notifications/notification.js +++ b/client/notifications/notification.js @@ -1,6 +1,7 @@ /* globals KonchatNotification, fireGlobalEvent, readMessage, CachedChatSubscription */ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; +import { FlowRouter } from 'meteor/kadira:flow-router'; // Show notifications and play a sound for new messages. // We trust the server to only send notifications for interesting messages, e.g. direct messages or diff --git a/client/routes/adminRouter.js b/client/routes/adminRouter.js index 5f75a3733fa1..0c30a678f86a 100644 --- a/client/routes/adminRouter.js +++ b/client/routes/adminRouter.js @@ -1,3 +1,6 @@ +import { FlowRouter } from 'meteor/kadira:flow-router' ; +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; + FlowRouter.route('/admin/users', { name: 'admin-users', action() { diff --git a/client/routes/roomRoute.js b/client/routes/roomRoute.js index dc36397d3fb4..e9782bd6f460 100644 --- a/client/routes/roomRoute.js +++ b/client/routes/roomRoute.js @@ -1,3 +1,5 @@ +import { FlowRouter } from 'meteor/kadira:flow-router'; + FlowRouter.goToRoomById = (roomId) => { const subscription = ChatSubscription.findOne({ rid: roomId }); if (subscription) { diff --git a/client/routes/router.js b/client/routes/router.js index ef25e75b89e1..77a147782e5a 100644 --- a/client/routes/router.js +++ b/client/routes/router.js @@ -3,6 +3,9 @@ import { Meteor } from 'meteor/meteor'; import { Accounts } from 'meteor/accounts-base'; import { Tracker } from 'meteor/tracker'; import { Blaze } from 'meteor/blaze'; +import { FlowRouter } from 'meteor/kadira:flow-router'; +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; + import s from 'underscore.string'; Blaze.registerHelper('pathFor', function(path, kw) { diff --git a/client/startup/loginViaQuery.js b/client/startup/loginViaQuery.js index 12d26001e458..b6fe6dc84774 100644 --- a/client/startup/loginViaQuery.js +++ b/client/startup/loginViaQuery.js @@ -1,4 +1,6 @@ import { Meteor } from 'meteor/meteor'; +import { FlowRouter } from 'meteor/kadira:flow-router'; + Meteor.startup(() => { if (FlowRouter.getQueryParam('resumeToken')) { Meteor.loginWithToken(FlowRouter.getQueryParam('resumeToken'), () => { diff --git a/client/startup/unread.js b/client/startup/unread.js index 4b7f141db993..e7be82e244e1 100644 --- a/client/startup/unread.js +++ b/client/startup/unread.js @@ -1,6 +1,7 @@ /* globals fireGlobalEvent, readMessage, Favico, favico, menu */ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; +import { FlowRouter } from 'meteor/kadira:flow-router'; Meteor.startup(function() { Tracker.autorun(function() { diff --git a/packages/chatpal-search/client/route.js b/packages/chatpal-search/client/route.js index bea46e84d930..202cdb929991 100644 --- a/packages/chatpal-search/client/route.js +++ b/packages/chatpal-search/client/route.js @@ -1,3 +1,6 @@ +import { FlowRouter } from 'meteor/kadira:flow-router'; +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; + FlowRouter.route('/admin/chatpal', { name: 'chatpal-admin', action() { diff --git a/packages/chatpal-search/package.js b/packages/chatpal-search/package.js index b1191333b539..8dbde5d1dd2d 100644 --- a/packages/chatpal-search/package.js +++ b/packages/chatpal-search/package.js @@ -13,6 +13,7 @@ Package.onUse(function(api) { 'rocketchat:logger', 'rocketchat:search', 'kadira:flow-router', + 'kadira:blaze-layout', 'meteorhacks:inject-initial', ]); diff --git a/packages/rocketchat-analytics/client/trackEvents.js b/packages/rocketchat-analytics/client/trackEvents.js index 8579dbcf900f..1ec9f3c8378b 100644 --- a/packages/rocketchat-analytics/client/trackEvents.js +++ b/packages/rocketchat-analytics/client/trackEvents.js @@ -1,4 +1,6 @@ import { Meteor } from 'meteor/meteor'; +import { FlowRouter } from 'meteor/kadira:flow-router'; + function trackEvent(category, action, label) { if (window._paq) { window._paq.push(['trackEvent', category, action, label]); diff --git a/packages/rocketchat-apps/client/admin/appInstall.js b/packages/rocketchat-apps/client/admin/appInstall.js index c89259fd9fe6..74bca8c0f2f4 100644 --- a/packages/rocketchat-apps/client/admin/appInstall.js +++ b/packages/rocketchat-apps/client/admin/appInstall.js @@ -8,6 +8,7 @@ // then it will be enabled by default for development reasons. The server prefers a url // over the passed in body, so if both are found it will only use the url. import { ReactiveVar } from 'meteor/reactive-var'; +import { FlowRouter } from 'meteor/kadira:flow-router'; Template.appInstall.helpers({ appFile() { diff --git a/packages/rocketchat-apps/client/admin/appLogs.js b/packages/rocketchat-apps/client/admin/appLogs.js index d798d1349807..87abe27c8ac3 100644 --- a/packages/rocketchat-apps/client/admin/appLogs.js +++ b/packages/rocketchat-apps/client/admin/appLogs.js @@ -1,4 +1,5 @@ import { ReactiveVar } from 'meteor/reactive-var'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import moment from 'moment'; import hljs from 'highlight.js'; diff --git a/packages/rocketchat-apps/client/admin/appManage.js b/packages/rocketchat-apps/client/admin/appManage.js index 19078f9fb96c..6cfdf3e621bb 100644 --- a/packages/rocketchat-apps/client/admin/appManage.js +++ b/packages/rocketchat-apps/client/admin/appManage.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-apps/client/admin/appWhatIsIt.js b/packages/rocketchat-apps/client/admin/appWhatIsIt.js index c527d7416014..d7a0ba6d2925 100644 --- a/packages/rocketchat-apps/client/admin/appWhatIsIt.js +++ b/packages/rocketchat-apps/client/admin/appWhatIsIt.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { FlowRouter } from 'meteor/kadira:flow-router'; Template.appWhatIsIt.onCreated(function() { this.isLoading = new ReactiveVar(false); diff --git a/packages/rocketchat-apps/client/admin/apps.js b/packages/rocketchat-apps/client/admin/apps.js index 8e7166653300..5afef674467d 100644 --- a/packages/rocketchat-apps/client/admin/apps.js +++ b/packages/rocketchat-apps/client/admin/apps.js @@ -1,5 +1,6 @@ import toastr from 'toastr'; import { ReactiveVar } from 'meteor/reactive-var'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import { AppEvents } from '../communication'; const ENABLED_STATUS = ['auto_enabled', 'manually_enabled']; diff --git a/packages/rocketchat-apps/client/orchestrator.js b/packages/rocketchat-apps/client/orchestrator.js index 07f79de35f6f..b861fe692813 100644 --- a/packages/rocketchat-apps/client/orchestrator.js +++ b/packages/rocketchat-apps/client/orchestrator.js @@ -1,6 +1,8 @@ import { Meteor } from 'meteor/meteor'; import { AppWebsocketReceiver } from './communication'; import { Utilities } from '../lib/misc/Utilities'; +import { FlowRouter } from 'meteor/kadira:flow-router'; +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; class AppClientOrchestrator { constructor() { diff --git a/packages/rocketchat-apps/package.js b/packages/rocketchat-apps/package.js index 434209f02327..ce67fc50d3a7 100644 --- a/packages/rocketchat-apps/package.js +++ b/packages/rocketchat-apps/package.js @@ -11,7 +11,7 @@ Package.onUse(function(api) { 'templating', ]); - api.use(['reactive-var', 'kadira:flow-router', 'underscore'], 'client'); + api.use(['reactive-var', 'kadira:flow-router', 'kadira:blaze-layout', 'underscore'], 'client'); api.addFiles('lib/Apps.js', ['client', 'server']); diff --git a/packages/rocketchat-authorization/client/route.js b/packages/rocketchat-authorization/client/route.js index f4fa37fe0195..44d7c0d05b1c 100644 --- a/packages/rocketchat-authorization/client/route.js +++ b/packages/rocketchat-authorization/client/route.js @@ -1,3 +1,6 @@ +import { FlowRouter } from 'meteor/kadira:flow-router'; +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; + FlowRouter.route('/admin/permissions', { name: 'admin-permissions', action(/* params*/) { diff --git a/packages/rocketchat-authorization/client/views/permissionsRole.js b/packages/rocketchat-authorization/client/views/permissionsRole.js index d7bb54a6609b..3a056ef8d4c1 100644 --- a/packages/rocketchat-authorization/client/views/permissionsRole.js +++ b/packages/rocketchat-authorization/client/views/permissionsRole.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import toastr from 'toastr'; Template.permissionsRole.helpers({ diff --git a/packages/rocketchat-authorization/package.js b/packages/rocketchat-authorization/package.js index 94e59df87e2f..33d1f6051f21 100644 --- a/packages/rocketchat-authorization/package.js +++ b/packages/rocketchat-authorization/package.js @@ -14,6 +14,7 @@ Package.onUse(function(api) { api.use('mongo', ['client', 'server']); api.use('kadira:flow-router', 'client'); + api.use('kadira:blaze-layout', 'client'); api.use('tracker', 'client'); api.use('templating', 'client'); diff --git a/packages/rocketchat-channel-settings/client/startup/trackSettingsChange.js b/packages/rocketchat-channel-settings/client/startup/trackSettingsChange.js index 741944e4e47b..c99bd7aa7274 100644 --- a/packages/rocketchat-channel-settings/client/startup/trackSettingsChange.js +++ b/packages/rocketchat-channel-settings/client/startup/trackSettingsChange.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; +import { FlowRouter } from 'meteor/kadira:flow-router'; Meteor.startup(function() { const roomSettingsChangedCallback = (msg) => { diff --git a/packages/rocketchat-custom-sounds/client/admin/adminSounds.js b/packages/rocketchat-custom-sounds/client/admin/adminSounds.js index fba5e8c831d5..8652eab10aa5 100644 --- a/packages/rocketchat-custom-sounds/client/admin/adminSounds.js +++ b/packages/rocketchat-custom-sounds/client/admin/adminSounds.js @@ -1,7 +1,8 @@ -import s from 'underscore.string'; import { ReactiveVar } from 'meteor/reactive-var'; import { RocketChatTabBar } from 'meteor/rocketchat:lib'; import { Tracker } from 'meteor/tracker'; +import { FlowRouter } from 'meteor/kadira:flow-router'; +import s from 'underscore.string'; Template.adminSounds.helpers({ isReady() { diff --git a/packages/rocketchat-custom-sounds/client/admin/route.js b/packages/rocketchat-custom-sounds/client/admin/route.js index 1ddd3fbee27f..cf12f9949f6a 100644 --- a/packages/rocketchat-custom-sounds/client/admin/route.js +++ b/packages/rocketchat-custom-sounds/client/admin/route.js @@ -1,4 +1,6 @@ import { Meteor } from 'meteor/meteor'; +import { FlowRouter } from 'meteor/kadira:flow-router'; +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; FlowRouter.route('/admin/custom-sounds', { name: 'custom-sounds', diff --git a/packages/rocketchat-custom-sounds/package.js b/packages/rocketchat-custom-sounds/package.js index aa68853798c4..ff5f1505b424 100644 --- a/packages/rocketchat-custom-sounds/package.js +++ b/packages/rocketchat-custom-sounds/package.js @@ -16,6 +16,7 @@ Package.onUse(function(api) { ]); api.use('kadira:flow-router', 'client'); + api.use('kadira:blaze-layout', 'client'); api.addFiles('server/startup/custom-sounds.js', 'server'); api.addFiles('server/startup/permissions.js', 'server'); diff --git a/packages/rocketchat-emoji-custom/admin/adminEmoji.js b/packages/rocketchat-emoji-custom/admin/adminEmoji.js index b248771e970d..baaf828669ea 100644 --- a/packages/rocketchat-emoji-custom/admin/adminEmoji.js +++ b/packages/rocketchat-emoji-custom/admin/adminEmoji.js @@ -1,7 +1,8 @@ -import s from 'underscore.string'; import { ReactiveVar } from 'meteor/reactive-var'; import { RocketChatTabBar } from 'meteor/rocketchat:lib'; import { Tracker } from 'meteor/tracker'; +import { FlowRouter } from 'meteor/kadira:flow-router'; +import s from 'underscore.string'; Template.adminEmoji.helpers({ isReady() { diff --git a/packages/rocketchat-emoji-custom/admin/route.js b/packages/rocketchat-emoji-custom/admin/route.js index 15a89cc609b1..7c45afaa4a03 100644 --- a/packages/rocketchat-emoji-custom/admin/route.js +++ b/packages/rocketchat-emoji-custom/admin/route.js @@ -1,4 +1,6 @@ import { Meteor } from 'meteor/meteor'; +import { FlowRouter } from 'meteor/kadira:flow-router'; +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; FlowRouter.route('/admin/emoji-custom', { name: 'emoji-custom', diff --git a/packages/rocketchat-emoji-custom/package.js b/packages/rocketchat-emoji-custom/package.js index 07c245609109..df2e3f18b8e8 100644 --- a/packages/rocketchat-emoji-custom/package.js +++ b/packages/rocketchat-emoji-custom/package.js @@ -16,6 +16,7 @@ Package.onUse(function(api) { ]); api.use('kadira:flow-router', 'client'); + api.use('kadira:blaze-layout', 'client'); api.addFiles('function-isSet.js'); diff --git a/packages/rocketchat-iframe-login/iframe_client.js b/packages/rocketchat-iframe-login/iframe_client.js index 1de83f541cac..256cea0abb26 100644 --- a/packages/rocketchat-iframe-login/iframe_client.js +++ b/packages/rocketchat-iframe-login/iframe_client.js @@ -1,4 +1,4 @@ -/* globals Accounts, Tracker, ReactiveVar, FlowRouter, Accounts, HTTP, facebookConnectPlugin, TwitterConnect, OAuth */ +/* globals Accounts, Tracker, ReactiveVar, Accounts, HTTP, facebookConnectPlugin, TwitterConnect, OAuth */ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; diff --git a/packages/rocketchat-importer/client/admin/adminImport.js b/packages/rocketchat-importer/client/admin/adminImport.js index f019dfb90105..1b75385a5fd1 100644 --- a/packages/rocketchat-importer/client/admin/adminImport.js +++ b/packages/rocketchat-importer/client/admin/adminImport.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Importers } from 'meteor/rocketchat:importer'; +import { FlowRouter } from 'meteor/kadira:flow-router'; Template.adminImport.helpers({ isAdmin() { diff --git a/packages/rocketchat-importer/client/admin/adminImportPrepare.js b/packages/rocketchat-importer/client/admin/adminImportPrepare.js index 74021bebe502..de194fe9e60e 100644 --- a/packages/rocketchat-importer/client/admin/adminImportPrepare.js +++ b/packages/rocketchat-importer/client/admin/adminImportPrepare.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Importers } from 'meteor/rocketchat:importer'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import toastr from 'toastr'; Template.adminImportPrepare.helpers({ diff --git a/packages/rocketchat-importer/client/admin/adminImportProgress.js b/packages/rocketchat-importer/client/admin/adminImportProgress.js index aa9368442055..aab550bde208 100644 --- a/packages/rocketchat-importer/client/admin/adminImportProgress.js +++ b/packages/rocketchat-importer/client/admin/adminImportProgress.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Importers, ImporterWebsocketReceiver, ProgressStep } from 'meteor/rocketchat:importer'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import toastr from 'toastr'; diff --git a/packages/rocketchat-integrations/client/route.js b/packages/rocketchat-integrations/client/route.js index 3801ae5b1dd5..2b8eac2d0574 100644 --- a/packages/rocketchat-integrations/client/route.js +++ b/packages/rocketchat-integrations/client/route.js @@ -1,4 +1,6 @@ import { Meteor } from 'meteor/meteor'; +import { FlowRouter } from 'meteor/kadira:flow-router'; +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; FlowRouter.route('/admin/integrations', { name: 'admin-integrations', diff --git a/packages/rocketchat-integrations/client/views/integrationsIncoming.js b/packages/rocketchat-integrations/client/views/integrationsIncoming.js index 7270b88b29d3..1f443d304e34 100644 --- a/packages/rocketchat-integrations/client/views/integrationsIncoming.js +++ b/packages/rocketchat-integrations/client/views/integrationsIncoming.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import hljs from 'highlight.js'; import toastr from 'toastr'; diff --git a/packages/rocketchat-integrations/client/views/integrationsOutgoing.js b/packages/rocketchat-integrations/client/views/integrationsOutgoing.js index 2adf5c15d3e4..c21db20b4d69 100644 --- a/packages/rocketchat-integrations/client/views/integrationsOutgoing.js +++ b/packages/rocketchat-integrations/client/views/integrationsOutgoing.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import hljs from 'highlight.js'; import toastr from 'toastr'; diff --git a/packages/rocketchat-integrations/client/views/integrationsOutgoingHistory.js b/packages/rocketchat-integrations/client/views/integrationsOutgoingHistory.js index c69aeecc3605..57377d6c31c4 100644 --- a/packages/rocketchat-integrations/client/views/integrationsOutgoingHistory.js +++ b/packages/rocketchat-integrations/client/views/integrationsOutgoingHistory.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import _ from 'underscore'; import hljs from 'highlight.js'; import moment from 'moment'; diff --git a/packages/rocketchat-integrations/package.js b/packages/rocketchat-integrations/package.js index d9d3d52e22cd..d7d180cd7c07 100644 --- a/packages/rocketchat-integrations/package.js +++ b/packages/rocketchat-integrations/package.js @@ -17,6 +17,7 @@ Package.onUse(function(api) { api.use('rocketchat:logger'); api.use('kadira:flow-router', 'client'); + api.use('kadira:blaze-layout', 'client'); api.use('templating', 'client'); api.addFiles('lib/rocketchat.js', ['server', 'client']); diff --git a/packages/rocketchat-lib/client/lib/ChannelActions.js b/packages/rocketchat-lib/client/lib/ChannelActions.js index 6818d9dc150e..0ae25b1724f0 100644 --- a/packages/rocketchat-lib/client/lib/ChannelActions.js +++ b/packages/rocketchat-lib/client/lib/ChannelActions.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { call, UiTextContext } from 'meteor/rocketchat:lib'; +import { FlowRouter } from 'meteor/kadira:flow-router'; export function hide(type, rid, name) { const warnText = RocketChat.roomTypes.roomTypes[type].getUiText(UiTextContext.HIDE_WARNING); diff --git a/packages/rocketchat-lib/client/lib/Layout.js b/packages/rocketchat-lib/client/lib/Layout.js index 385e6e12fad3..511f1d56adc9 100644 --- a/packages/rocketchat-lib/client/lib/Layout.js +++ b/packages/rocketchat-lib/client/lib/Layout.js @@ -1,4 +1,5 @@ import { Tracker } from 'meteor/tracker'; +import { FlowRouter } from 'meteor/kadira:flow-router'; RocketChat.Layout = new (class RocketChatLayout { constructor() { diff --git a/packages/rocketchat-lib/client/lib/openRoom.js b/packages/rocketchat-lib/client/lib/openRoom.js index c602aefbf301..4f648a969464 100644 --- a/packages/rocketchat-lib/client/lib/openRoom.js +++ b/packages/rocketchat-lib/client/lib/openRoom.js @@ -1,6 +1,8 @@ /* globals fireGlobalEvent readMessage currentTracker*/ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; +import { FlowRouter } from 'meteor/kadira:flow-router'; +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; import _ from 'underscore'; currentTracker = undefined; diff --git a/packages/rocketchat-lib/client/lib/roomExit.js b/packages/rocketchat-lib/client/lib/roomExit.js index a0169313667c..df61dc33d58a 100644 --- a/packages/rocketchat-lib/client/lib/roomExit.js +++ b/packages/rocketchat-lib/client/lib/roomExit.js @@ -1,5 +1,6 @@ /* globals currentTracker */ import { Blaze } from 'meteor/blaze'; +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; this.roomExit = function() { // 7370 - Close flex-tab when opening a room on mobile UI diff --git a/packages/rocketchat-lib/client/lib/roomTypes.js b/packages/rocketchat-lib/client/lib/roomTypes.js index d21803e8a483..e2a39a360484 100644 --- a/packages/rocketchat-lib/client/lib/roomTypes.js +++ b/packages/rocketchat-lib/client/lib/roomTypes.js @@ -1,6 +1,6 @@ -import _ from 'underscore'; - +import { FlowRouter } from 'meteor/kadira:flow-router'; import { RoomTypesCommon } from '../../lib/RoomTypesCommon'; +import _ from 'underscore'; RocketChat.roomTypes = new class RocketChatRoomTypes extends RoomTypesCommon { checkCondition(roomType) { diff --git a/packages/rocketchat-lib/lib/RoomTypesCommon.js b/packages/rocketchat-lib/lib/RoomTypesCommon.js index e5fcfbd33169..e80c0f90464a 100644 --- a/packages/rocketchat-lib/lib/RoomTypesCommon.js +++ b/packages/rocketchat-lib/lib/RoomTypesCommon.js @@ -1,6 +1,7 @@ /* globals roomExit */ import { Meteor } from 'meteor/meteor'; import { RoomTypeConfig } from './RoomTypeConfig'; +import { FlowRouter } from 'meteor/kadira:flow-router'; export class RoomTypesCommon { constructor() { diff --git a/packages/rocketchat-lib/package.js b/packages/rocketchat-lib/package.js index a31e5db8fa94..d5f1d0c01edc 100644 --- a/packages/rocketchat-lib/package.js +++ b/packages/rocketchat-lib/package.js @@ -35,6 +35,7 @@ Package.onUse(function(api) { api.use('templating', 'client'); api.use('kadira:flow-router'); + api.use('kadira:blaze-layout', 'client'); api.addFiles('lib/core.js'); diff --git a/packages/rocketchat-livechat/.app/client/routes/router.js b/packages/rocketchat-livechat/.app/client/routes/router.js index a18955493f47..ae4fca721122 100644 --- a/packages/rocketchat-livechat/.app/client/routes/router.js +++ b/packages/rocketchat-livechat/.app/client/routes/router.js @@ -1,4 +1,6 @@ import visitor from '../../imports/client/visitor'; +import { FlowRouter } from 'meteor/kadira:flow-router'; +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; BlazeLayout.setRoot('body'); diff --git a/packages/rocketchat-livechat/.app/client/views/livechatWindow.js b/packages/rocketchat-livechat/.app/client/views/livechatWindow.js index d34646294912..dbe8a93ad615 100644 --- a/packages/rocketchat-livechat/.app/client/views/livechatWindow.js +++ b/packages/rocketchat-livechat/.app/client/views/livechatWindow.js @@ -1,5 +1,6 @@ /* globals Department, Livechat, LivechatVideoCall */ import { Meteor } from 'meteor/meteor'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import visitor from '../../imports/client/visitor'; function showDepartments() { diff --git a/packages/rocketchat-livechat/client/route.js b/packages/rocketchat-livechat/client/route.js index 35c41475945e..f0a32e8c51ad 100644 --- a/packages/rocketchat-livechat/client/route.js +++ b/packages/rocketchat-livechat/client/route.js @@ -1,3 +1,5 @@ +import { FlowRouter } from 'meteor/kadira:flow-router'; + livechatManagerRoutes = FlowRouter.group({ prefix: '/livechat-manager', name: 'livechat-manager', diff --git a/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js b/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js index bd0d4545cd66..412ad0cd5f5d 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js +++ b/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Mongo } from 'meteor/mongo'; import { ReactiveVar } from 'meteor/reactive-var'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import _ from 'underscore'; import moment from 'moment'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatCustomFieldForm.js b/packages/rocketchat-livechat/client/views/app/livechatCustomFieldForm.js index 0696a41193f5..3800045dd074 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatCustomFieldForm.js +++ b/packages/rocketchat-livechat/client/views/app/livechatCustomFieldForm.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import toastr from 'toastr'; Template.livechatCustomFieldForm.helpers({ diff --git a/packages/rocketchat-livechat/client/views/app/livechatCustomFields.js b/packages/rocketchat-livechat/client/views/app/livechatCustomFields.js index e1f7a2b01249..dd2891bd40e8 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatCustomFields.js +++ b/packages/rocketchat-livechat/client/views/app/livechatCustomFields.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { FlowRouter } from 'meteor/kadira:flow-router'; Template.livechatCustomFields.helpers({ customFields() { diff --git a/packages/rocketchat-livechat/client/views/app/livechatDepartmentForm.js b/packages/rocketchat-livechat/client/views/app/livechatDepartmentForm.js index 7038571b20a1..17a286807641 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatDepartmentForm.js +++ b/packages/rocketchat-livechat/client/views/app/livechatDepartmentForm.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatDepartments.js b/packages/rocketchat-livechat/client/views/app/livechatDepartments.js index d36c5ee21677..9035d203174a 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatDepartments.js +++ b/packages/rocketchat-livechat/client/views/app/livechatDepartments.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { FlowRouter } from 'meteor/kadira:flow-router'; Template.livechatDepartments.helpers({ departments() { diff --git a/packages/rocketchat-livechat/client/views/app/livechatTriggers.js b/packages/rocketchat-livechat/client/views/app/livechatTriggers.js index 8d987cf50b52..a1d899e25cdd 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatTriggers.js +++ b/packages/rocketchat-livechat/client/views/app/livechatTriggers.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { FlowRouter } from 'meteor/kadira:flow-router'; Template.livechatTriggers.helpers({ triggers() { diff --git a/packages/rocketchat-livechat/client/views/app/livechatTriggersForm.js b/packages/rocketchat-livechat/client/views/app/livechatTriggersForm.js index 565df148412f..fbab189fa6ce 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatTriggersForm.js +++ b/packages/rocketchat-livechat/client/views/app/livechatTriggersForm.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import toastr from 'toastr'; Template.livechatTriggersForm.helpers({ name() { diff --git a/packages/rocketchat-livechat/client/views/app/tabbar/visitorForward.js b/packages/rocketchat-livechat/client/views/app/tabbar/visitorForward.js index 74a7bc01ba93..eb218aebd96c 100644 --- a/packages/rocketchat-livechat/client/views/app/tabbar/visitorForward.js +++ b/packages/rocketchat-livechat/client/views/app/tabbar/visitorForward.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import toastr from 'toastr'; Template.visitorForward.helpers({ diff --git a/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js b/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js index 147d0818eb71..a3f1f384a2df 100644 --- a/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js +++ b/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-livechat/client/views/sideNav/livechat.js b/packages/rocketchat-livechat/client/views/sideNav/livechat.js index 6a8841129120..f32402353439 100644 --- a/packages/rocketchat-livechat/client/views/sideNav/livechat.js +++ b/packages/rocketchat-livechat/client/views/sideNav/livechat.js @@ -1,6 +1,7 @@ /* globals LivechatInquiry, KonchatNotification */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { FlowRouter } from 'meteor/kadira:flow-router'; Template.livechat.helpers({ isActive() { diff --git a/packages/rocketchat-livechat/package.js b/packages/rocketchat-livechat/package.js index 2ed90991e7bd..e6708afa22bf 100644 --- a/packages/rocketchat-livechat/package.js +++ b/packages/rocketchat-livechat/package.js @@ -32,6 +32,7 @@ Package.onUse(function(api) { api.use('konecty:user-presence'); api.use('rocketchat:ui'); api.use('kadira:flow-router', 'client'); + api.use('kadira:blaze-layout', 'client'); api.use('templating', 'client'); api.use('http'); api.use('check'); diff --git a/packages/rocketchat-logger/client/viewLogs.js b/packages/rocketchat-logger/client/viewLogs.js index d2acf944e079..81df547fa397 100644 --- a/packages/rocketchat-logger/client/viewLogs.js +++ b/packages/rocketchat-logger/client/viewLogs.js @@ -1,5 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Mongo } from 'meteor/mongo'; +import { FlowRouter } from 'meteor/kadira:flow-router'; +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; this.stdout = new Mongo.Collection('stdout'); diff --git a/packages/rocketchat-logger/package.js b/packages/rocketchat-logger/package.js index c0fc69979354..8362406f63fb 100644 --- a/packages/rocketchat-logger/package.js +++ b/packages/rocketchat-logger/package.js @@ -13,7 +13,7 @@ Package.onUse(function(api) { api.use('raix:eventemitter'); api.use('templating', 'client'); api.use('kadira:flow-router', 'client'); - + api.use('kadira:blaze-layout', 'client'); api.addFiles('client/ansispan.js', 'client'); api.addFiles('client/logger.js', 'client'); api.addFiles('client/viewLogs.js', 'client'); diff --git a/packages/rocketchat-mail-messages/client/router.js b/packages/rocketchat-mail-messages/client/router.js index a9a4c21e6265..3302b6a56fd1 100644 --- a/packages/rocketchat-mail-messages/client/router.js +++ b/packages/rocketchat-mail-messages/client/router.js @@ -1,4 +1,6 @@ import { Meteor } from 'meteor/meteor'; +import { FlowRouter } from 'meteor/kadira:flow-router'; +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; FlowRouter.route('/mailer', { name: 'mailer', diff --git a/packages/rocketchat-mail-messages/package.js b/packages/rocketchat-mail-messages/package.js index 44a975dc2f5b..6d48442ddd22 100644 --- a/packages/rocketchat-mail-messages/package.js +++ b/packages/rocketchat-mail-messages/package.js @@ -9,6 +9,7 @@ Package.onUse(function(api) { 'ecmascript', 'ddp-rate-limiter', 'kadira:flow-router', + 'kadira:blaze-layout', 'rocketchat:lib', 'rocketchat:authorization', ]); diff --git a/packages/rocketchat-mail-messages/server/functions/sendMail.js b/packages/rocketchat-mail-messages/server/functions/sendMail.js index 05c6aedd70f8..c8d95d48860b 100644 --- a/packages/rocketchat-mail-messages/server/functions/sendMail.js +++ b/packages/rocketchat-mail-messages/server/functions/sendMail.js @@ -1,6 +1,7 @@ /* globals */ import { Meteor } from 'meteor/meteor'; import { EJSON } from 'meteor/ejson'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import s from 'underscore.string'; import * as Mailer from 'meteor/rocketchat:mailer'; diff --git a/packages/rocketchat-message-mark-as-unread/client/actionButton.js b/packages/rocketchat-message-mark-as-unread/client/actionButton.js index f5b610396fea..498c332838a2 100644 --- a/packages/rocketchat-message-mark-as-unread/client/actionButton.js +++ b/packages/rocketchat-message-mark-as-unread/client/actionButton.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { FlowRouter } from 'meteor/kadira:flow-router'; Meteor.startup(() => { RocketChat.MessageAction.addButton({ diff --git a/packages/rocketchat-message-snippet/client/page/snippetPage.js b/packages/rocketchat-message-snippet/client/page/snippetPage.js index 9851dafbe84d..e90b365842a8 100644 --- a/packages/rocketchat-message-snippet/client/page/snippetPage.js +++ b/packages/rocketchat-message-snippet/client/page/snippetPage.js @@ -1,6 +1,7 @@ /* global SnippetedMessages */ import { Meteor } from 'meteor/meteor'; import { DateFormat } from 'meteor/rocketchat:lib'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import moment from 'moment'; Template.snippetPage.helpers({ diff --git a/packages/rocketchat-message-snippet/client/router.js b/packages/rocketchat-message-snippet/client/router.js index d921f8110120..b9b230227d34 100644 --- a/packages/rocketchat-message-snippet/client/router.js +++ b/packages/rocketchat-message-snippet/client/router.js @@ -1,4 +1,6 @@ -/* global FlowRouter, BlazeLayout */ +import { FlowRouter } from 'meteor/kadira:flow-router'; +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; + FlowRouter.route('/snippet/:snippetId/:snippetName', { name: 'snippetView', action() { diff --git a/packages/rocketchat-message-snippet/package.js b/packages/rocketchat-message-snippet/package.js index e342ecca1c3a..f83692f93bcf 100644 --- a/packages/rocketchat-message-snippet/package.js +++ b/packages/rocketchat-message-snippet/package.js @@ -22,6 +22,7 @@ Package.onUse(function(api) { api.use([ 'templating', 'kadira:flow-router', + 'kadira:blaze-layout', ], 'client'); diff --git a/packages/rocketchat-oauth2-server-config/admin/client/route.js b/packages/rocketchat-oauth2-server-config/admin/client/route.js index 020435333ef6..dc1433a0479c 100644 --- a/packages/rocketchat-oauth2-server-config/admin/client/route.js +++ b/packages/rocketchat-oauth2-server-config/admin/client/route.js @@ -1,3 +1,6 @@ +import { FlowRouter } from 'meteor/kadira:flow-router' ; +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; + FlowRouter.route('/admin/oauth-apps', { name: 'admin-oauth-apps', action() { diff --git a/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.js b/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.js index e7729e638a8b..72e6d261db31 100644 --- a/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.js +++ b/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import toastr from 'toastr'; Template.oauthApp.onCreated(function() { diff --git a/packages/rocketchat-oauth2-server-config/oauth/client/oauth2-client.js b/packages/rocketchat-oauth2-server-config/oauth/client/oauth2-client.js index 0955de0b3e70..cebd7716f5e0 100644 --- a/packages/rocketchat-oauth2-server-config/oauth/client/oauth2-client.js +++ b/packages/rocketchat-oauth2-server-config/oauth/client/oauth2-client.js @@ -1,6 +1,8 @@ // @ChatOAuthApps = new Mongo.Collection 'rocketchat_oauth_apps' /* globals ChatOAuthApps */ import { Meteor } from 'meteor/meteor'; +import { FlowRouter } from 'meteor/kadira:flow-router' ; +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; FlowRouter.route('/oauth/authorize', { action(params, queryParams) { diff --git a/packages/rocketchat-oauth2-server-config/package.js b/packages/rocketchat-oauth2-server-config/package.js index 3a3381fb447e..cad6a769f8bd 100644 --- a/packages/rocketchat-oauth2-server-config/package.js +++ b/packages/rocketchat-oauth2-server-config/package.js @@ -15,6 +15,7 @@ Package.onUse(function(api) { api.use('templating', 'client'); api.use('kadira:flow-router', 'client'); + api.use('kadira:blaze-layout', 'client'); // // General // // Server diff --git a/packages/rocketchat-otr/client/rocketchat.otr.room.js b/packages/rocketchat-otr/client/rocketchat.otr.room.js index 2a68e0a31de7..71dd7a9a02f0 100644 --- a/packages/rocketchat-otr/client/rocketchat.otr.room.js +++ b/packages/rocketchat-otr/client/rocketchat.otr.room.js @@ -3,6 +3,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import { EJSON } from 'meteor/ejson'; import { Tracker } from 'meteor/tracker'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import _ from 'underscore'; import toastr from 'toastr'; /* globals crypto */ diff --git a/packages/rocketchat-sandstorm/client/setPath.js b/packages/rocketchat-sandstorm/client/setPath.js index 92e374cca5e6..3a9868c7e6b4 100644 --- a/packages/rocketchat-sandstorm/client/setPath.js +++ b/packages/rocketchat-sandstorm/client/setPath.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { FlowRouter } from 'meteor/kadira:flow-router'; function updateSandstormMetaData(msg) { return window.parent.postMessage(msg, '*'); diff --git a/packages/rocketchat-search/client/provider/result.js b/packages/rocketchat-search/client/provider/result.js index f82b12d4351d..784166289625 100644 --- a/packages/rocketchat-search/client/provider/result.js +++ b/packages/rocketchat-search/client/provider/result.js @@ -1,6 +1,7 @@ -/* globals FlowRouter, RoomHistoryManager */ +/* globals RoomHistoryManager */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import _ from 'underscore'; Meteor.startup(function() { diff --git a/packages/rocketchat-setup-wizard/client/final.js b/packages/rocketchat-setup-wizard/client/final.js index 79f4a06fd392..f05b599abb2b 100644 --- a/packages/rocketchat-setup-wizard/client/final.js +++ b/packages/rocketchat-setup-wizard/client/final.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { FlowRouter } from 'meteor/kadira:flow-router'; Template.setupWizardFinal.onCreated(function() { const isSetupWizardDone = localStorage.getItem('wizardFinal'); diff --git a/packages/rocketchat-setup-wizard/client/setupWizard.js b/packages/rocketchat-setup-wizard/client/setupWizard.js index 52d251078553..a09ac542b38b 100644 --- a/packages/rocketchat-setup-wizard/client/setupWizard.js +++ b/packages/rocketchat-setup-wizard/client/setupWizard.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { ReactiveDict } from 'meteor/reactive-dict'; +import { FlowRouter } from 'meteor/kadira:flow-router'; const cannotSetup = () => { const showSetupWizard = RocketChat.settings.get('Show_Setup_Wizard'); diff --git a/packages/rocketchat-slashcommands-open/client/client.js b/packages/rocketchat-slashcommands-open/client/client.js index 35257e71aabb..b61c47e7ea6d 100644 --- a/packages/rocketchat-slashcommands-open/client/client.js +++ b/packages/rocketchat-slashcommands-open/client/client.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; +import { FlowRouter } from 'meteor/kadira:flow-router'; function Open(command, params /* , item*/) { const dict = { diff --git a/packages/rocketchat-token-login/client/login_token_client.js b/packages/rocketchat-token-login/client/login_token_client.js index d0c17e718b27..4809a81f241d 100644 --- a/packages/rocketchat-token-login/client/login_token_client.js +++ b/packages/rocketchat-token-login/client/login_token_client.js @@ -1,5 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Accounts } from 'meteor/accounts-base'; +import { FlowRouter } from 'meteor/kadira:flow-router'; +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; Meteor.loginWithLoginToken = function(token) { Accounts.callLoginMethod({ diff --git a/packages/rocketchat-token-login/package.js b/packages/rocketchat-token-login/package.js index 785e5f333618..858c93028426 100644 --- a/packages/rocketchat-token-login/package.js +++ b/packages/rocketchat-token-login/package.js @@ -10,6 +10,7 @@ Package.onUse(function(api) { api.use('rocketchat:logger', 'server'); api.use('kadira:flow-router', 'client'); + api.use('kadira:blaze-layout', 'client'); api.use('rocketchat:lib'); api.use('accounts-base'); diff --git a/packages/rocketchat-ui-account/client/accountProfile.js b/packages/rocketchat-ui-account/client/accountProfile.js index b59c68541dde..619f7b8d83e5 100644 --- a/packages/rocketchat-ui-account/client/accountProfile.js +++ b/packages/rocketchat-ui-account/client/accountProfile.js @@ -2,6 +2,7 @@ import { SHA256 } from 'meteor/sha'; import { ReactiveVar } from 'meteor/reactive-var'; import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-account/client/avatar/prompt.js b/packages/rocketchat-ui-account/client/avatar/prompt.js index bd1e8a9cbde6..6c733de88b2a 100644 --- a/packages/rocketchat-ui-account/client/avatar/prompt.js +++ b/packages/rocketchat-ui-account/client/avatar/prompt.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import s from 'underscore.string'; import toastr from 'toastr'; import mime from 'mime-type/with-db'; diff --git a/packages/rocketchat-ui-admin/client/admin.js b/packages/rocketchat-ui-admin/client/admin.js index 206fa2faaf6c..5f3ef6a06eed 100644 --- a/packages/rocketchat-ui-admin/client/admin.js +++ b/packages/rocketchat-ui-admin/client/admin.js @@ -4,6 +4,7 @@ import { Mongo } from 'meteor/mongo'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import { Tracker } from 'meteor/tracker'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-admin/client/rooms/adminRooms.js b/packages/rocketchat-ui-admin/client/rooms/adminRooms.js index 34ea97fb89cd..d4c6489eacd9 100644 --- a/packages/rocketchat-ui-admin/client/rooms/adminRooms.js +++ b/packages/rocketchat-ui-admin/client/rooms/adminRooms.js @@ -1,8 +1,9 @@ /* globals AdminChatRoom, RocketChat */ import { Mongo } from 'meteor/mongo'; import { Tracker } from 'meteor/tracker'; -import _ from 'underscore'; import { ReactiveVar } from 'meteor/reactive-var'; +import { FlowRouter } from 'meteor/kadira:flow-router'; +import _ from 'underscore'; import s from 'underscore.string'; import { RocketChatTabBar } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-ui-admin/client/users/adminUserChannels.js b/packages/rocketchat-ui-admin/client/users/adminUserChannels.js index e27952c97307..5812b9bc0d6d 100644 --- a/packages/rocketchat-ui-admin/client/users/adminUserChannels.js +++ b/packages/rocketchat-ui-admin/client/users/adminUserChannels.js @@ -1,3 +1,5 @@ +import { FlowRouter } from 'meteor/kadira:flow-router'; + Template.adminUserChannels.helpers({ type() { if (this.t === 'd') { diff --git a/packages/rocketchat-ui-admin/client/users/adminUsers.js b/packages/rocketchat-ui-admin/client/users/adminUsers.js index 4be5e52da3aa..1f189a929587 100644 --- a/packages/rocketchat-ui-admin/client/users/adminUsers.js +++ b/packages/rocketchat-ui-admin/client/users/adminUsers.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-flextab/client/tabs/userActions.js b/packages/rocketchat-ui-flextab/client/tabs/userActions.js index 8ea0bde799c1..bb2ff7dac8d0 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/userActions.js +++ b/packages/rocketchat-ui-flextab/client/tabs/userActions.js @@ -1,5 +1,6 @@ /* globals RoomRoles, WebRTC*/ import { Meteor } from 'meteor/meteor'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-login/client/login/form.js b/packages/rocketchat-ui-login/client/login/form.js index 077a23ae85fe..0e54b72d7d47 100644 --- a/packages/rocketchat-ui-login/client/login/form.js +++ b/packages/rocketchat-ui-login/client/login/form.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-login/client/reset-password/resetPassword.js b/packages/rocketchat-ui-login/client/reset-password/resetPassword.js index 73dc8ad1697b..7a486dacf17e 100644 --- a/packages/rocketchat-ui-login/client/reset-password/resetPassword.js +++ b/packages/rocketchat-ui-login/client/reset-password/resetPassword.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Accounts } from 'meteor/accounts-base'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import toastr from 'toastr'; Template.resetPassword.helpers({ diff --git a/packages/rocketchat-ui-login/client/routes.js b/packages/rocketchat-ui-login/client/routes.js index 6dd7d4fa2ebe..95b6a7ca7c4c 100644 --- a/packages/rocketchat-ui-login/client/routes.js +++ b/packages/rocketchat-ui-login/client/routes.js @@ -1,3 +1,6 @@ +import { FlowRouter } from 'meteor/kadira:flow-router'; +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; + FlowRouter.route('/reset-password/:token', { name: 'resetPassword', action() { diff --git a/packages/rocketchat-ui-login/package.js b/packages/rocketchat-ui-login/package.js index f634590410c9..ae23b30d3973 100644 --- a/packages/rocketchat-ui-login/package.js +++ b/packages/rocketchat-ui-login/package.js @@ -20,6 +20,7 @@ Package.onUse(function(api) { ]); api.use('kadira:flow-router', 'client'); + api.use('kadira:blaze-layout', 'client'); api.addFiles('client/routes.js', 'client'); diff --git a/packages/rocketchat-ui-master/client/main.js b/packages/rocketchat-ui-master/client/main.js index fad29e6f8480..d4202d72457f 100644 --- a/packages/rocketchat-ui-master/client/main.js +++ b/packages/rocketchat-ui-master/client/main.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import Clipboard from 'clipboard'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-sidenav/client/createCombinedFlex.js b/packages/rocketchat-ui-sidenav/client/createCombinedFlex.js index e9f932bb41b5..384fe5dfc1db 100644 --- a/packages/rocketchat-ui-sidenav/client/createCombinedFlex.js +++ b/packages/rocketchat-ui-sidenav/client/createCombinedFlex.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import _ from 'underscore'; Template.createCombinedFlex.helpers({ diff --git a/packages/rocketchat-ui-sidenav/client/sideNav.js b/packages/rocketchat-ui-sidenav/client/sideNav.js index 6d345faee18e..f9a2c72728ba 100644 --- a/packages/rocketchat-ui-sidenav/client/sideNav.js +++ b/packages/rocketchat-ui-sidenav/client/sideNav.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { lazyloadtick } from 'meteor/rocketchat:lazy-load'; +import { FlowRouter } from 'meteor/kadira:flow-router'; /* globals menu*/ diff --git a/packages/rocketchat-ui-sidenav/client/sidebarHeader.js b/packages/rocketchat-ui-sidenav/client/sidebarHeader.js index 1707830d0ecc..38635877d10e 100644 --- a/packages/rocketchat-ui-sidenav/client/sidebarHeader.js +++ b/packages/rocketchat-ui-sidenav/client/sidebarHeader.js @@ -1,5 +1,6 @@ /* globals popover menu */ import { Meteor } from 'meteor/meteor'; +import { FlowRouter } from 'meteor/kadira:flow-router'; const setStatus = (status) => { AccountBox.setStatus(status); diff --git a/packages/rocketchat-ui-sidenav/client/toolbar.js b/packages/rocketchat-ui-sidenav/client/toolbar.js index da1e23689453..13a944fdb185 100644 --- a/packages/rocketchat-ui-sidenav/client/toolbar.js +++ b/packages/rocketchat-ui-sidenav/client/toolbar.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import _ from 'underscore'; let isLoading; diff --git a/packages/rocketchat-ui/client/components/icon.js b/packages/rocketchat-ui/client/components/icon.js index 2858c36a8c92..96dd7b3f9099 100644 --- a/packages/rocketchat-ui/client/components/icon.js +++ b/packages/rocketchat-ui/client/components/icon.js @@ -1,4 +1,5 @@ /* globals isFirefox, isChrome */ +import { FlowRouter } from 'meteor/kadira:flow-router'; const baseUrlFix = () => `${ window.location.origin }${ FlowRouter.current().path }`; diff --git a/packages/rocketchat-ui/client/lib/RoomManager.js b/packages/rocketchat-ui/client/lib/RoomManager.js index 8ed136df58a0..a0bb5d850ea0 100644 --- a/packages/rocketchat-ui/client/lib/RoomManager.js +++ b/packages/rocketchat-ui/client/lib/RoomManager.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { Blaze } from 'meteor/blaze'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import _ from 'underscore'; import { upsertMessage } from './RoomHistoryManager'; diff --git a/packages/rocketchat-ui/client/lib/accountBox.js b/packages/rocketchat-ui/client/lib/accountBox.js index 9895a948e12f..1698ad0e16bb 100644 --- a/packages/rocketchat-ui/client/lib/accountBox.js +++ b/packages/rocketchat-ui/client/lib/accountBox.js @@ -1,6 +1,8 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { FlowRouter } from 'meteor/kadira:flow-router'; +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; import _ from 'underscore'; this.AccountBox = (function() { diff --git a/packages/rocketchat-ui/client/lib/chatMessages.js b/packages/rocketchat-ui/client/lib/chatMessages.js index 7eec56942814..eafadf419d40 100644 --- a/packages/rocketchat-ui/client/lib/chatMessages.js +++ b/packages/rocketchat-ui/client/lib/chatMessages.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import { Tracker } from 'meteor/tracker'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-ui/client/lib/cordova/push.js b/packages/rocketchat-ui/client/lib/cordova/push.js index ca0416d1e380..d3f8b02b88ba 100644 --- a/packages/rocketchat-ui/client/lib/cordova/push.js +++ b/packages/rocketchat-ui/client/lib/cordova/push.js @@ -1,6 +1,7 @@ /* globals Push Servers*/ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; +import { FlowRouter } from 'meteor/kadira:flow-router'; if (Meteor.isCordova) { // Push.addListener 'token', (token) -> diff --git a/packages/rocketchat-ui/client/lib/iframeCommands.js b/packages/rocketchat-ui/client/lib/iframeCommands.js index b6a0224e98c9..33cdce0c5401 100644 --- a/packages/rocketchat-ui/client/lib/iframeCommands.js +++ b/packages/rocketchat-ui/client/lib/iframeCommands.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import s from 'underscore.string'; const commands = { diff --git a/packages/rocketchat-ui/client/lib/notification.js b/packages/rocketchat-ui/client/lib/notification.js index 50f847114de8..ca7f3159d4ac 100644 --- a/packages/rocketchat-ui/client/lib/notification.js +++ b/packages/rocketchat-ui/client/lib/notification.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import { Tracker } from 'meteor/tracker'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import _ from 'underscore'; import s from 'underscore.string'; import { e2e } from 'meteor/rocketchat:e2e'; diff --git a/packages/rocketchat-ui/client/lib/sideNav.js b/packages/rocketchat-ui/client/lib/sideNav.js index 4224c2e79c49..a97d83408238 100644 --- a/packages/rocketchat-ui/client/lib/sideNav.js +++ b/packages/rocketchat-ui/client/lib/sideNav.js @@ -1,3 +1,5 @@ +import { FlowRouter } from 'meteor/kadira:flow-router'; + this.SideNav = new class { constructor() { this.initiated = false; diff --git a/packages/rocketchat-ui/client/views/app/createChannel.js b/packages/rocketchat-ui/client/views/app/createChannel.js index ab8315bd9a63..2702c10b8846 100644 --- a/packages/rocketchat-ui/client/views/app/createChannel.js +++ b/packages/rocketchat-ui/client/views/app/createChannel.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { Blaze } from 'meteor/blaze'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import _ from 'underscore'; const acEvents = { diff --git a/packages/rocketchat-ui/client/views/app/fullModal.js b/packages/rocketchat-ui/client/views/app/fullModal.js index 5c90bfdcf5b9..b1bb83b2bc21 100644 --- a/packages/rocketchat-ui/client/views/app/fullModal.js +++ b/packages/rocketchat-ui/client/views/app/fullModal.js @@ -1,4 +1,6 @@ import { Blaze } from 'meteor/blaze'; +import { FlowRouter } from 'meteor/kadira:flow-router'; +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; let oldRoute = ''; const parent = document.querySelector('.main-content'); diff --git a/packages/rocketchat-ui/client/views/app/popover.js b/packages/rocketchat-ui/client/views/app/popover.js index 8d94e1ec6060..2078e9b8aac5 100644 --- a/packages/rocketchat-ui/client/views/app/popover.js +++ b/packages/rocketchat-ui/client/views/app/popover.js @@ -1,6 +1,7 @@ /* globals popover isRtl */ import { Meteor } from 'meteor/meteor'; import { Blaze } from 'meteor/blaze'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import _ from 'underscore'; import { hide, leave } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-ui/client/views/app/room.js b/packages/rocketchat-ui/client/views/app/room.js index fb51c95c7541..e378f06bf81e 100644 --- a/packages/rocketchat-ui/client/views/app/room.js +++ b/packages/rocketchat-ui/client/views/app/room.js @@ -4,6 +4,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import { Tracker } from 'meteor/tracker'; import { Blaze } from 'meteor/blaze'; +import { FlowRouter } from 'meteor/kadira:flow-router'; import { RocketChatTabBar } from 'meteor/rocketchat:lib'; import _ from 'underscore'; diff --git a/packages/rocketchat-ui/client/views/app/secretURL.js b/packages/rocketchat-ui/client/views/app/secretURL.js index 5b67c656c43f..dbcb73efb715 100644 --- a/packages/rocketchat-ui/client/views/app/secretURL.js +++ b/packages/rocketchat-ui/client/views/app/secretURL.js @@ -1,6 +1,7 @@ /* globals KonchatNotification */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { FlowRouter } from 'meteor/kadira:flow-router'; Template.secretURL.helpers({ registrationAllowed() { diff --git a/packages/rocketchat-ui/client/views/cmsPage.js b/packages/rocketchat-ui/client/views/cmsPage.js index 68693ffce03c..e54f11423f3f 100644 --- a/packages/rocketchat-ui/client/views/cmsPage.js +++ b/packages/rocketchat-ui/client/views/cmsPage.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { FlowRouter } from 'meteor/kadira:flow-router'; Template.cmsPage.onCreated(function() { this.page = new ReactiveVar(''); diff --git a/packages/rocketchat-ui/client/views/fxos.js b/packages/rocketchat-ui/client/views/fxos.js index 975d66c8375a..a6d4476e8e6d 100644 --- a/packages/rocketchat-ui/client/views/fxos.js +++ b/packages/rocketchat-ui/client/views/fxos.js @@ -1,3 +1,5 @@ +import { BlazeLayout } from 'meteor/kadira:blaze-layout'; + Template.fxOsInstallPrompt.onRendered(function() { const showPrompt = function() { diff --git a/packages/rocketchat-ui/package.js b/packages/rocketchat-ui/package.js index 0a246d6db4d1..a2cff069c5d7 100644 --- a/packages/rocketchat-ui/package.js +++ b/packages/rocketchat-ui/package.js @@ -29,6 +29,7 @@ Package.onUse(function(api) { ]); api.use('kadira:flow-router', 'client'); + api.use('kadira:blaze-layout', 'client'); api.addFiles('getAvatarUrlFromUsername.js'); diff --git a/packages/rocketchat-webrtc/client/WebRTCClass.js b/packages/rocketchat-webrtc/client/WebRTCClass.js index c2157b0572e2..79e296e7b5ed 100644 --- a/packages/rocketchat-webrtc/client/WebRTCClass.js +++ b/packages/rocketchat-webrtc/client/WebRTCClass.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { ReactiveVar } from 'meteor/reactive-var'; +import { FlowRouter } from 'meteor/kadira:flow-router' ; class WebRTCTransportClass { constructor(webrtcInstance) { From 2b82e3c7e375186509ee6bc857b0bf13c8d1309a Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Thu, 25 Oct 2018 17:50:50 -0300 Subject: [PATCH 20/34] Add FlowRouter to eslint global in tests file --- tests/end-to-end/ui/00-login.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/end-to-end/ui/00-login.js b/tests/end-to-end/ui/00-login.js index 9e23ba22fd5b..cd720b6a1f83 100644 --- a/tests/end-to-end/ui/00-login.js +++ b/tests/end-to-end/ui/00-login.js @@ -1,5 +1,5 @@ /* eslint-env mocha */ -/* globals Meteor */ +/* globals Meteor, FlowRouter */ import loginPage from '../../pageobjects/login.page'; import setupWizard from '../../pageobjects/setup-wizard.page'; From be79f5409a4a47a2ffde1283231620c2f8be436a Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Fri, 26 Oct 2018 09:24:02 -0300 Subject: [PATCH 21/34] Remove global variable DDPRateLimiter --- .eslintrc | 1 - .../server/methods/getSupportedLanguages.js | 1 + packages/rocketchat-lib/server/lib/RateLimiter.js | 1 + packages/rocketchat-lib/server/methods/sendSMTPTestEmail.js | 1 + packages/rocketchat-mail-messages/server/methods/unsubscribe.js | 1 + server/methods/browseChannels.js | 1 + server/methods/resetAvatar.js | 1 + server/methods/setAvatarFromService.js | 1 + server/methods/userSetUtcOffset.js | 1 + server/publications/spotlight.js | 1 + 10 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index 8f80e25c296c..411a8483151d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -14,7 +14,6 @@ "ChatSubscription" : false, "CryptoJS" : false, "Department" : false, - "DDPRateLimiter" : false, "FileUpload" : false, "getNextAgent" : false, "handleError" : false, diff --git a/packages/rocketchat-autotranslate/server/methods/getSupportedLanguages.js b/packages/rocketchat-autotranslate/server/methods/getSupportedLanguages.js index eea0e5bb8072..fcdce980cb05 100644 --- a/packages/rocketchat-autotranslate/server/methods/getSupportedLanguages.js +++ b/packages/rocketchat-autotranslate/server/methods/getSupportedLanguages.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; Meteor.methods({ 'autoTranslate.getSupportedLanguages'(targetLanguage) { diff --git a/packages/rocketchat-lib/server/lib/RateLimiter.js b/packages/rocketchat-lib/server/lib/RateLimiter.js index 327dc65c812a..001ad9d57eef 100644 --- a/packages/rocketchat-lib/server/lib/RateLimiter.js +++ b/packages/rocketchat-lib/server/lib/RateLimiter.js @@ -1,5 +1,6 @@ /* globals RateLimiter */ import { Meteor } from 'meteor/meteor'; +import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; import _ from 'underscore'; RocketChat.RateLimiter = new class { diff --git a/packages/rocketchat-lib/server/methods/sendSMTPTestEmail.js b/packages/rocketchat-lib/server/methods/sendSMTPTestEmail.js index 1c9001e880d6..e29c73662321 100644 --- a/packages/rocketchat-lib/server/methods/sendSMTPTestEmail.js +++ b/packages/rocketchat-lib/server/methods/sendSMTPTestEmail.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; import * as Mailer from 'meteor/rocketchat:mailer'; Meteor.methods({ diff --git a/packages/rocketchat-mail-messages/server/methods/unsubscribe.js b/packages/rocketchat-mail-messages/server/methods/unsubscribe.js index dfbb586f5773..9cf5ff4f1265 100644 --- a/packages/rocketchat-mail-messages/server/methods/unsubscribe.js +++ b/packages/rocketchat-mail-messages/server/methods/unsubscribe.js @@ -1,5 +1,6 @@ /* globals Mailer */ import { Meteor } from 'meteor/meteor'; +import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; Meteor.methods({ 'Mailer:unsubscribe'(_id, createdAt) { diff --git a/server/methods/browseChannels.js b/server/methods/browseChannels.js index af09de6580af..f5af3264aaee 100644 --- a/server/methods/browseChannels.js +++ b/server/methods/browseChannels.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; import s from 'underscore.string'; const sortChannels = function(field, direction) { diff --git a/server/methods/resetAvatar.js b/server/methods/resetAvatar.js index f5064b478acb..aca806f46656 100644 --- a/server/methods/resetAvatar.js +++ b/server/methods/resetAvatar.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; Meteor.methods({ resetAvatar() { diff --git a/server/methods/setAvatarFromService.js b/server/methods/setAvatarFromService.js index 7cac0ccfe5ae..1bc249bd5aa4 100644 --- a/server/methods/setAvatarFromService.js +++ b/server/methods/setAvatarFromService.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Match, check } from 'meteor/check'; +import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; Meteor.methods({ setAvatarFromService(dataURI, contentType, service) { diff --git a/server/methods/userSetUtcOffset.js b/server/methods/userSetUtcOffset.js index 5b82d3ff61d8..941950e0877b 100644 --- a/server/methods/userSetUtcOffset.js +++ b/server/methods/userSetUtcOffset.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { check } from 'meteor/check'; +import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; Meteor.methods({ userSetUtcOffset(utcOffset) { diff --git a/server/publications/spotlight.js b/server/publications/spotlight.js index e5241346106c..602cc3ffb125 100644 --- a/server/publications/spotlight.js +++ b/server/publications/spotlight.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; import s from 'underscore.string'; function fetchRooms(userId, rooms) { From 70adda6ac05fb68f88b9f94a7f94224f5af961db Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Fri, 26 Oct 2018 09:56:16 -0300 Subject: [PATCH 22/34] Remove global variable Session --- .eslintrc | 1 - client/notifications/notification.js | 1 + client/routes/router.js | 2 +- client/startup/emailVerification.js | 1 + client/startup/roomObserve.js | 2 ++ client/startup/startup.js | 1 + client/startup/unread.js | 1 + client/startup/usersObserve.js | 2 ++ packages/chatpal-search/client/template/result.js | 1 + .../client/views/mailMessagesInstructions.js | 1 + .../client/startup/trackSettingsChange.js | 1 + packages/rocketchat-emoji-custom/client/lib/emojiCustom.js | 1 + packages/rocketchat-lib/client/CustomTranslations.js | 1 + packages/rocketchat-lib/client/MessageAction.js | 2 ++ packages/rocketchat-lib/client/defaultTabBars.js | 2 ++ packages/rocketchat-lib/client/lib/ChannelActions.js | 1 + packages/rocketchat-lib/client/lib/RocketChatAnnouncement.js | 1 + packages/rocketchat-lib/client/lib/openRoom.js | 1 + packages/rocketchat-lib/lib/roomTypes/direct.js | 1 + packages/rocketchat-livechat/.app/client/lib/fromApp/avatar.js | 1 + packages/rocketchat-livechat/.app/client/lib/triggers.js | 1 + packages/rocketchat-livechat/.app/client/views/avatar.js | 1 + .../rocketchat-livechat/.app/client/views/livechatWindow.js | 1 + packages/rocketchat-livechat/.app/imports/client/visitor.js | 1 + .../rocketchat-livechat/client/views/app/tabbar/visitorInfo.js | 1 + packages/rocketchat-livechat/client/views/sideNav/livechat.js | 1 + packages/rocketchat-livechat/imports/LivechatRoomType.js | 1 + packages/rocketchat-livestream/client/tabBar.js | 1 + packages/rocketchat-livestream/client/views/broadcastView.js | 1 + packages/rocketchat-livestream/client/views/liveStreamTab.js | 1 + .../client/views/pushNotificationsFlexTab.js | 1 + packages/rocketchat-search/client/provider/result.js | 1 + packages/rocketchat-search/client/search/search.js | 1 + packages/rocketchat-setup-wizard/client/setupWizard.js | 1 + packages/rocketchat-ui-account/client/avatar/avatar.js | 1 + packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js | 2 ++ packages/rocketchat-ui-admin/client/rooms/adminRooms.js | 1 + packages/rocketchat-ui-clean-history/client/lib/startup.js | 1 + .../rocketchat-ui-clean-history/client/views/cleanHistory.js | 3 ++- packages/rocketchat-ui-flextab/client/flexTabBar.js | 1 + packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js | 1 + packages/rocketchat-ui-flextab/client/tabs/membersList.js | 1 + packages/rocketchat-ui-flextab/client/tabs/userActions.js | 1 + packages/rocketchat-ui-flextab/client/tabs/userInfo.js | 1 + packages/rocketchat-ui-login/client/login/form.js | 1 + packages/rocketchat-ui-master/client/main.js | 1 + packages/rocketchat-ui-message/client/message.js | 1 + packages/rocketchat-ui-message/client/messageBox.js | 1 + .../rocketchat-ui-message/client/popup/messagePopupConfig.js | 1 + .../client/popup/messagePopupSlashCommandPreview.js | 1 + packages/rocketchat-ui-sidenav/client/chatRoomItem.js | 1 + packages/rocketchat-ui-sidenav/client/sidebarItem.js | 1 + packages/rocketchat-ui-sidenav/client/toolbar.js | 1 + packages/rocketchat-ui/client/components/header/header.js | 1 + packages/rocketchat-ui/client/lib/accountBox.js | 1 + packages/rocketchat-ui/client/lib/avatar.js | 1 + packages/rocketchat-ui/client/lib/chatMessages.js | 1 + .../rocketchat-ui/client/lib/codeMirror/codeMirrorComponent.js | 1 + packages/rocketchat-ui/client/lib/fileUpload.js | 1 + packages/rocketchat-ui/client/lib/iframeCommands.js | 1 + packages/rocketchat-ui/client/lib/menu.js | 1 + packages/rocketchat-ui/client/lib/msgTyping.js | 1 + packages/rocketchat-ui/client/lib/notification.js | 1 + packages/rocketchat-ui/client/lib/readMessages.js | 1 + packages/rocketchat-ui/client/lib/sideNav.js | 1 + packages/rocketchat-ui/client/views/404/roomNotFound.js | 1 + packages/rocketchat-ui/client/views/app/burger.js | 2 ++ packages/rocketchat-ui/client/views/app/room.js | 1 + packages/rocketchat-ui/client/views/app/secretURL.js | 1 + .../rocketchat-ui/client/views/app/videoCall/videoButtons.js | 2 ++ packages/rocketchat-ui/client/views/app/videoCall/videoCall.js | 1 + packages/rocketchat-ui/client/views/cmsPage.js | 1 + packages/rocketchat-ui/getAvatarUrlFromUsername.js | 1 + packages/rocketchat-videobridge/client/actionLink.js | 2 ++ packages/rocketchat-videobridge/client/tabBar.js | 1 + packages/rocketchat-videobridge/client/views/videoFlexTab.js | 1 + 76 files changed, 84 insertions(+), 3 deletions(-) diff --git a/.eslintrc b/.eslintrc index 411a8483151d..424bf88936a3 100644 --- a/.eslintrc +++ b/.eslintrc @@ -37,7 +37,6 @@ "RoomHistoryManager" : false, "RoomManager" : false, "ServiceConfiguration" : false, - "Session" : false, "Settings" : false, "SideNav" : false, "t" : false, diff --git a/client/notifications/notification.js b/client/notifications/notification.js index f7cfcde98d9c..52d7083b2350 100644 --- a/client/notifications/notification.js +++ b/client/notifications/notification.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Session } from 'meteor/session'; // Show notifications and play a sound for new messages. // We trust the server to only send notifications for interesting messages, e.g. direct messages or diff --git a/client/routes/router.js b/client/routes/router.js index 77a147782e5a..9d80c73ee9fd 100644 --- a/client/routes/router.js +++ b/client/routes/router.js @@ -5,7 +5,7 @@ import { Tracker } from 'meteor/tracker'; import { Blaze } from 'meteor/blaze'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { BlazeLayout } from 'meteor/kadira:blaze-layout'; - +import { Session } from 'meteor/session'; import s from 'underscore.string'; Blaze.registerHelper('pathFor', function(path, kw) { diff --git a/client/startup/emailVerification.js b/client/startup/emailVerification.js index 364b87e77ed8..8dccb0d1bd6c 100644 --- a/client/startup/emailVerification.js +++ b/client/startup/emailVerification.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; +import { Session } from 'meteor/session'; import toastr from 'toastr'; Meteor.startup(function() { diff --git a/client/startup/roomObserve.js b/client/startup/roomObserve.js index 60fbd750ef39..4fcfedb26e3a 100644 --- a/client/startup/roomObserve.js +++ b/client/startup/roomObserve.js @@ -1,4 +1,6 @@ import { Meteor } from 'meteor/meteor'; +import { Session } from 'meteor/session'; + Meteor.startup(function() { ChatRoom.find().observe({ added(data) { diff --git a/client/startup/startup.js b/client/startup/startup.js index 80c6075e0fbb..9ee7fd2527ca 100644 --- a/client/startup/startup.js +++ b/client/startup/startup.js @@ -1,6 +1,7 @@ /* globals UserPresence, fireGlobalEvent */ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; +import { Session } from 'meteor/session'; import toastr from 'toastr'; import hljs from 'highlight.js'; import 'highlight.js/styles/github.css'; diff --git a/client/startup/unread.js b/client/startup/unread.js index e7be82e244e1..555a060a6834 100644 --- a/client/startup/unread.js +++ b/client/startup/unread.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Session } from 'meteor/session'; Meteor.startup(function() { Tracker.autorun(function() { diff --git a/client/startup/usersObserve.js b/client/startup/usersObserve.js index fa71c139b70d..0bbc53102b52 100644 --- a/client/startup/usersObserve.js +++ b/client/startup/usersObserve.js @@ -1,4 +1,6 @@ import { Meteor } from 'meteor/meteor'; +import { Session } from 'meteor/session'; + Meteor.startup(function() { Meteor.users.find({}, { fields: { name: 1, username: 1, pictures: 1, status: 1, emails: 1, phone: 1, services: 1, utcOffset: 1 } }).observe({ added(user) { diff --git a/packages/chatpal-search/client/template/result.js b/packages/chatpal-search/client/template/result.js index 7041ea9879d8..99234087480c 100644 --- a/packages/chatpal-search/client/template/result.js +++ b/packages/chatpal-search/client/template/result.js @@ -1,5 +1,6 @@ import { DateFormat } from 'meteor/rocketchat:lib'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Session } from 'meteor/session'; Template.ChatpalSearchResultTemplate.onCreated(function() { this.badRequest = new ReactiveVar(false); diff --git a/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js b/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js index c76793bce75a..b8094da85623 100644 --- a/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js +++ b/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Blaze } from 'meteor/blaze'; +import { Session } from 'meteor/session'; import toastr from 'toastr'; import resetSelection from '../resetSelection'; diff --git a/packages/rocketchat-channel-settings/client/startup/trackSettingsChange.js b/packages/rocketchat-channel-settings/client/startup/trackSettingsChange.js index c99bd7aa7274..9cdad921cca8 100644 --- a/packages/rocketchat-channel-settings/client/startup/trackSettingsChange.js +++ b/packages/rocketchat-channel-settings/client/startup/trackSettingsChange.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Session } from 'meteor/session'; Meteor.startup(function() { const roomSettingsChangedCallback = (msg) => { diff --git a/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js b/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js index fc7669498b41..f9073d2a33db 100644 --- a/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js +++ b/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js @@ -1,6 +1,7 @@ /* globals getEmojiUrlFromName:true, updateEmojiCustom:true, deleteEmojiCustom:true, isSetNotNull */ import { Meteor } from 'meteor/meteor'; import { Blaze } from 'meteor/blaze'; +import { Session } from 'meteor/session'; RocketChat.emoji.packages.emojiCustom = { emojiCategories: { rocket: 'Custom' }, diff --git a/packages/rocketchat-lib/client/CustomTranslations.js b/packages/rocketchat-lib/client/CustomTranslations.js index 46d6cc9c3597..7c2270dfc6d1 100644 --- a/packages/rocketchat-lib/client/CustomTranslations.js +++ b/packages/rocketchat-lib/client/CustomTranslations.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Session } from 'meteor/session'; RocketChat.applyCustomTranslations = function applyCustomTranslations() { let CustomTranslations = RocketChat.settings.get('Custom_Translations'); diff --git a/packages/rocketchat-lib/client/MessageAction.js b/packages/rocketchat-lib/client/MessageAction.js index 9b787b07dbac..e2ccb736fe5d 100644 --- a/packages/rocketchat-lib/client/MessageAction.js +++ b/packages/rocketchat-lib/client/MessageAction.js @@ -3,9 +3,11 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { Session } from 'meteor/session'; import _ from 'underscore'; import moment from 'moment'; import toastr from 'toastr'; + const call = (method, ...args) => new Promise((resolve, reject) => { Meteor.call(method, ...args, function(err, data) { if (err) { diff --git a/packages/rocketchat-lib/client/defaultTabBars.js b/packages/rocketchat-lib/client/defaultTabBars.js index 0ad49929e3d5..8ee2470b030d 100644 --- a/packages/rocketchat-lib/client/defaultTabBars.js +++ b/packages/rocketchat-lib/client/defaultTabBars.js @@ -1,3 +1,5 @@ +import { Session } from 'meteor/session'; + RocketChat.TabBar.addButton({ groups: ['channel', 'group', 'direct'], id: 'rocket-search', diff --git a/packages/rocketchat-lib/client/lib/ChannelActions.js b/packages/rocketchat-lib/client/lib/ChannelActions.js index 0ae25b1724f0..4f2bbfd11383 100644 --- a/packages/rocketchat-lib/client/lib/ChannelActions.js +++ b/packages/rocketchat-lib/client/lib/ChannelActions.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { call, UiTextContext } from 'meteor/rocketchat:lib'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Session } from 'meteor/session'; export function hide(type, rid, name) { const warnText = RocketChat.roomTypes.roomTypes[type].getUiText(UiTextContext.HIDE_WARNING); diff --git a/packages/rocketchat-lib/client/lib/RocketChatAnnouncement.js b/packages/rocketchat-lib/client/lib/RocketChatAnnouncement.js index 4fd6d432abce..53235d45d4f1 100644 --- a/packages/rocketchat-lib/client/lib/RocketChatAnnouncement.js +++ b/packages/rocketchat-lib/client/lib/RocketChatAnnouncement.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Session } from 'meteor/session'; export class RocketChatAnnouncement { constructor(args = {}) { diff --git a/packages/rocketchat-lib/client/lib/openRoom.js b/packages/rocketchat-lib/client/lib/openRoom.js index 4f648a969464..4514a5f0ee21 100644 --- a/packages/rocketchat-lib/client/lib/openRoom.js +++ b/packages/rocketchat-lib/client/lib/openRoom.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { BlazeLayout } from 'meteor/kadira:blaze-layout'; +import { Session } from 'meteor/session'; import _ from 'underscore'; currentTracker = undefined; diff --git a/packages/rocketchat-lib/lib/roomTypes/direct.js b/packages/rocketchat-lib/lib/roomTypes/direct.js index 896674fd4326..8dd9cd02e578 100644 --- a/packages/rocketchat-lib/lib/roomTypes/direct.js +++ b/packages/rocketchat-lib/lib/roomTypes/direct.js @@ -1,5 +1,6 @@ /* globals openRoom */ import { Meteor } from 'meteor/meteor'; +import { Session } from 'meteor/session'; import { RoomTypeConfig, RoomTypeRouteConfig, RoomSettingsEnum, UiTextContext } from '../RoomTypeConfig'; export class DirectMessageRoomRoute extends RoomTypeRouteConfig { diff --git a/packages/rocketchat-livechat/.app/client/lib/fromApp/avatar.js b/packages/rocketchat-livechat/.app/client/lib/fromApp/avatar.js index 616627dac694..d998561288da 100644 --- a/packages/rocketchat-livechat/.app/client/lib/fromApp/avatar.js +++ b/packages/rocketchat-livechat/.app/client/lib/fromApp/avatar.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Session } from 'meteor/session'; this.getAvatarUrlFromUsername = (username) => { const key = `avatar_random_${ username }`; diff --git a/packages/rocketchat-livechat/.app/client/lib/triggers.js b/packages/rocketchat-livechat/.app/client/lib/triggers.js index ceb0d9b928a0..bdd46364e4ac 100644 --- a/packages/rocketchat-livechat/.app/client/lib/triggers.js +++ b/packages/rocketchat-livechat/.app/client/lib/triggers.js @@ -1,6 +1,7 @@ /* globals Livechat */ import { Meteor } from 'meteor/meteor'; import { Random } from 'meteor/random'; +import { Session } from 'meteor/session'; import visitor from '../../imports/client/visitor'; const firedTriggers = JSON.parse(localStorage.getItem('rocketChatFiredTriggers')) || []; diff --git a/packages/rocketchat-livechat/.app/client/views/avatar.js b/packages/rocketchat-livechat/.app/client/views/avatar.js index ec393892b0e7..ebd0572b5974 100644 --- a/packages/rocketchat-livechat/.app/client/views/avatar.js +++ b/packages/rocketchat-livechat/.app/client/views/avatar.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Session } from 'meteor/session'; import visitor from '../../imports/client/visitor'; Template.avatar.helpers({ diff --git a/packages/rocketchat-livechat/.app/client/views/livechatWindow.js b/packages/rocketchat-livechat/.app/client/views/livechatWindow.js index dbe8a93ad615..c99c09fc3581 100644 --- a/packages/rocketchat-livechat/.app/client/views/livechatWindow.js +++ b/packages/rocketchat-livechat/.app/client/views/livechatWindow.js @@ -1,6 +1,7 @@ /* globals Department, Livechat, LivechatVideoCall */ import { Meteor } from 'meteor/meteor'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Session } from 'meteor/session'; import visitor from '../../imports/client/visitor'; function showDepartments() { diff --git a/packages/rocketchat-livechat/.app/imports/client/visitor.js b/packages/rocketchat-livechat/.app/imports/client/visitor.js index 8b20645f85ac..545036f45546 100644 --- a/packages/rocketchat-livechat/.app/imports/client/visitor.js +++ b/packages/rocketchat-livechat/.app/imports/client/visitor.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; +import { Session } from 'meteor/session'; const msgStream = new Meteor.Streamer('room-messages'); diff --git a/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js b/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js index a3f1f384a2df..19673f09027a 100644 --- a/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js +++ b/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Session } from 'meteor/session'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-livechat/client/views/sideNav/livechat.js b/packages/rocketchat-livechat/client/views/sideNav/livechat.js index f32402353439..feb4e539669c 100644 --- a/packages/rocketchat-livechat/client/views/sideNav/livechat.js +++ b/packages/rocketchat-livechat/client/views/sideNav/livechat.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Session } from 'meteor/session'; Template.livechat.helpers({ isActive() { diff --git a/packages/rocketchat-livechat/imports/LivechatRoomType.js b/packages/rocketchat-livechat/imports/LivechatRoomType.js index 13bff59c190e..25d23acd5c8c 100644 --- a/packages/rocketchat-livechat/imports/LivechatRoomType.js +++ b/packages/rocketchat-livechat/imports/LivechatRoomType.js @@ -1,4 +1,5 @@ /* globals openRoom, LivechatInquiry */ +import { Session } from 'meteor/session'; import { RoomSettingsEnum, RoomTypeConfig, RoomTypeRouteConfig, UiTextContext } from 'meteor/rocketchat:lib'; class LivechatRoomRoute extends RoomTypeRouteConfig { diff --git a/packages/rocketchat-livestream/client/tabBar.js b/packages/rocketchat-livestream/client/tabBar.js index 28a3d45e3a69..4832c439b162 100644 --- a/packages/rocketchat-livestream/client/tabBar.js +++ b/packages/rocketchat-livestream/client/tabBar.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; +import { Session } from 'meteor/session'; Meteor.startup(function() { Tracker.autorun(function() { diff --git a/packages/rocketchat-livestream/client/views/broadcastView.js b/packages/rocketchat-livestream/client/views/broadcastView.js index 3c1c3c613389..f2ac9bdbd4d1 100644 --- a/packages/rocketchat-livestream/client/views/broadcastView.js +++ b/packages/rocketchat-livestream/client/views/broadcastView.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Session } from 'meteor/session'; const getMedia = () => navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; const createAndConnect = (url) => { diff --git a/packages/rocketchat-livestream/client/views/liveStreamTab.js b/packages/rocketchat-livestream/client/views/liveStreamTab.js index 2551ec1fd0fd..9f4aabe5981e 100644 --- a/packages/rocketchat-livestream/client/views/liveStreamTab.js +++ b/packages/rocketchat-livestream/client/views/liveStreamTab.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Blaze } from 'meteor/blaze'; +import { Session } from 'meteor/session'; import toastr from 'toastr'; import { auth } from '../oauth.js'; import { RocketChatAnnouncement } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.js b/packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.js index 258afd68eb2b..70eba102d9d8 100644 --- a/packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.js +++ b/packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.js @@ -1,6 +1,7 @@ /* globals ChatSubscription popover */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Session } from 'meteor/session'; const notificationLabels = { all: 'All_messages', diff --git a/packages/rocketchat-search/client/provider/result.js b/packages/rocketchat-search/client/provider/result.js index 784166289625..c46112ced79e 100644 --- a/packages/rocketchat-search/client/provider/result.js +++ b/packages/rocketchat-search/client/provider/result.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Session } from 'meteor/session'; import _ from 'underscore'; Meteor.startup(function() { diff --git a/packages/rocketchat-search/client/search/search.js b/packages/rocketchat-search/client/search/search.js index 2bd250f5d0e8..03fc3054732a 100644 --- a/packages/rocketchat-search/client/search/search.js +++ b/packages/rocketchat-search/client/search/search.js @@ -1,5 +1,6 @@ /* globals ReactiveVar, TAPi18n */ import { Meteor } from 'meteor/meteor'; +import { Session } from 'meteor/session'; import toastr from 'toastr'; import _ from 'underscore'; diff --git a/packages/rocketchat-setup-wizard/client/setupWizard.js b/packages/rocketchat-setup-wizard/client/setupWizard.js index a09ac542b38b..bb9f859a473a 100644 --- a/packages/rocketchat-setup-wizard/client/setupWizard.js +++ b/packages/rocketchat-setup-wizard/client/setupWizard.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { ReactiveDict } from 'meteor/reactive-dict'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Session } from 'meteor/session'; const cannotSetup = () => { const showSetupWizard = RocketChat.settings.get('Show_Setup_Wizard'); diff --git a/packages/rocketchat-ui-account/client/avatar/avatar.js b/packages/rocketchat-ui-account/client/avatar/avatar.js index ecfc3de4c4d8..afd19b944b18 100644 --- a/packages/rocketchat-ui-account/client/avatar/avatar.js +++ b/packages/rocketchat-ui-account/client/avatar/avatar.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Session } from 'meteor/session'; Template.avatar.helpers({ src() { diff --git a/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js b/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js index 9b14332a5ecc..06b60fafabbe 100644 --- a/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js +++ b/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js @@ -1,7 +1,9 @@ /* globals AdminChatRoom */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Session } from 'meteor/session'; import toastr from 'toastr'; + Template.adminRoomInfo.helpers({ selectedRoom() { return Session.get('adminRoomsSelected'); diff --git a/packages/rocketchat-ui-admin/client/rooms/adminRooms.js b/packages/rocketchat-ui-admin/client/rooms/adminRooms.js index d4c6489eacd9..30b1283f69bf 100644 --- a/packages/rocketchat-ui-admin/client/rooms/adminRooms.js +++ b/packages/rocketchat-ui-admin/client/rooms/adminRooms.js @@ -3,6 +3,7 @@ import { Mongo } from 'meteor/mongo'; import { Tracker } from 'meteor/tracker'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Session } from 'meteor/session'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-clean-history/client/lib/startup.js b/packages/rocketchat-ui-clean-history/client/lib/startup.js index f1a790d5a0b6..e0c1c268288b 100644 --- a/packages/rocketchat-ui-clean-history/client/lib/startup.js +++ b/packages/rocketchat-ui-clean-history/client/lib/startup.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Session } from 'meteor/session'; Meteor.startup(() => { RocketChat.TabBar.addButton({ diff --git a/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js b/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js index 3550a4af531d..1cf508418534 100644 --- a/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js +++ b/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js @@ -1,8 +1,9 @@ /* globals AutoComplete */ import { Tracker } from 'meteor/tracker'; import { Blaze } from 'meteor/blaze'; -import moment from 'moment'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Session } from 'meteor/session'; +import moment from 'moment'; import { call } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-ui-flextab/client/flexTabBar.js b/packages/rocketchat-ui-flextab/client/flexTabBar.js index 1193c6c5ca25..daef82fb5a22 100644 --- a/packages/rocketchat-ui-flextab/client/flexTabBar.js +++ b/packages/rocketchat-ui-flextab/client/flexTabBar.js @@ -1,6 +1,7 @@ /* globals popover */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Session } from 'meteor/session'; import _ from 'underscore'; const commonHelpers = { diff --git a/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js b/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js index 950372a6b23f..c4b2e2acee8b 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js +++ b/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Blaze } from 'meteor/blaze'; +import { Session } from 'meteor/session'; import toastr from 'toastr'; const acEvents = { diff --git a/packages/rocketchat-ui-flextab/client/tabs/membersList.js b/packages/rocketchat-ui-flextab/client/tabs/membersList.js index 4d89e826a417..bb154b0a555e 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/membersList.js +++ b/packages/rocketchat-ui-flextab/client/tabs/membersList.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { Session } from 'meteor/session'; import _ from 'underscore'; import { getActions } from './userActions'; diff --git a/packages/rocketchat-ui-flextab/client/tabs/userActions.js b/packages/rocketchat-ui-flextab/client/tabs/userActions.js index bb2ff7dac8d0..adfa26b11c67 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/userActions.js +++ b/packages/rocketchat-ui-flextab/client/tabs/userActions.js @@ -1,6 +1,7 @@ /* globals RoomRoles, WebRTC*/ import { Meteor } from 'meteor/meteor'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Session } from 'meteor/session'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-flextab/client/tabs/userInfo.js b/packages/rocketchat-ui-flextab/client/tabs/userInfo.js index a9de0a497364..8ce8ccb82767 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/userInfo.js +++ b/packages/rocketchat-ui-flextab/client/tabs/userInfo.js @@ -1,6 +1,7 @@ /* globals RoomRoles UserRoles popover */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Session } from 'meteor/session'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-ui-login/client/login/form.js b/packages/rocketchat-ui-login/client/login/form.js index 0e54b72d7d47..4d2a7bbc0e57 100644 --- a/packages/rocketchat-ui-login/client/login/form.js +++ b/packages/rocketchat-ui-login/client/login/form.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Session } from 'meteor/session'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-master/client/main.js b/packages/rocketchat-ui-master/client/main.js index d4202d72457f..eb0ca3d69282 100644 --- a/packages/rocketchat-ui-master/client/main.js +++ b/packages/rocketchat-ui-master/client/main.js @@ -4,6 +4,7 @@ import { Match } from 'meteor/check'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Session } from 'meteor/session'; import Clipboard from 'clipboard'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-message/client/message.js b/packages/rocketchat-ui-message/client/message.js index 6c678b07193c..38089f1d6da8 100644 --- a/packages/rocketchat-ui-message/client/message.js +++ b/packages/rocketchat-ui-message/client/message.js @@ -1,6 +1,7 @@ /* globals renderEmoji renderMessageBody */ import { Meteor } from 'meteor/meteor'; import { Blaze } from 'meteor/blaze'; +import { Session } from 'meteor/session'; import _ from 'underscore'; import moment from 'moment'; import { DateFormat } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-ui-message/client/messageBox.js b/packages/rocketchat-ui-message/client/messageBox.js index 22310f48a101..80ccdb662fd9 100644 --- a/packages/rocketchat-ui-message/client/messageBox.js +++ b/packages/rocketchat-ui-message/client/messageBox.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { Session } from 'meteor/session'; import toastr from 'toastr'; import moment from 'moment'; import _ from 'underscore'; diff --git a/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js b/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js index 8862ce928e9c..01298a2708eb 100644 --- a/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js +++ b/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { Mongo } from 'meteor/mongo'; import { Tracker } from 'meteor/tracker'; import { Blaze } from 'meteor/blaze'; +import { Session } from 'meteor/session'; import _ from 'underscore'; const usersFromRoomMessages = new Mongo.Collection(null); diff --git a/packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js b/packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js index 4a809f0756b3..d5b82d1e4935 100644 --- a/packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js +++ b/packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Session } from 'meteor/session'; import _ from 'underscore'; const keys = { diff --git a/packages/rocketchat-ui-sidenav/client/chatRoomItem.js b/packages/rocketchat-ui-sidenav/client/chatRoomItem.js index acf630abce83..f74ac0951ee9 100644 --- a/packages/rocketchat-ui-sidenav/client/chatRoomItem.js +++ b/packages/rocketchat-ui-sidenav/client/chatRoomItem.js @@ -1,4 +1,5 @@ import { Tracker } from 'meteor/tracker'; +import { Session } from 'meteor/session'; Template.chatRoomItem.helpers({ roomData() { diff --git a/packages/rocketchat-ui-sidenav/client/sidebarItem.js b/packages/rocketchat-ui-sidenav/client/sidebarItem.js index 5f90c7c31c33..533a07cd7738 100644 --- a/packages/rocketchat-ui-sidenav/client/sidebarItem.js +++ b/packages/rocketchat-ui-sidenav/client/sidebarItem.js @@ -1,6 +1,7 @@ /* globals menu popover renderMessageBody */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Session } from 'meteor/session'; import moment from 'moment'; Template.sidebarItem.helpers({ diff --git a/packages/rocketchat-ui-sidenav/client/toolbar.js b/packages/rocketchat-ui-sidenav/client/toolbar.js index 13a944fdb185..93cd45e44b36 100644 --- a/packages/rocketchat-ui-sidenav/client/toolbar.js +++ b/packages/rocketchat-ui-sidenav/client/toolbar.js @@ -4,6 +4,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Session } from 'meteor/session'; import _ from 'underscore'; let isLoading; diff --git a/packages/rocketchat-ui/client/components/header/header.js b/packages/rocketchat-ui/client/components/header/header.js index 325f83b0b8cc..934dd740538a 100644 --- a/packages/rocketchat-ui/client/components/header/header.js +++ b/packages/rocketchat-ui/client/components/header/header.js @@ -1,5 +1,6 @@ /* globals fireGlobalEvent*/ import { Meteor } from 'meteor/meteor'; +import { Session } from 'meteor/session'; const isSubscribed = (_id) => ChatSubscription.find({ rid: _id }).count() > 0; diff --git a/packages/rocketchat-ui/client/lib/accountBox.js b/packages/rocketchat-ui/client/lib/accountBox.js index 1698ad0e16bb..36a27f2873af 100644 --- a/packages/rocketchat-ui/client/lib/accountBox.js +++ b/packages/rocketchat-ui/client/lib/accountBox.js @@ -3,6 +3,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { BlazeLayout } from 'meteor/kadira:blaze-layout'; +import { Session } from 'meteor/session'; import _ from 'underscore'; this.AccountBox = (function() { diff --git a/packages/rocketchat-ui/client/lib/avatar.js b/packages/rocketchat-ui/client/lib/avatar.js index 80d37fdc26e0..5c7f6378bca8 100644 --- a/packages/rocketchat-ui/client/lib/avatar.js +++ b/packages/rocketchat-ui/client/lib/avatar.js @@ -1,4 +1,5 @@ import { Blaze } from 'meteor/blaze'; +import { Session } from 'meteor/session'; Blaze.registerHelper('avatarUrlFromUsername', getAvatarUrlFromUsername); diff --git a/packages/rocketchat-ui/client/lib/chatMessages.js b/packages/rocketchat-ui/client/lib/chatMessages.js index eafadf419d40..48a89f1f1108 100644 --- a/packages/rocketchat-ui/client/lib/chatMessages.js +++ b/packages/rocketchat-ui/client/lib/chatMessages.js @@ -4,6 +4,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Session } from 'meteor/session'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-ui/client/lib/codeMirror/codeMirrorComponent.js b/packages/rocketchat-ui/client/lib/codeMirror/codeMirrorComponent.js index a8875e37bbfd..7e5a71d2db33 100644 --- a/packages/rocketchat-ui/client/lib/codeMirror/codeMirrorComponent.js +++ b/packages/rocketchat-ui/client/lib/codeMirror/codeMirrorComponent.js @@ -2,6 +2,7 @@ CodeMirrors = {}; import { Meteor } from 'meteor/meteor'; +import { Session } from 'meteor/session'; import 'codemirror/lib/codemirror.css'; import CodeMirror from 'codemirror/lib/codemirror.js'; diff --git a/packages/rocketchat-ui/client/lib/fileUpload.js b/packages/rocketchat-ui/client/lib/fileUpload.js index 1dbca636d794..37ff55c3cb2b 100644 --- a/packages/rocketchat-ui/client/lib/fileUpload.js +++ b/packages/rocketchat-ui/client/lib/fileUpload.js @@ -2,6 +2,7 @@ /* exported fileUpload */ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; +import { Session } from 'meteor/session'; import s from 'underscore.string'; const readAsDataURL = (file, callback) => { diff --git a/packages/rocketchat-ui/client/lib/iframeCommands.js b/packages/rocketchat-ui/client/lib/iframeCommands.js index 33cdce0c5401..099443e15612 100644 --- a/packages/rocketchat-ui/client/lib/iframeCommands.js +++ b/packages/rocketchat-ui/client/lib/iframeCommands.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Session } from 'meteor/session'; import s from 'underscore.string'; const commands = { diff --git a/packages/rocketchat-ui/client/lib/menu.js b/packages/rocketchat-ui/client/lib/menu.js index 87fc141f8d35..2ebabfd3f197 100644 --- a/packages/rocketchat-ui/client/lib/menu.js +++ b/packages/rocketchat-ui/client/lib/menu.js @@ -1,3 +1,4 @@ +import { Session } from 'meteor/session'; import _ from 'underscore'; import EventEmitter from 'wolfy87-eventemitter'; import { lazyloadtick } from 'meteor/rocketchat:lazy-load'; diff --git a/packages/rocketchat-ui/client/lib/msgTyping.js b/packages/rocketchat-ui/client/lib/msgTyping.js index d942c812d229..85dede240bcc 100644 --- a/packages/rocketchat-ui/client/lib/msgTyping.js +++ b/packages/rocketchat-ui/client/lib/msgTyping.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Session } from 'meteor/session'; import _ from 'underscore'; export const MsgTyping = (function() { diff --git a/packages/rocketchat-ui/client/lib/notification.js b/packages/rocketchat-ui/client/lib/notification.js index ca7f3159d4ac..afdfdf183433 100644 --- a/packages/rocketchat-ui/client/lib/notification.js +++ b/packages/rocketchat-ui/client/lib/notification.js @@ -4,6 +4,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Session } from 'meteor/session'; import _ from 'underscore'; import s from 'underscore.string'; import { e2e } from 'meteor/rocketchat:e2e'; diff --git a/packages/rocketchat-ui/client/lib/readMessages.js b/packages/rocketchat-ui/client/lib/readMessages.js index 4693ea2ed9f4..b35db6edb2d2 100644 --- a/packages/rocketchat-ui/client/lib/readMessages.js +++ b/packages/rocketchat-ui/client/lib/readMessages.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Session } from 'meteor/session'; import _ from 'underscore'; /* DEFINITIONS diff --git a/packages/rocketchat-ui/client/lib/sideNav.js b/packages/rocketchat-ui/client/lib/sideNav.js index a97d83408238..4003a2337cec 100644 --- a/packages/rocketchat-ui/client/lib/sideNav.js +++ b/packages/rocketchat-ui/client/lib/sideNav.js @@ -1,4 +1,5 @@ import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Session } from 'meteor/session'; this.SideNav = new class { constructor() { diff --git a/packages/rocketchat-ui/client/views/404/roomNotFound.js b/packages/rocketchat-ui/client/views/404/roomNotFound.js index 1a1b19f90467..f27812da6e74 100644 --- a/packages/rocketchat-ui/client/views/404/roomNotFound.js +++ b/packages/rocketchat-ui/client/views/404/roomNotFound.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Blaze } from 'meteor/blaze'; +import { Session } from 'meteor/session'; Template.roomNotFound.helpers({ data() { diff --git a/packages/rocketchat-ui/client/views/app/burger.js b/packages/rocketchat-ui/client/views/app/burger.js index 649bdf1f516c..46fff3e5be2c 100644 --- a/packages/rocketchat-ui/client/views/app/burger.js +++ b/packages/rocketchat-ui/client/views/app/burger.js @@ -1,3 +1,5 @@ +import { Session } from 'meteor/session'; + Template.burger.helpers({ unread() { return Session.get('unread'); diff --git a/packages/rocketchat-ui/client/views/app/room.js b/packages/rocketchat-ui/client/views/app/room.js index e378f06bf81e..1b72191bef8e 100644 --- a/packages/rocketchat-ui/client/views/app/room.js +++ b/packages/rocketchat-ui/client/views/app/room.js @@ -6,6 +6,7 @@ import { Tracker } from 'meteor/tracker'; import { Blaze } from 'meteor/blaze'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { RocketChatTabBar } from 'meteor/rocketchat:lib'; +import { Session } from 'meteor/session'; import _ from 'underscore'; import moment from 'moment'; diff --git a/packages/rocketchat-ui/client/views/app/secretURL.js b/packages/rocketchat-ui/client/views/app/secretURL.js index dbcb73efb715..cec7e0339939 100644 --- a/packages/rocketchat-ui/client/views/app/secretURL.js +++ b/packages/rocketchat-ui/client/views/app/secretURL.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Session } from 'meteor/session'; Template.secretURL.helpers({ registrationAllowed() { diff --git a/packages/rocketchat-ui/client/views/app/videoCall/videoButtons.js b/packages/rocketchat-ui/client/views/app/videoCall/videoButtons.js index a6427676028b..b411757e1f18 100644 --- a/packages/rocketchat-ui/client/views/app/videoCall/videoButtons.js +++ b/packages/rocketchat-ui/client/views/app/videoCall/videoButtons.js @@ -1,4 +1,6 @@ /* globals WebRTC */ +import { Session } from 'meteor/session'; + Template.videoButtons.helpers({ videoAvaliable() { return WebRTC.getInstanceByRoomId(Session.get('openedRoom')) != null; diff --git a/packages/rocketchat-ui/client/views/app/videoCall/videoCall.js b/packages/rocketchat-ui/client/views/app/videoCall/videoCall.js index cbde903391a5..f8ad86ab2dda 100644 --- a/packages/rocketchat-ui/client/views/app/videoCall/videoCall.js +++ b/packages/rocketchat-ui/client/views/app/videoCall/videoCall.js @@ -1,6 +1,7 @@ /* globals WebRTC */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Session } from 'meteor/session'; Template.videoCall.onCreated(function() { return this.mainVideo = new ReactiveVar('$auto'); diff --git a/packages/rocketchat-ui/client/views/cmsPage.js b/packages/rocketchat-ui/client/views/cmsPage.js index e54f11423f3f..8dea78360c16 100644 --- a/packages/rocketchat-ui/client/views/cmsPage.js +++ b/packages/rocketchat-ui/client/views/cmsPage.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Session } from 'meteor/session'; Template.cmsPage.onCreated(function() { this.page = new ReactiveVar(''); diff --git a/packages/rocketchat-ui/getAvatarUrlFromUsername.js b/packages/rocketchat-ui/getAvatarUrlFromUsername.js index 629e2b5e1ef6..ebe5eb47127b 100644 --- a/packages/rocketchat-ui/getAvatarUrlFromUsername.js +++ b/packages/rocketchat-ui/getAvatarUrlFromUsername.js @@ -1,5 +1,6 @@ // TODO: remove global import { Meteor } from 'meteor/meteor'; +import { Session } from 'meteor/session'; this.getAvatarUrlFromUsername = function(username) { const key = `avatar_random_${ username }`; diff --git a/packages/rocketchat-videobridge/client/actionLink.js b/packages/rocketchat-videobridge/client/actionLink.js index dfb978495cc2..0603aa2e8111 100644 --- a/packages/rocketchat-videobridge/client/actionLink.js +++ b/packages/rocketchat-videobridge/client/actionLink.js @@ -1,4 +1,6 @@ +import { Session } from 'meteor/session'; import toastr from 'toastr'; + RocketChat.actionLinks.register('joinJitsiCall', function(message, params, instance) { if (Session.get('openedRoom')) { const rid = Session.get('openedRoom'); diff --git a/packages/rocketchat-videobridge/client/tabBar.js b/packages/rocketchat-videobridge/client/tabBar.js index 0de3bd29e685..77458686f127 100644 --- a/packages/rocketchat-videobridge/client/tabBar.js +++ b/packages/rocketchat-videobridge/client/tabBar.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; +import { Session } from 'meteor/session'; Meteor.startup(function() { diff --git a/packages/rocketchat-videobridge/client/views/videoFlexTab.js b/packages/rocketchat-videobridge/client/views/videoFlexTab.js index 5e70ef627b16..8eb620c3d6c9 100644 --- a/packages/rocketchat-videobridge/client/views/videoFlexTab.js +++ b/packages/rocketchat-videobridge/client/views/videoFlexTab.js @@ -1,6 +1,7 @@ /* globals JitsiMeetExternalAPI */ /* eslint new-cap: [2, {"capIsNewExceptions": ["MD5"]}] */ import { Meteor } from 'meteor/meteor'; +import { Session } from 'meteor/session'; Template.videoFlexTab.helpers({ openInNewWindow() { From a9c962e1ab30b9c5fe44a493ed5ecacfa1b910e9 Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Fri, 26 Oct 2018 10:04:56 -0300 Subject: [PATCH 23/34] Remove global variable UAParser --- .eslintrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index 424bf88936a3..dc9c0644975a 100644 --- a/.eslintrc +++ b/.eslintrc @@ -47,7 +47,6 @@ "toastr" : false, "Trigger" : false, "Triggers" : false, - "UAParser" : false, "visitor" : false, "VideoRecorder" : false, "VRecDialog" : false From dbb0f286cb0729999168d18ae9a5ef539e80ec57 Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Fri, 26 Oct 2018 10:13:13 -0300 Subject: [PATCH 24/34] Remove global variable Promise --- .eslintrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index dc9c0644975a..6a65456e6932 100644 --- a/.eslintrc +++ b/.eslintrc @@ -30,7 +30,6 @@ "Npm" : false, "Package" : false, "parentCall" : false, - "Promise" : false, "Reload" : false, "RocketChat" : true, "RocketChatFile" : false, From e3b4dc805c5ea0aafa851831332ab23a77792b15 Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Fri, 26 Oct 2018 10:20:34 -0300 Subject: [PATCH 25/34] Remove global variable Reload --- .eslintrc | 1 - packages/rocketchat-ui-account/client/accountPreferences.js | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index 6a65456e6932..f54930e44130 100644 --- a/.eslintrc +++ b/.eslintrc @@ -30,7 +30,6 @@ "Npm" : false, "Package" : false, "parentCall" : false, - "Reload" : false, "RocketChat" : true, "RocketChatFile" : false, "RoomHistoryManager" : false, diff --git a/packages/rocketchat-ui-account/client/accountPreferences.js b/packages/rocketchat-ui-account/client/accountPreferences.js index c9af7737e24a..54fcaf3d5690 100644 --- a/packages/rocketchat-ui-account/client/accountPreferences.js +++ b/packages/rocketchat-ui-account/client/accountPreferences.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { Reload } from 'meteor/reload'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; From 7346aa3c4cf2402bb92bc6a0b06332f84d1e2eca Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Fri, 26 Oct 2018 10:22:55 -0300 Subject: [PATCH 26/34] Remove global variable CryptoJS --- .eslintrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index f54930e44130..dc4eadaec637 100644 --- a/.eslintrc +++ b/.eslintrc @@ -12,7 +12,6 @@ "ChatMessages" : false, "ChatRoom" : false, "ChatSubscription" : false, - "CryptoJS" : false, "Department" : false, "FileUpload" : false, "getNextAgent" : false, From 5f9a3d4b733e8ad4604a9035709fdb57c95b60ef Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Fri, 26 Oct 2018 11:42:02 -0300 Subject: [PATCH 27/34] Remove global variable Template --- .eslintrc | 1 - client/helpers/escapeCssUrl.js | 2 ++ client/helpers/log.js | 2 ++ client/helpers/not.js | 2 ++ imports/message-read-receipt/client/main.js | 2 ++ imports/message-read-receipt/client/readReceipts.js | 1 + imports/personal-access-tokens/client/personalAccessTokens.js | 1 + packages/chatpal-search/client/template/admin.js | 1 + packages/chatpal-search/client/template/result.js | 1 + packages/chatpal-search/client/template/suggestion.js | 2 ++ packages/meteor-autocomplete/client/templates.js | 1 + packages/rocketchat-2fa/client/accountSecurity.js | 1 + packages/rocketchat-action-links/client/init.js | 1 + packages/rocketchat-analytics/client/loadScript.js | 1 + packages/rocketchat-apps/client/admin/appInstall.js | 1 + packages/rocketchat-apps/client/admin/appLogs.js | 1 + packages/rocketchat-apps/client/admin/appManage.js | 1 + packages/rocketchat-apps/client/admin/appWhatIsIt.js | 1 + packages/rocketchat-apps/client/admin/apps.js | 1 + packages/rocketchat-authorization/client/hasPermission.js | 1 + packages/rocketchat-authorization/client/views/permissions.js | 1 + .../rocketchat-authorization/client/views/permissionsRole.js | 1 + .../client/views/autoTranslateFlexTab.js | 1 + .../client/views/mailMessagesInstructions.js | 1 + .../rocketchat-channel-settings/client/views/channelSettings.js | 1 + packages/rocketchat-custom-sounds/client/admin/adminSounds.js | 1 + packages/rocketchat-custom-sounds/client/admin/soundEdit.js | 1 + packages/rocketchat-custom-sounds/client/admin/soundInfo.js | 1 + packages/rocketchat-emoji-custom/admin/adminEmoji.js | 1 + packages/rocketchat-emoji-custom/admin/emojiEdit.js | 1 + packages/rocketchat-emoji-custom/admin/emojiInfo.js | 1 + packages/rocketchat-emoji/client/lib/emojiRenderer.js | 1 + packages/rocketchat-google-natural-language/client/index.js | 2 ++ packages/rocketchat-importer/client/admin/adminImport.js | 1 + packages/rocketchat-importer/client/admin/adminImportPrepare.js | 1 + .../rocketchat-importer/client/admin/adminImportProgress.js | 1 + packages/rocketchat-integrations/client/views/integrations.js | 1 + .../client/views/integrationsIncoming.js | 1 + .../rocketchat-integrations/client/views/integrationsNew.js | 2 ++ .../client/views/integrationsOutgoing.js | 1 + .../client/views/integrationsOutgoingHistory.js | 1 + packages/rocketchat-lazy-load/client/lazyloadImage.js | 1 + packages/rocketchat-lib/client/views/customFieldsForm.js | 1 + packages/rocketchat-livechat/.app/client/lib/commands.js | 1 + packages/rocketchat-livechat/.app/client/views/avatar.js | 1 + .../rocketchat-livechat/.app/client/views/livechatWindow.js | 1 + packages/rocketchat-livechat/.app/client/views/message.js | 1 + .../rocketchat-livechat/.app/client/views/messageAttachment.js | 2 ++ packages/rocketchat-livechat/.app/client/views/messages.js | 1 + packages/rocketchat-livechat/.app/client/views/offlineForm.js | 1 + packages/rocketchat-livechat/.app/client/views/options.js | 1 + packages/rocketchat-livechat/.app/client/views/register.js | 1 + packages/rocketchat-livechat/.app/client/views/survey.js | 1 + .../rocketchat-livechat/.app/client/views/switchDepartment.js | 1 + packages/rocketchat-livechat/.app/client/views/videoCall.js | 1 + .../client/views/app/analytics/livechatAnalytics.js | 1 + .../views/app/analytics/livechatAnalyticsCustomDaterange.js | 2 +- .../client/views/app/analytics/livechatAnalyticsDaterange.js | 2 +- .../client/views/app/analytics/livechatRealTimeMonitoring.js | 1 + .../views/app/integrations/livechatIntegrationFacebook.js | 1 + .../client/views/app/integrations/livechatIntegrationWebhook.js | 1 + .../rocketchat-livechat/client/views/app/livechatAppearance.js | 1 + .../client/views/app/livechatCurrentChats.js | 1 + .../client/views/app/livechatCustomFieldForm.js | 1 + .../client/views/app/livechatCustomFields.js | 1 + .../client/views/app/livechatDepartmentForm.js | 1 + .../rocketchat-livechat/client/views/app/livechatDepartments.js | 1 + .../client/views/app/livechatInstallation.js | 1 + .../rocketchat-livechat/client/views/app/livechatOfficeHours.js | 1 + packages/rocketchat-livechat/client/views/app/livechatQueue.js | 1 + .../rocketchat-livechat/client/views/app/livechatTriggers.js | 1 + .../client/views/app/livechatTriggersForm.js | 2 ++ packages/rocketchat-livechat/client/views/app/livechatUsers.js | 1 + .../client/views/app/tabbar/externalSearch.js | 2 ++ .../rocketchat-livechat/client/views/app/tabbar/visitorEdit.js | 1 + .../client/views/app/tabbar/visitorForward.js | 1 + .../client/views/app/tabbar/visitorHistory.js | 1 + .../rocketchat-livechat/client/views/app/tabbar/visitorInfo.js | 1 + .../client/views/app/tabbar/visitorNavigation.js | 1 + .../client/views/app/triggers/livechatTriggerAction.js | 1 + .../client/views/app/triggers/livechatTriggerCondition.js | 2 ++ packages/rocketchat-livechat/client/views/sideNav/livechat.js | 1 + .../rocketchat-livechat/client/views/sideNav/livechatFlex.js | 2 ++ packages/rocketchat-livestream/client/views/broadcastView.js | 1 + packages/rocketchat-livestream/client/views/liveStreamTab.js | 1 + packages/rocketchat-livestream/client/views/liveStreamView.js | 1 + packages/rocketchat-logger/client/views/viewLogs.js | 1 + packages/rocketchat-mail-messages/client/views/mailer.js | 1 + .../rocketchat-mail-messages/client/views/mailerUnsubscribe.js | 2 ++ packages/rocketchat-mentions-flextab/client/actionButton.js | 1 + .../rocketchat-mentions-flextab/client/views/mentionsFlexTab.js | 1 + packages/rocketchat-message-action/client/messageAction.js | 2 ++ .../rocketchat-message-attachments/client/messageAttachment.js | 1 + packages/rocketchat-message-pin/client/actionButton.js | 1 + packages/rocketchat-message-pin/client/views/pinnedMessages.js | 1 + packages/rocketchat-message-snippet/client/page/snippetPage.js | 1 + .../client/tabBar/views/snippetedMessages.js | 1 + packages/rocketchat-message-star/client/actionButton.js | 1 + .../rocketchat-message-star/client/views/starredMessages.js | 1 + .../admin/client/views/oauthApp.js | 1 + .../admin/client/views/oauthApps.js | 1 + .../oauth/client/oauth2-client.js | 1 + packages/rocketchat-oembed/client/baseWidget.js | 2 ++ packages/rocketchat-oembed/client/oembedAudioWidget.js | 1 + packages/rocketchat-oembed/client/oembedFrameWidget.js | 1 + packages/rocketchat-oembed/client/oembedImageWidget.js | 1 + packages/rocketchat-oembed/client/oembedSandstormGrain.js | 1 + packages/rocketchat-oembed/client/oembedUrlWidget.js | 1 + packages/rocketchat-oembed/client/oembedVideoWidget.js | 1 + packages/rocketchat-oembed/client/oembedYoutubeWidget.js | 1 + packages/rocketchat-otr/client/views/otrFlexTab.js | 1 + .../client/views/pushNotificationsFlexTab.js | 1 + packages/rocketchat-reactions/client/init.js | 1 + packages/rocketchat-search/client/provider/result.js | 1 + packages/rocketchat-search/client/search/search.js | 1 + packages/rocketchat-setup-wizard/client/final.js | 1 + packages/rocketchat-setup-wizard/client/setupWizard.js | 1 + packages/rocketchat-slider/rocketchat-slider.js | 2 ++ packages/rocketchat-spotify/lib/client/widget.js | 2 ++ packages/rocketchat-tokenpass/client/tokenChannelsList.js | 1 + .../rocketchat-tokenpass/client/tokenpassChannelSettings.js | 1 + packages/rocketchat-tooltip/client/init.js | 2 ++ packages/rocketchat-tooltip/client/rocketchat-tooltip.js | 2 ++ packages/rocketchat-ui-account/client/account.js | 1 + packages/rocketchat-ui-account/client/accountFlex.js | 2 ++ packages/rocketchat-ui-account/client/accountIntegrations.js | 1 + packages/rocketchat-ui-account/client/accountPreferences.js | 1 + packages/rocketchat-ui-account/client/accountProfile.js | 1 + packages/rocketchat-ui-account/client/avatar/avatar.js | 1 + packages/rocketchat-ui-account/client/avatar/prompt.js | 1 + packages/rocketchat-ui-admin/client/admin.js | 1 + packages/rocketchat-ui-admin/client/adminFlex.js | 1 + packages/rocketchat-ui-admin/client/adminInfo.js | 1 + packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js | 1 + packages/rocketchat-ui-admin/client/rooms/adminRooms.js | 1 + .../rocketchat-ui-admin/client/rooms/channelSettingsDefault.js | 1 + packages/rocketchat-ui-admin/client/users/adminInviteUser.js | 1 + packages/rocketchat-ui-admin/client/users/adminUserChannels.js | 1 + packages/rocketchat-ui-admin/client/users/adminUsers.js | 1 + .../rocketchat-ui-clean-history/client/views/cleanHistory.js | 1 + packages/rocketchat-ui-flextab/client/flexTabBar.js | 1 + packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js | 1 + packages/rocketchat-ui-flextab/client/tabs/membersList.js | 1 + packages/rocketchat-ui-flextab/client/tabs/uploadedFilesList.js | 1 + packages/rocketchat-ui-flextab/client/tabs/userEdit.js | 1 + packages/rocketchat-ui-flextab/client/tabs/userInfo.js | 1 + packages/rocketchat-ui-login/client/login/footer.js | 1 + packages/rocketchat-ui-login/client/login/form.js | 1 + packages/rocketchat-ui-login/client/login/header.js | 2 ++ packages/rocketchat-ui-login/client/login/layout.js | 2 ++ packages/rocketchat-ui-login/client/login/services.js | 1 + .../rocketchat-ui-login/client/reset-password/resetPassword.js | 1 + packages/rocketchat-ui-login/client/username/layout.js | 2 ++ packages/rocketchat-ui-login/client/username/username.js | 1 + packages/rocketchat-ui-master/client/main.js | 1 + packages/rocketchat-ui-message/client/message.js | 1 + packages/rocketchat-ui-message/client/messageBox.js | 1 + packages/rocketchat-ui-message/client/popup/messagePopup.js | 1 + .../rocketchat-ui-message/client/popup/messagePopupChannel.js | 2 ++ .../rocketchat-ui-message/client/popup/messagePopupConfig.js | 1 + .../rocketchat-ui-message/client/popup/messagePopupEmoji.js | 2 ++ .../client/popup/messagePopupSlashCommandPreview.js | 1 + packages/rocketchat-ui-sidenav/client/chatRoomItem.js | 1 + packages/rocketchat-ui-sidenav/client/createCombinedFlex.js | 1 + packages/rocketchat-ui-sidenav/client/listChannelsFlex.js | 1 + packages/rocketchat-ui-sidenav/client/listCombinedFlex.js | 1 + packages/rocketchat-ui-sidenav/client/listPrivateGroupsFlex.js | 1 + packages/rocketchat-ui-sidenav/client/roomList.js | 1 + packages/rocketchat-ui-sidenav/client/sideNav.js | 1 + packages/rocketchat-ui-sidenav/client/sidebarHeader.js | 1 + packages/rocketchat-ui-sidenav/client/sidebarItem.js | 1 + packages/rocketchat-ui-sidenav/client/sortlist.js | 1 + packages/rocketchat-ui-sidenav/client/toolbar.js | 1 + packages/rocketchat-ui-vrecord/client/VRecDialog.js | 1 + packages/rocketchat-ui-vrecord/client/vrecord.js | 1 + packages/rocketchat-ui/client/components/contextualBar.js | 2 ++ packages/rocketchat-ui/client/components/header/header.js | 1 + packages/rocketchat-ui/client/components/icon.js | 1 + packages/rocketchat-ui/client/components/popupList.js | 2 ++ packages/rocketchat-ui/client/components/selectDropdown.js | 1 + packages/rocketchat-ui/client/components/table.js | 1 + packages/rocketchat-ui/client/components/tabs.js | 1 + packages/rocketchat-ui/client/lib/RoomManager.js | 1 + .../rocketchat-ui/client/lib/codeMirror/codeMirrorComponent.js | 1 + packages/rocketchat-ui/client/views/404/roomNotFound.js | 1 + packages/rocketchat-ui/client/views/app/alerts.js | 1 + packages/rocketchat-ui/client/views/app/burger.js | 1 + packages/rocketchat-ui/client/views/app/createChannel.js | 1 + packages/rocketchat-ui/client/views/app/directory.js | 1 + packages/rocketchat-ui/client/views/app/fullModal.js | 1 + packages/rocketchat-ui/client/views/app/home.js | 2 ++ packages/rocketchat-ui/client/views/app/modal.js | 1 + packages/rocketchat-ui/client/views/app/popout.js | 1 + packages/rocketchat-ui/client/views/app/popover.js | 1 + packages/rocketchat-ui/client/views/app/room.js | 1 + packages/rocketchat-ui/client/views/app/roomSearch.js | 2 ++ packages/rocketchat-ui/client/views/app/secretURL.js | 1 + .../rocketchat-ui/client/views/app/videoCall/videoButtons.js | 1 + packages/rocketchat-ui/client/views/app/videoCall/videoCall.js | 1 + packages/rocketchat-ui/client/views/cmsPage.js | 1 + packages/rocketchat-ui/client/views/fxos.js | 1 + packages/rocketchat-ui/client/views/modal.js | 2 ++ packages/rocketchat-videobridge/client/views/videoFlexTab.js | 1 + packages/rocketchat-videobridge/client/views/videoFlexTabBbb.js | 1 + packages/rocketchat-webdav/client/addWebdavAccount.js | 1 + packages/rocketchat-webdav/client/selectWebdavAccount.js | 1 + packages/rocketchat-webdav/client/webdavFilePicker.js | 1 + 207 files changed, 236 insertions(+), 3 deletions(-) diff --git a/.eslintrc b/.eslintrc index dc4eadaec637..c8a7583d7b80 100644 --- a/.eslintrc +++ b/.eslintrc @@ -39,7 +39,6 @@ "t" : false, "TAPi18n" : false, "TAPi18next" : false, - "Template" : false, "TimeSync" : false, "toastr" : false, "Trigger" : false, diff --git a/client/helpers/escapeCssUrl.js b/client/helpers/escapeCssUrl.js index bc4344794d3a..fccb4e69a91e 100644 --- a/client/helpers/escapeCssUrl.js +++ b/client/helpers/escapeCssUrl.js @@ -1 +1,3 @@ +import { Template } from 'meteor/templating'; + Template.registerHelper('escapeCssUrl', (url) => url.replace(/(['"])/g, '\\$1')); diff --git a/client/helpers/log.js b/client/helpers/log.js index cdbd6fa466dc..748583b9a0db 100644 --- a/client/helpers/log.js +++ b/client/helpers/log.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.registerHelper('log', (...args) => { console.log.apply(console, args); }); diff --git a/client/helpers/not.js b/client/helpers/not.js index 9d5597e28f25..a47086b4468b 100644 --- a/client/helpers/not.js +++ b/client/helpers/not.js @@ -1 +1,3 @@ +import { Template } from 'meteor/templating'; + Template.registerHelper('not', (value) => !value); diff --git a/imports/message-read-receipt/client/main.js b/imports/message-read-receipt/client/main.js index a40a8b0a6190..5203d1bb11a0 100644 --- a/imports/message-read-receipt/client/main.js +++ b/imports/message-read-receipt/client/main.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.main.helpers({ readReceiptsEnabled() { if (RocketChat.settings.get('Message_Read_Receipt_Store_Users')) { diff --git a/imports/message-read-receipt/client/readReceipts.js b/imports/message-read-receipt/client/readReceipts.js index 6a96df0e196b..7b350be120f0 100644 --- a/imports/message-read-receipt/client/readReceipts.js +++ b/imports/message-read-receipt/client/readReceipts.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; import moment from 'moment'; import './readReceipts.css'; diff --git a/imports/personal-access-tokens/client/personalAccessTokens.js b/imports/personal-access-tokens/client/personalAccessTokens.js index c7530530e9a4..348bc6ba9a8c 100644 --- a/imports/personal-access-tokens/client/personalAccessTokens.js +++ b/imports/personal-access-tokens/client/personalAccessTokens.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { Mongo } from 'meteor/mongo'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; import moment from 'moment'; diff --git a/packages/chatpal-search/client/template/admin.js b/packages/chatpal-search/client/template/admin.js index 6882d2bb5a3a..df7be6bf5ccc 100644 --- a/packages/chatpal-search/client/template/admin.js +++ b/packages/chatpal-search/client/template/admin.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; Template.ChatpalAdmin.onCreated(function() { diff --git a/packages/chatpal-search/client/template/result.js b/packages/chatpal-search/client/template/result.js index 99234087480c..bca2de535ec5 100644 --- a/packages/chatpal-search/client/template/result.js +++ b/packages/chatpal-search/client/template/result.js @@ -1,6 +1,7 @@ import { DateFormat } from 'meteor/rocketchat:lib'; import { ReactiveVar } from 'meteor/reactive-var'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; Template.ChatpalSearchResultTemplate.onCreated(function() { this.badRequest = new ReactiveVar(false); diff --git a/packages/chatpal-search/client/template/suggestion.js b/packages/chatpal-search/client/template/suggestion.js index 85f07f26c18c..8cc3e7ee27c2 100644 --- a/packages/chatpal-search/client/template/suggestion.js +++ b/packages/chatpal-search/client/template/suggestion.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.ChatpalSuggestionItemTemplate.onCreated(function() { if (this.data.type === 'link') { this.data.action = () => { diff --git a/packages/meteor-autocomplete/client/templates.js b/packages/meteor-autocomplete/client/templates.js index f09892f6b2b7..388bb5726b4f 100755 --- a/packages/meteor-autocomplete/client/templates.js +++ b/packages/meteor-autocomplete/client/templates.js @@ -1,5 +1,6 @@ /* globals AutoComplete */ import { Blaze } from 'meteor/blaze'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; // Events on template instances, sent to the autocomplete class diff --git a/packages/rocketchat-2fa/client/accountSecurity.js b/packages/rocketchat-2fa/client/accountSecurity.js index dc61eebbface..ebd91024a9da 100644 --- a/packages/rocketchat-2fa/client/accountSecurity.js +++ b/packages/rocketchat-2fa/client/accountSecurity.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; import qrcode from 'yaqrcode'; diff --git a/packages/rocketchat-action-links/client/init.js b/packages/rocketchat-action-links/client/init.js index 9a5969e84285..bea7736137cb 100644 --- a/packages/rocketchat-action-links/client/init.js +++ b/packages/rocketchat-action-links/client/init.js @@ -1,5 +1,6 @@ /* globals fireGlobalEvent */ import { Blaze } from 'meteor/blaze'; +import { Template } from 'meteor/templating'; Template.room.events({ 'click .action-link'(event, instance) { diff --git a/packages/rocketchat-analytics/client/loadScript.js b/packages/rocketchat-analytics/client/loadScript.js index d07e263bafc5..214666bbb4bd 100644 --- a/packages/rocketchat-analytics/client/loadScript.js +++ b/packages/rocketchat-analytics/client/loadScript.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; +import { Template } from 'meteor/templating'; Template.body.onRendered(() => { Tracker.autorun((c) => { diff --git a/packages/rocketchat-apps/client/admin/appInstall.js b/packages/rocketchat-apps/client/admin/appInstall.js index 74bca8c0f2f4..f5e15623ef51 100644 --- a/packages/rocketchat-apps/client/admin/appInstall.js +++ b/packages/rocketchat-apps/client/admin/appInstall.js @@ -9,6 +9,7 @@ // over the passed in body, so if both are found it will only use the url. import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; Template.appInstall.helpers({ appFile() { diff --git a/packages/rocketchat-apps/client/admin/appLogs.js b/packages/rocketchat-apps/client/admin/appLogs.js index 87abe27c8ac3..4212257aa03d 100644 --- a/packages/rocketchat-apps/client/admin/appLogs.js +++ b/packages/rocketchat-apps/client/admin/appLogs.js @@ -1,5 +1,6 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import moment from 'moment'; import hljs from 'highlight.js'; diff --git a/packages/rocketchat-apps/client/admin/appManage.js b/packages/rocketchat-apps/client/admin/appManage.js index 6cfdf3e621bb..f2114356932a 100644 --- a/packages/rocketchat-apps/client/admin/appManage.js +++ b/packages/rocketchat-apps/client/admin/appManage.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-apps/client/admin/appWhatIsIt.js b/packages/rocketchat-apps/client/admin/appWhatIsIt.js index d7a0ba6d2925..5da60b4b05b9 100644 --- a/packages/rocketchat-apps/client/admin/appWhatIsIt.js +++ b/packages/rocketchat-apps/client/admin/appWhatIsIt.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; Template.appWhatIsIt.onCreated(function() { this.isLoading = new ReactiveVar(false); diff --git a/packages/rocketchat-apps/client/admin/apps.js b/packages/rocketchat-apps/client/admin/apps.js index 5afef674467d..d89aad367b92 100644 --- a/packages/rocketchat-apps/client/admin/apps.js +++ b/packages/rocketchat-apps/client/admin/apps.js @@ -1,6 +1,7 @@ import toastr from 'toastr'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import { AppEvents } from '../communication'; const ENABLED_STATUS = ['auto_enabled', 'manually_enabled']; diff --git a/packages/rocketchat-authorization/client/hasPermission.js b/packages/rocketchat-authorization/client/hasPermission.js index e62928bc7eb4..459e6cb48ebf 100644 --- a/packages/rocketchat-authorization/client/hasPermission.js +++ b/packages/rocketchat-authorization/client/hasPermission.js @@ -1,5 +1,6 @@ /* globals ChatPermissions */ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; function atLeastOne(permissions = [], scope) { return permissions.some((permissionId) => { diff --git a/packages/rocketchat-authorization/client/views/permissions.js b/packages/rocketchat-authorization/client/views/permissions.js index 4aa6d34850d7..0179dbb26a52 100644 --- a/packages/rocketchat-authorization/client/views/permissions.js +++ b/packages/rocketchat-authorization/client/views/permissions.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { Template } from 'meteor/templating'; Template.permissions.helpers({ role() { diff --git a/packages/rocketchat-authorization/client/views/permissionsRole.js b/packages/rocketchat-authorization/client/views/permissionsRole.js index 3a056ef8d4c1..675f008f9b93 100644 --- a/packages/rocketchat-authorization/client/views/permissionsRole.js +++ b/packages/rocketchat-authorization/client/views/permissionsRole.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; Template.permissionsRole.helpers({ diff --git a/packages/rocketchat-autotranslate/client/views/autoTranslateFlexTab.js b/packages/rocketchat-autotranslate/client/views/autoTranslateFlexTab.js index c3a67f9378af..1c08c4e4b0ca 100644 --- a/packages/rocketchat-autotranslate/client/views/autoTranslateFlexTab.js +++ b/packages/rocketchat-autotranslate/client/views/autoTranslateFlexTab.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js b/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js index b8094da85623..8142dc0455c2 100644 --- a/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js +++ b/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Blaze } from 'meteor/blaze'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; import resetSelection from '../resetSelection'; diff --git a/packages/rocketchat-channel-settings/client/views/channelSettings.js b/packages/rocketchat-channel-settings/client/views/channelSettings.js index 3fd090f6261f..35d6ba612a69 100644 --- a/packages/rocketchat-channel-settings/client/views/channelSettings.js +++ b/packages/rocketchat-channel-settings/client/views/channelSettings.js @@ -1,6 +1,7 @@ /* globals popover */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; import moment from 'moment'; import s from 'underscore.string'; diff --git a/packages/rocketchat-custom-sounds/client/admin/adminSounds.js b/packages/rocketchat-custom-sounds/client/admin/adminSounds.js index 8652eab10aa5..8a6669d75a42 100644 --- a/packages/rocketchat-custom-sounds/client/admin/adminSounds.js +++ b/packages/rocketchat-custom-sounds/client/admin/adminSounds.js @@ -2,6 +2,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { RocketChatTabBar } from 'meteor/rocketchat:lib'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import s from 'underscore.string'; Template.adminSounds.helpers({ diff --git a/packages/rocketchat-custom-sounds/client/admin/soundEdit.js b/packages/rocketchat-custom-sounds/client/admin/soundEdit.js index db8306f9b4ae..0936ce7058df 100644 --- a/packages/rocketchat-custom-sounds/client/admin/soundEdit.js +++ b/packages/rocketchat-custom-sounds/client/admin/soundEdit.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; import s from 'underscore.string'; diff --git a/packages/rocketchat-custom-sounds/client/admin/soundInfo.js b/packages/rocketchat-custom-sounds/client/admin/soundInfo.js index b4c05674aec3..20ace93335fc 100644 --- a/packages/rocketchat-custom-sounds/client/admin/soundInfo.js +++ b/packages/rocketchat-custom-sounds/client/admin/soundInfo.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; Template.soundInfo.helpers({ name() { diff --git a/packages/rocketchat-emoji-custom/admin/adminEmoji.js b/packages/rocketchat-emoji-custom/admin/adminEmoji.js index baaf828669ea..2db75346b815 100644 --- a/packages/rocketchat-emoji-custom/admin/adminEmoji.js +++ b/packages/rocketchat-emoji-custom/admin/adminEmoji.js @@ -2,6 +2,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { RocketChatTabBar } from 'meteor/rocketchat:lib'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import s from 'underscore.string'; Template.adminEmoji.helpers({ diff --git a/packages/rocketchat-emoji-custom/admin/emojiEdit.js b/packages/rocketchat-emoji-custom/admin/emojiEdit.js index aab3c6847a07..db54ad90d871 100644 --- a/packages/rocketchat-emoji-custom/admin/emojiEdit.js +++ b/packages/rocketchat-emoji-custom/admin/emojiEdit.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; import s from 'underscore.string'; diff --git a/packages/rocketchat-emoji-custom/admin/emojiInfo.js b/packages/rocketchat-emoji-custom/admin/emojiInfo.js index 719645032b28..f1d37568ff9c 100644 --- a/packages/rocketchat-emoji-custom/admin/emojiInfo.js +++ b/packages/rocketchat-emoji-custom/admin/emojiInfo.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; Template.emojiInfo.helpers({ name() { diff --git a/packages/rocketchat-emoji/client/lib/emojiRenderer.js b/packages/rocketchat-emoji/client/lib/emojiRenderer.js index bd36c0c02198..a14d00c7819d 100644 --- a/packages/rocketchat-emoji/client/lib/emojiRenderer.js +++ b/packages/rocketchat-emoji/client/lib/emojiRenderer.js @@ -1,5 +1,6 @@ /* globals HTML, isSetNotNull, renderEmoji:true */ import { Blaze } from 'meteor/blaze'; +import { Template } from 'meteor/templating'; renderEmoji = function(emoji) { if (isSetNotNull(() => RocketChat.emoji.list[emoji].emojiPackage)) { diff --git a/packages/rocketchat-google-natural-language/client/index.js b/packages/rocketchat-google-natural-language/client/index.js index 54c142e259c4..87e98186e36d 100644 --- a/packages/rocketchat-google-natural-language/client/index.js +++ b/packages/rocketchat-google-natural-language/client/index.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.room.helpers({ sentimentSmile() { if (!RocketChat.settings.get('GoogleNaturalLanguage_Enabled')) { diff --git a/packages/rocketchat-importer/client/admin/adminImport.js b/packages/rocketchat-importer/client/admin/adminImport.js index 1b75385a5fd1..3ece3a281ef6 100644 --- a/packages/rocketchat-importer/client/admin/adminImport.js +++ b/packages/rocketchat-importer/client/admin/adminImport.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Importers } from 'meteor/rocketchat:importer'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; Template.adminImport.helpers({ isAdmin() { diff --git a/packages/rocketchat-importer/client/admin/adminImportPrepare.js b/packages/rocketchat-importer/client/admin/adminImportPrepare.js index de194fe9e60e..b121154e81b4 100644 --- a/packages/rocketchat-importer/client/admin/adminImportPrepare.js +++ b/packages/rocketchat-importer/client/admin/adminImportPrepare.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Importers } from 'meteor/rocketchat:importer'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; Template.adminImportPrepare.helpers({ diff --git a/packages/rocketchat-importer/client/admin/adminImportProgress.js b/packages/rocketchat-importer/client/admin/adminImportProgress.js index aab550bde208..1a9d51c19c1c 100644 --- a/packages/rocketchat-importer/client/admin/adminImportProgress.js +++ b/packages/rocketchat-importer/client/admin/adminImportProgress.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Importers, ImporterWebsocketReceiver, ProgressStep } from 'meteor/rocketchat:importer'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; diff --git a/packages/rocketchat-integrations/client/views/integrations.js b/packages/rocketchat-integrations/client/views/integrations.js index 9ab884d8d252..4bfc283894dc 100644 --- a/packages/rocketchat-integrations/client/views/integrations.js +++ b/packages/rocketchat-integrations/client/views/integrations.js @@ -1,4 +1,5 @@ /* global ChatIntegrations */ +import { Template } from 'meteor/templating'; import moment from 'moment'; Template.integrations.helpers({ diff --git a/packages/rocketchat-integrations/client/views/integrationsIncoming.js b/packages/rocketchat-integrations/client/views/integrationsIncoming.js index 1f443d304e34..adefe458cfda 100644 --- a/packages/rocketchat-integrations/client/views/integrationsIncoming.js +++ b/packages/rocketchat-integrations/client/views/integrationsIncoming.js @@ -4,6 +4,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import hljs from 'highlight.js'; import toastr from 'toastr'; diff --git a/packages/rocketchat-integrations/client/views/integrationsNew.js b/packages/rocketchat-integrations/client/views/integrationsNew.js index 400dde895506..c031de980058 100644 --- a/packages/rocketchat-integrations/client/views/integrationsNew.js +++ b/packages/rocketchat-integrations/client/views/integrationsNew.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.integrationsNew.helpers({ hasPermission() { return RocketChat.authz.hasAtLeastOnePermission(['manage-integrations', 'manage-own-integrations']); diff --git a/packages/rocketchat-integrations/client/views/integrationsOutgoing.js b/packages/rocketchat-integrations/client/views/integrationsOutgoing.js index c21db20b4d69..dad25ba99e29 100644 --- a/packages/rocketchat-integrations/client/views/integrationsOutgoing.js +++ b/packages/rocketchat-integrations/client/views/integrationsOutgoing.js @@ -4,6 +4,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import hljs from 'highlight.js'; import toastr from 'toastr'; diff --git a/packages/rocketchat-integrations/client/views/integrationsOutgoingHistory.js b/packages/rocketchat-integrations/client/views/integrationsOutgoingHistory.js index 57377d6c31c4..f6a4e50db5a0 100644 --- a/packages/rocketchat-integrations/client/views/integrationsOutgoingHistory.js +++ b/packages/rocketchat-integrations/client/views/integrationsOutgoingHistory.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import hljs from 'highlight.js'; import moment from 'moment'; diff --git a/packages/rocketchat-lazy-load/client/lazyloadImage.js b/packages/rocketchat-lazy-load/client/lazyloadImage.js index cf8b79664dc8..be94ca2ca11b 100644 --- a/packages/rocketchat-lazy-load/client/lazyloadImage.js +++ b/packages/rocketchat-lazy-load/client/lazyloadImage.js @@ -1,4 +1,5 @@ import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; import './lazyloadImage.html'; import { addImage, fixCordova } from './'; diff --git a/packages/rocketchat-lib/client/views/customFieldsForm.js b/packages/rocketchat-lib/client/views/customFieldsForm.js index 40b4f4873eba..52949d9eb722 100644 --- a/packages/rocketchat-lib/client/views/customFieldsForm.js +++ b/packages/rocketchat-lib/client/views/customFieldsForm.js @@ -1,5 +1,6 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { Template } from 'meteor/templating'; Template.customFieldsForm.helpers({ new() { diff --git a/packages/rocketchat-livechat/.app/client/lib/commands.js b/packages/rocketchat-livechat/.app/client/lib/commands.js index be002cbf4078..71462d0ba35e 100644 --- a/packages/rocketchat-livechat/.app/client/lib/commands.js +++ b/packages/rocketchat-livechat/.app/client/lib/commands.js @@ -1,6 +1,7 @@ /* globals LivechatVideoCall, Livechat */ import { Meteor } from 'meteor/meteor'; import { Blaze } from 'meteor/blaze'; +import { Template } from 'meteor/templating'; import swal from 'sweetalert2'; import visitor from '../../imports/client/visitor'; diff --git a/packages/rocketchat-livechat/.app/client/views/avatar.js b/packages/rocketchat-livechat/.app/client/views/avatar.js index ebd0572b5974..3fc7c01b6638 100644 --- a/packages/rocketchat-livechat/.app/client/views/avatar.js +++ b/packages/rocketchat-livechat/.app/client/views/avatar.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import visitor from '../../imports/client/visitor'; Template.avatar.helpers({ diff --git a/packages/rocketchat-livechat/.app/client/views/livechatWindow.js b/packages/rocketchat-livechat/.app/client/views/livechatWindow.js index c99c09fc3581..29b7ac220e54 100644 --- a/packages/rocketchat-livechat/.app/client/views/livechatWindow.js +++ b/packages/rocketchat-livechat/.app/client/views/livechatWindow.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import visitor from '../../imports/client/visitor'; function showDepartments() { diff --git a/packages/rocketchat-livechat/.app/client/views/message.js b/packages/rocketchat-livechat/.app/client/views/message.js index ea9fd66476ca..0ded2996ce6e 100644 --- a/packages/rocketchat-livechat/.app/client/views/message.js +++ b/packages/rocketchat-livechat/.app/client/views/message.js @@ -1,5 +1,6 @@ /* globals Livechat, t, tr, livechatAutolinker */ import { Blaze } from 'meteor/blaze'; +import { Template } from 'meteor/templating'; import moment from 'moment'; import visitor from '../../imports/client/visitor'; import s from 'underscore.string'; diff --git a/packages/rocketchat-livechat/.app/client/views/messageAttachment.js b/packages/rocketchat-livechat/.app/client/views/messageAttachment.js index 1a26665917de..0312aef32837 100644 --- a/packages/rocketchat-livechat/.app/client/views/messageAttachment.js +++ b/packages/rocketchat-livechat/.app/client/views/messageAttachment.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.messageAttachment.helpers({ getImageHeight(height = 200) { diff --git a/packages/rocketchat-livechat/.app/client/views/messages.js b/packages/rocketchat-livechat/.app/client/views/messages.js index c4ea12aa4201..593bbeb595a7 100644 --- a/packages/rocketchat-livechat/.app/client/views/messages.js +++ b/packages/rocketchat-livechat/.app/client/views/messages.js @@ -1,6 +1,7 @@ /* globals Livechat, LivechatVideoCall, MsgTyping, fileUpload */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; import visitor from '../../imports/client/visitor'; import _ from 'underscore'; import mime from 'mime-type/with-db'; diff --git a/packages/rocketchat-livechat/.app/client/views/offlineForm.js b/packages/rocketchat-livechat/.app/client/views/offlineForm.js index dcff90237085..0243ecef6d20 100644 --- a/packages/rocketchat-livechat/.app/client/views/offlineForm.js +++ b/packages/rocketchat-livechat/.app/client/views/offlineForm.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-livechat/.app/client/views/options.js b/packages/rocketchat-livechat/.app/client/views/options.js index 61ec20f8a1f9..b8ba4742642b 100644 --- a/packages/rocketchat-livechat/.app/client/views/options.js +++ b/packages/rocketchat-livechat/.app/client/views/options.js @@ -1,5 +1,6 @@ /* globals Department, Livechat */ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; import swal from 'sweetalert2'; import visitor from '../../imports/client/visitor'; diff --git a/packages/rocketchat-livechat/.app/client/views/register.js b/packages/rocketchat-livechat/.app/client/views/register.js index d31f76c75158..6eef0bf169e9 100644 --- a/packages/rocketchat-livechat/.app/client/views/register.js +++ b/packages/rocketchat-livechat/.app/client/views/register.js @@ -1,6 +1,7 @@ /* globals Department, Livechat, LivechatVideoCall */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; import visitor from '../../imports/client/visitor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-livechat/.app/client/views/survey.js b/packages/rocketchat-livechat/.app/client/views/survey.js index a5506238abec..1bf5b1a11687 100644 --- a/packages/rocketchat-livechat/.app/client/views/survey.js +++ b/packages/rocketchat-livechat/.app/client/views/survey.js @@ -1,5 +1,6 @@ /* globals */ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; import swal from 'sweetalert2'; import visitor from '../../imports/client/visitor'; diff --git a/packages/rocketchat-livechat/.app/client/views/switchDepartment.js b/packages/rocketchat-livechat/.app/client/views/switchDepartment.js index b170dcd43667..c31e5b6a68c7 100644 --- a/packages/rocketchat-livechat/.app/client/views/switchDepartment.js +++ b/packages/rocketchat-livechat/.app/client/views/switchDepartment.js @@ -1,6 +1,7 @@ /* globals Department, Livechat */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; import swal from 'sweetalert2'; import visitor from '../../imports/client/visitor'; diff --git a/packages/rocketchat-livechat/.app/client/views/videoCall.js b/packages/rocketchat-livechat/.app/client/views/videoCall.js index 95d817a04a84..2b912481d492 100644 --- a/packages/rocketchat-livechat/.app/client/views/videoCall.js +++ b/packages/rocketchat-livechat/.app/client/views/videoCall.js @@ -1,5 +1,6 @@ /* globals LivechatVideoCall */ import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; Template.videoCall.helpers({ visible() { diff --git a/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalytics.js b/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalytics.js index 5511dafb5ae4..7f534af0d56e 100644 --- a/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalytics.js +++ b/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalytics.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { Template } from 'meteor/templating'; import moment from 'moment'; import { drawLineChart } from '../../../lib/chartHandler'; diff --git a/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalyticsCustomDaterange.js b/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalyticsCustomDaterange.js index 12e9f4f99567..f904ef5db745 100644 --- a/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalyticsCustomDaterange.js +++ b/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalyticsCustomDaterange.js @@ -1,5 +1,5 @@ /* globals popover */ - +import { Template } from 'meteor/templating'; import moment from 'moment'; import { setDateRange } from '../../../lib/dateHandler'; diff --git a/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalyticsDaterange.js b/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalyticsDaterange.js index d551d62d16d2..d18e5a05572e 100644 --- a/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalyticsDaterange.js +++ b/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalyticsDaterange.js @@ -1,5 +1,5 @@ /* globals popover */ - +import { Template } from 'meteor/templating'; import moment from 'moment'; import { setDateRange } from '../../../lib/dateHandler'; diff --git a/packages/rocketchat-livechat/client/views/app/analytics/livechatRealTimeMonitoring.js b/packages/rocketchat-livechat/client/views/app/analytics/livechatRealTimeMonitoring.js index b1a085b06218..a1e02fd97fea 100644 --- a/packages/rocketchat-livechat/client/views/app/analytics/livechatRealTimeMonitoring.js +++ b/packages/rocketchat-livechat/client/views/app/analytics/livechatRealTimeMonitoring.js @@ -1,4 +1,5 @@ import { Mongo } from 'meteor/mongo'; +import { Template } from 'meteor/templating'; import moment from 'moment'; import { ReactiveVar } from 'meteor/reactive-var'; import { drawLineChart, drawDoughnutChart, updateChart } from '../../../lib/chartHandler'; diff --git a/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationFacebook.js b/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationFacebook.js index 19feab3b1033..d25a5ae524ba 100644 --- a/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationFacebook.js +++ b/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationFacebook.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; Template.livechatIntegrationFacebook.helpers({ pages() { diff --git a/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationWebhook.js b/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationWebhook.js index 8a4ad736ff87..db3fc1f14524 100644 --- a/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationWebhook.js +++ b/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationWebhook.js @@ -1,6 +1,7 @@ /* globals LivechatIntegration */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatAppearance.js b/packages/rocketchat-livechat/client/views/app/livechatAppearance.js index 2b9c6c173dfb..76e6b6108eeb 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatAppearance.js +++ b/packages/rocketchat-livechat/client/views/app/livechatAppearance.js @@ -4,6 +4,7 @@ import { Meteor } from 'meteor/meteor'; import { Mongo } from 'meteor/mongo'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; +import { Template } from 'meteor/templating'; import s from 'underscore.string'; import moment from 'moment'; import toastr from 'toastr'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js b/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js index 412ad0cd5f5d..57bf67d90715 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js +++ b/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { Mongo } from 'meteor/mongo'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import moment from 'moment'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatCustomFieldForm.js b/packages/rocketchat-livechat/client/views/app/livechatCustomFieldForm.js index 3800045dd074..e5182a0a6219 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatCustomFieldForm.js +++ b/packages/rocketchat-livechat/client/views/app/livechatCustomFieldForm.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; Template.livechatCustomFieldForm.helpers({ diff --git a/packages/rocketchat-livechat/client/views/app/livechatCustomFields.js b/packages/rocketchat-livechat/client/views/app/livechatCustomFields.js index dd2891bd40e8..ba1fba1727c7 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatCustomFields.js +++ b/packages/rocketchat-livechat/client/views/app/livechatCustomFields.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; Template.livechatCustomFields.helpers({ customFields() { diff --git a/packages/rocketchat-livechat/client/views/app/livechatDepartmentForm.js b/packages/rocketchat-livechat/client/views/app/livechatDepartmentForm.js index 17a286807641..b6c202e74533 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatDepartmentForm.js +++ b/packages/rocketchat-livechat/client/views/app/livechatDepartmentForm.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatDepartments.js b/packages/rocketchat-livechat/client/views/app/livechatDepartments.js index 9035d203174a..ddb32c2f8c07 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatDepartments.js +++ b/packages/rocketchat-livechat/client/views/app/livechatDepartments.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; Template.livechatDepartments.helpers({ departments() { diff --git a/packages/rocketchat-livechat/client/views/app/livechatInstallation.js b/packages/rocketchat-livechat/client/views/app/livechatInstallation.js index 71e9a0efa3bc..0392b4c56b66 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatInstallation.js +++ b/packages/rocketchat-livechat/client/views/app/livechatInstallation.js @@ -1,3 +1,4 @@ +import { Template } from 'meteor/templating'; import s from 'underscore.string'; Template.livechatInstallation.helpers({ diff --git a/packages/rocketchat-livechat/client/views/app/livechatOfficeHours.js b/packages/rocketchat-livechat/client/views/app/livechatOfficeHours.js index 7b4200a3dba4..e6d29bc9b7c2 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatOfficeHours.js +++ b/packages/rocketchat-livechat/client/views/app/livechatOfficeHours.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; /* globals LivechatOfficeHour */ import moment from 'moment'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatQueue.js b/packages/rocketchat-livechat/client/views/app/livechatQueue.js index f7808fa73e62..4ee081e7126c 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatQueue.js +++ b/packages/rocketchat-livechat/client/views/app/livechatQueue.js @@ -1,6 +1,7 @@ /* globals LivechatQueueUser */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; Template.livechatQueue.helpers({ departments() { diff --git a/packages/rocketchat-livechat/client/views/app/livechatTriggers.js b/packages/rocketchat-livechat/client/views/app/livechatTriggers.js index a1d899e25cdd..731ee19c6894 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatTriggers.js +++ b/packages/rocketchat-livechat/client/views/app/livechatTriggers.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; Template.livechatTriggers.helpers({ triggers() { diff --git a/packages/rocketchat-livechat/client/views/app/livechatTriggersForm.js b/packages/rocketchat-livechat/client/views/app/livechatTriggersForm.js index fbab189fa6ce..45beac6c6a10 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatTriggersForm.js +++ b/packages/rocketchat-livechat/client/views/app/livechatTriggersForm.js @@ -1,6 +1,8 @@ import { Meteor } from 'meteor/meteor'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; + Template.livechatTriggersForm.helpers({ name() { const trigger = LivechatTrigger.findOne(FlowRouter.getParam('_id')); diff --git a/packages/rocketchat-livechat/client/views/app/livechatUsers.js b/packages/rocketchat-livechat/client/views/app/livechatUsers.js index 483115261542..f523bafafea7 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatUsers.js +++ b/packages/rocketchat-livechat/client/views/app/livechatUsers.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Mongo } from 'meteor/mongo'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import toastr from 'toastr'; let ManagerUsers; diff --git a/packages/rocketchat-livechat/client/views/app/tabbar/externalSearch.js b/packages/rocketchat-livechat/client/views/app/tabbar/externalSearch.js index 259a0cf06fb1..6d4a403a9664 100644 --- a/packages/rocketchat-livechat/client/views/app/tabbar/externalSearch.js +++ b/packages/rocketchat-livechat/client/views/app/tabbar/externalSearch.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.externalSearch.helpers({ messages() { return RocketChat.models.LivechatExternalMessage.findByRoomId(this.rid, { ts: 1 }); diff --git a/packages/rocketchat-livechat/client/views/app/tabbar/visitorEdit.js b/packages/rocketchat-livechat/client/views/app/tabbar/visitorEdit.js index c2d69c8e0594..629250a1647b 100644 --- a/packages/rocketchat-livechat/client/views/app/tabbar/visitorEdit.js +++ b/packages/rocketchat-livechat/client/views/app/tabbar/visitorEdit.js @@ -1,6 +1,7 @@ /* globals LivechatVisitor */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; Template.visitorEdit.helpers({ diff --git a/packages/rocketchat-livechat/client/views/app/tabbar/visitorForward.js b/packages/rocketchat-livechat/client/views/app/tabbar/visitorForward.js index eb218aebd96c..f874f91258a0 100644 --- a/packages/rocketchat-livechat/client/views/app/tabbar/visitorForward.js +++ b/packages/rocketchat-livechat/client/views/app/tabbar/visitorForward.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; Template.visitorForward.helpers({ diff --git a/packages/rocketchat-livechat/client/views/app/tabbar/visitorHistory.js b/packages/rocketchat-livechat/client/views/app/tabbar/visitorHistory.js index 9f9b7ae7dec7..e6bed4e55f74 100644 --- a/packages/rocketchat-livechat/client/views/app/tabbar/visitorHistory.js +++ b/packages/rocketchat-livechat/client/views/app/tabbar/visitorHistory.js @@ -1,4 +1,5 @@ import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; import { Mongo } from 'meteor/mongo'; import moment from 'moment'; const visitorHistory = new Mongo.Collection('visitor_history'); diff --git a/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js b/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js index 19673f09027a..29cfd11204f0 100644 --- a/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js +++ b/packages/rocketchat-livechat/client/views/app/tabbar/visitorInfo.js @@ -4,6 +4,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-livechat/client/views/app/tabbar/visitorNavigation.js b/packages/rocketchat-livechat/client/views/app/tabbar/visitorNavigation.js index acc3307d16cc..1a37193f6bc6 100644 --- a/packages/rocketchat-livechat/client/views/app/tabbar/visitorNavigation.js +++ b/packages/rocketchat-livechat/client/views/app/tabbar/visitorNavigation.js @@ -1,4 +1,5 @@ import { Mongo } from 'meteor/mongo'; +import { Template } from 'meteor/templating'; import moment from 'moment'; const visitorNavigationHistory = new Mongo.Collection('visitor_navigation_history'); diff --git a/packages/rocketchat-livechat/client/views/app/triggers/livechatTriggerAction.js b/packages/rocketchat-livechat/client/views/app/triggers/livechatTriggerAction.js index 5394dd09204a..9169d74b0d97 100644 --- a/packages/rocketchat-livechat/client/views/app/triggers/livechatTriggerAction.js +++ b/packages/rocketchat-livechat/client/views/app/triggers/livechatTriggerAction.js @@ -1,4 +1,5 @@ import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; Template.livechatTriggerAction.helpers({ hiddenValue(current) { diff --git a/packages/rocketchat-livechat/client/views/app/triggers/livechatTriggerCondition.js b/packages/rocketchat-livechat/client/views/app/triggers/livechatTriggerCondition.js index 4a05c79d4509..5e0aa9b068c7 100644 --- a/packages/rocketchat-livechat/client/views/app/triggers/livechatTriggerCondition.js +++ b/packages/rocketchat-livechat/client/views/app/triggers/livechatTriggerCondition.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.livechatTriggerCondition.helpers({ hiddenValue(current) { if (this.name === undefined && Template.instance().firstCondition) { diff --git a/packages/rocketchat-livechat/client/views/sideNav/livechat.js b/packages/rocketchat-livechat/client/views/sideNav/livechat.js index feb4e539669c..26f7554c835d 100644 --- a/packages/rocketchat-livechat/client/views/sideNav/livechat.js +++ b/packages/rocketchat-livechat/client/views/sideNav/livechat.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; Template.livechat.helpers({ isActive() { diff --git a/packages/rocketchat-livechat/client/views/sideNav/livechatFlex.js b/packages/rocketchat-livechat/client/views/sideNav/livechatFlex.js index 30c4155825da..dc3e5cd3025e 100644 --- a/packages/rocketchat-livechat/client/views/sideNav/livechatFlex.js +++ b/packages/rocketchat-livechat/client/views/sideNav/livechatFlex.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.livechatFlex.helpers({ menuItem(name, icon, section) { return { diff --git a/packages/rocketchat-livestream/client/views/broadcastView.js b/packages/rocketchat-livestream/client/views/broadcastView.js index f2ac9bdbd4d1..578e041f3f05 100644 --- a/packages/rocketchat-livestream/client/views/broadcastView.js +++ b/packages/rocketchat-livestream/client/views/broadcastView.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; const getMedia = () => navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; const createAndConnect = (url) => { diff --git a/packages/rocketchat-livestream/client/views/liveStreamTab.js b/packages/rocketchat-livestream/client/views/liveStreamTab.js index 9f4aabe5981e..a8e61533db17 100644 --- a/packages/rocketchat-livestream/client/views/liveStreamTab.js +++ b/packages/rocketchat-livestream/client/views/liveStreamTab.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Blaze } from 'meteor/blaze'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; import { auth } from '../oauth.js'; import { RocketChatAnnouncement } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-livestream/client/views/liveStreamView.js b/packages/rocketchat-livestream/client/views/liveStreamView.js index 93011ba3b0f7..588a6e2d1b90 100644 --- a/packages/rocketchat-livestream/client/views/liveStreamView.js +++ b/packages/rocketchat-livestream/client/views/liveStreamView.js @@ -1,4 +1,5 @@ import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; this.onYouTubePlayerAPIReady = function() { const playerReadyEvent = new Event('playerReady'); diff --git a/packages/rocketchat-logger/client/views/viewLogs.js b/packages/rocketchat-logger/client/views/viewLogs.js index b0ed5591b388..72a62d105a9a 100644 --- a/packages/rocketchat-logger/client/views/viewLogs.js +++ b/packages/rocketchat-logger/client/views/viewLogs.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import moment from 'moment'; // TODO: remove this globals diff --git a/packages/rocketchat-mail-messages/client/views/mailer.js b/packages/rocketchat-mail-messages/client/views/mailer.js index cb9abc1f3abe..b6f1829ca54c 100644 --- a/packages/rocketchat-mail-messages/client/views/mailer.js +++ b/packages/rocketchat-mail-messages/client/views/mailer.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; Template.mailer.helpers({ diff --git a/packages/rocketchat-mail-messages/client/views/mailerUnsubscribe.js b/packages/rocketchat-mail-messages/client/views/mailerUnsubscribe.js index 8012c4deb519..b17122c8542d 100644 --- a/packages/rocketchat-mail-messages/client/views/mailerUnsubscribe.js +++ b/packages/rocketchat-mail-messages/client/views/mailerUnsubscribe.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.mailerUnsubscribe.onRendered(function() { return $('#initial-page-loading').remove(); }); diff --git a/packages/rocketchat-mentions-flextab/client/actionButton.js b/packages/rocketchat-mentions-flextab/client/actionButton.js index c6c55d355077..29f750de54ea 100644 --- a/packages/rocketchat-mentions-flextab/client/actionButton.js +++ b/packages/rocketchat-mentions-flextab/client/actionButton.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; Meteor.startup(function() { RocketChat.MessageAction.addButton({ diff --git a/packages/rocketchat-mentions-flextab/client/views/mentionsFlexTab.js b/packages/rocketchat-mentions-flextab/client/views/mentionsFlexTab.js index eee8673de2c9..c08917cd7b9c 100644 --- a/packages/rocketchat-mentions-flextab/client/views/mentionsFlexTab.js +++ b/packages/rocketchat-mentions-flextab/client/views/mentionsFlexTab.js @@ -1,6 +1,7 @@ /* globals MentionedMessage */ import _ from 'underscore'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; Template.mentionsFlexTab.helpers({ hasMessages() { diff --git a/packages/rocketchat-message-action/client/messageAction.js b/packages/rocketchat-message-action/client/messageAction.js index e1ab79e05ff7..8ec8fcee03c3 100644 --- a/packages/rocketchat-message-action/client/messageAction.js +++ b/packages/rocketchat-message-action/client/messageAction.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.messageAction.helpers({ isButton() { return this.type === 'button'; diff --git a/packages/rocketchat-message-attachments/client/messageAttachment.js b/packages/rocketchat-message-attachments/client/messageAttachment.js index b4a504bbce12..90f09703bfcd 100644 --- a/packages/rocketchat-message-attachments/client/messageAttachment.js +++ b/packages/rocketchat-message-attachments/client/messageAttachment.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { DateFormat } from 'meteor/rocketchat:lib'; import { fixCordova } from 'meteor/rocketchat:lazy-load'; +import { Template } from 'meteor/templating'; const colors = { good: '#35AC19', warning: '#FCB316', diff --git a/packages/rocketchat-message-pin/client/actionButton.js b/packages/rocketchat-message-pin/client/actionButton.js index 49e1d977810d..42c349cb7a17 100644 --- a/packages/rocketchat-message-pin/client/actionButton.js +++ b/packages/rocketchat-message-pin/client/actionButton.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; Meteor.startup(function() { diff --git a/packages/rocketchat-message-pin/client/views/pinnedMessages.js b/packages/rocketchat-message-pin/client/views/pinnedMessages.js index eafb34ce2bce..314242cdb9ec 100644 --- a/packages/rocketchat-message-pin/client/views/pinnedMessages.js +++ b/packages/rocketchat-message-pin/client/views/pinnedMessages.js @@ -1,6 +1,7 @@ /* globals PinnedMessage */ import _ from 'underscore'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; Template.pinnedMessages.helpers({ hasMessages() { diff --git a/packages/rocketchat-message-snippet/client/page/snippetPage.js b/packages/rocketchat-message-snippet/client/page/snippetPage.js index e90b365842a8..8e7089fb7ac8 100644 --- a/packages/rocketchat-message-snippet/client/page/snippetPage.js +++ b/packages/rocketchat-message-snippet/client/page/snippetPage.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { DateFormat } from 'meteor/rocketchat:lib'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import moment from 'moment'; Template.snippetPage.helpers({ diff --git a/packages/rocketchat-message-snippet/client/tabBar/views/snippetedMessages.js b/packages/rocketchat-message-snippet/client/tabBar/views/snippetedMessages.js index 8f5ceb0a915b..bce0a5a976f7 100644 --- a/packages/rocketchat-message-snippet/client/tabBar/views/snippetedMessages.js +++ b/packages/rocketchat-message-snippet/client/tabBar/views/snippetedMessages.js @@ -1,5 +1,6 @@ import _ from 'underscore'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; /* global SnippetedMessages */ Template.snippetedMessages.helpers({ diff --git a/packages/rocketchat-message-star/client/actionButton.js b/packages/rocketchat-message-star/client/actionButton.js index cd526d5c69ba..cbe428be367d 100644 --- a/packages/rocketchat-message-star/client/actionButton.js +++ b/packages/rocketchat-message-star/client/actionButton.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-message-star/client/views/starredMessages.js b/packages/rocketchat-message-star/client/views/starredMessages.js index ddfa2cdc3366..8bc3b838b06e 100644 --- a/packages/rocketchat-message-star/client/views/starredMessages.js +++ b/packages/rocketchat-message-star/client/views/starredMessages.js @@ -1,6 +1,7 @@ /* globals StarredMessage */ import _ from 'underscore'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; Template.starredMessages.helpers({ hasMessages() { diff --git a/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.js b/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.js index 72e6d261db31..545e78849bc6 100644 --- a/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.js +++ b/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; Template.oauthApp.onCreated(function() { diff --git a/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApps.js b/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApps.js index 7cd4dda76ab7..fd7eead8b6e1 100644 --- a/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApps.js +++ b/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApps.js @@ -1,4 +1,5 @@ /* globals ChatOAuthApps */ +import { Template } from 'meteor/templating'; import moment from 'moment'; Template.oauthApps.onCreated(function() { diff --git a/packages/rocketchat-oauth2-server-config/oauth/client/oauth2-client.js b/packages/rocketchat-oauth2-server-config/oauth/client/oauth2-client.js index cebd7716f5e0..3c4df1b89f4b 100644 --- a/packages/rocketchat-oauth2-server-config/oauth/client/oauth2-client.js +++ b/packages/rocketchat-oauth2-server-config/oauth/client/oauth2-client.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { FlowRouter } from 'meteor/kadira:flow-router' ; import { BlazeLayout } from 'meteor/kadira:blaze-layout'; +import { Template } from 'meteor/templating'; FlowRouter.route('/oauth/authorize', { action(params, queryParams) { diff --git a/packages/rocketchat-oembed/client/baseWidget.js b/packages/rocketchat-oembed/client/baseWidget.js index e95d8c00fa06..66263dcf5992 100644 --- a/packages/rocketchat-oembed/client/baseWidget.js +++ b/packages/rocketchat-oembed/client/baseWidget.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.oembedBaseWidget.helpers({ template() { let contentType; diff --git a/packages/rocketchat-oembed/client/oembedAudioWidget.js b/packages/rocketchat-oembed/client/oembedAudioWidget.js index d315532323a9..194b00ae3b81 100644 --- a/packages/rocketchat-oembed/client/oembedAudioWidget.js +++ b/packages/rocketchat-oembed/client/oembedAudioWidget.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; Template.oembedAudioWidget.helpers({ collapsed() { diff --git a/packages/rocketchat-oembed/client/oembedFrameWidget.js b/packages/rocketchat-oembed/client/oembedFrameWidget.js index e6a084b6c803..3f5c69792c39 100644 --- a/packages/rocketchat-oembed/client/oembedFrameWidget.js +++ b/packages/rocketchat-oembed/client/oembedFrameWidget.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; Template.oembedFrameWidget.helpers({ collapsed() { diff --git a/packages/rocketchat-oembed/client/oembedImageWidget.js b/packages/rocketchat-oembed/client/oembedImageWidget.js index 6f5b5fc1f8e7..cf80d8087a19 100644 --- a/packages/rocketchat-oembed/client/oembedImageWidget.js +++ b/packages/rocketchat-oembed/client/oembedImageWidget.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; Template.oembedImageWidget.helpers({ loadImage() { diff --git a/packages/rocketchat-oembed/client/oembedSandstormGrain.js b/packages/rocketchat-oembed/client/oembedSandstormGrain.js index 385279f66d8b..bbb24b9503fb 100644 --- a/packages/rocketchat-oembed/client/oembedSandstormGrain.js +++ b/packages/rocketchat-oembed/client/oembedSandstormGrain.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; Template.oembedSandstormGrain.helpers({ token() { diff --git a/packages/rocketchat-oembed/client/oembedUrlWidget.js b/packages/rocketchat-oembed/client/oembedUrlWidget.js index 5e82730aa87a..e486a97c5293 100644 --- a/packages/rocketchat-oembed/client/oembedUrlWidget.js +++ b/packages/rocketchat-oembed/client/oembedUrlWidget.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Blaze } from 'meteor/blaze'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; const getTitle = function(self) { diff --git a/packages/rocketchat-oembed/client/oembedVideoWidget.js b/packages/rocketchat-oembed/client/oembedVideoWidget.js index 77fac8d1621d..e12ddd2790d6 100644 --- a/packages/rocketchat-oembed/client/oembedVideoWidget.js +++ b/packages/rocketchat-oembed/client/oembedVideoWidget.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; const getTitle = function(self) { if (self.meta == null) { diff --git a/packages/rocketchat-oembed/client/oembedYoutubeWidget.js b/packages/rocketchat-oembed/client/oembedYoutubeWidget.js index 15f019843134..2312f2bf0445 100644 --- a/packages/rocketchat-oembed/client/oembedYoutubeWidget.js +++ b/packages/rocketchat-oembed/client/oembedYoutubeWidget.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; Template.oembedYoutubeWidget.helpers({ collapsed() { diff --git a/packages/rocketchat-otr/client/views/otrFlexTab.js b/packages/rocketchat-otr/client/views/otrFlexTab.js index ed9ab087b82c..8503015e855e 100644 --- a/packages/rocketchat-otr/client/views/otrFlexTab.js +++ b/packages/rocketchat-otr/client/views/otrFlexTab.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; Template.otrFlexTab.helpers({ otrAvailable() { diff --git a/packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.js b/packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.js index 70eba102d9d8..1577b1957466 100644 --- a/packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.js +++ b/packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; const notificationLabels = { all: 'All_messages', diff --git a/packages/rocketchat-reactions/client/init.js b/packages/rocketchat-reactions/client/init.js index 8cd88a5dc980..c5a0b9fffb6a 100644 --- a/packages/rocketchat-reactions/client/init.js +++ b/packages/rocketchat-reactions/client/init.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Blaze } from 'meteor/blaze'; +import { Template } from 'meteor/templating'; Template.room.events({ 'click .add-reaction, click [data-message-action="reaction-message"]'(event) { diff --git a/packages/rocketchat-search/client/provider/result.js b/packages/rocketchat-search/client/provider/result.js index c46112ced79e..bc1074046f5b 100644 --- a/packages/rocketchat-search/client/provider/result.js +++ b/packages/rocketchat-search/client/provider/result.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; Meteor.startup(function() { diff --git a/packages/rocketchat-search/client/search/search.js b/packages/rocketchat-search/client/search/search.js index 03fc3054732a..3238c2c6ccd5 100644 --- a/packages/rocketchat-search/client/search/search.js +++ b/packages/rocketchat-search/client/search/search.js @@ -1,6 +1,7 @@ /* globals ReactiveVar, TAPi18n */ import { Meteor } from 'meteor/meteor'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; import _ from 'underscore'; diff --git a/packages/rocketchat-setup-wizard/client/final.js b/packages/rocketchat-setup-wizard/client/final.js index f05b599abb2b..20c7b7ebc40d 100644 --- a/packages/rocketchat-setup-wizard/client/final.js +++ b/packages/rocketchat-setup-wizard/client/final.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; Template.setupWizardFinal.onCreated(function() { const isSetupWizardDone = localStorage.getItem('wizardFinal'); diff --git a/packages/rocketchat-setup-wizard/client/setupWizard.js b/packages/rocketchat-setup-wizard/client/setupWizard.js index bb9f859a473a..d5ad717ea636 100644 --- a/packages/rocketchat-setup-wizard/client/setupWizard.js +++ b/packages/rocketchat-setup-wizard/client/setupWizard.js @@ -3,6 +3,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { ReactiveDict } from 'meteor/reactive-dict'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; const cannotSetup = () => { const showSetupWizard = RocketChat.settings.get('Show_Setup_Wizard'); diff --git a/packages/rocketchat-slider/rocketchat-slider.js b/packages/rocketchat-slider/rocketchat-slider.js index 49341e759006..098146dac1d5 100644 --- a/packages/rocketchat-slider/rocketchat-slider.js +++ b/packages/rocketchat-slider/rocketchat-slider.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.slider.onRendered(function() { const params = this.data; diff --git a/packages/rocketchat-spotify/lib/client/widget.js b/packages/rocketchat-spotify/lib/client/widget.js index d66f38a31eb1..d5678ed1e96b 100644 --- a/packages/rocketchat-spotify/lib/client/widget.js +++ b/packages/rocketchat-spotify/lib/client/widget.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.registerHelper('replace', function(source, find, replace, option) { if (option.hash.regex === true) { find = new RegExp(find); diff --git a/packages/rocketchat-tokenpass/client/tokenChannelsList.js b/packages/rocketchat-tokenpass/client/tokenChannelsList.js index 9ca7ba12ec70..63e7306c4e22 100644 --- a/packages/rocketchat-tokenpass/client/tokenChannelsList.js +++ b/packages/rocketchat-tokenpass/client/tokenChannelsList.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { Template } from 'meteor/templating'; Template.tokenChannelsList.helpers({ rooms() { diff --git a/packages/rocketchat-tokenpass/client/tokenpassChannelSettings.js b/packages/rocketchat-tokenpass/client/tokenpassChannelSettings.js index 8050e871b77a..082993b45cc9 100644 --- a/packages/rocketchat-tokenpass/client/tokenpassChannelSettings.js +++ b/packages/rocketchat-tokenpass/client/tokenpassChannelSettings.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; Template.channelSettings__tokenpass.helpers({ addDisabled() { diff --git a/packages/rocketchat-tooltip/client/init.js b/packages/rocketchat-tooltip/client/init.js index 96dd52e7835b..7ccc3f3ca1fb 100644 --- a/packages/rocketchat-tooltip/client/init.js +++ b/packages/rocketchat-tooltip/client/init.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.main.onCreated(function() { RocketChat.tooltip.init(); }); diff --git a/packages/rocketchat-tooltip/client/rocketchat-tooltip.js b/packages/rocketchat-tooltip/client/rocketchat-tooltip.js index eea7f3f6689b..69499047aa00 100644 --- a/packages/rocketchat-tooltip/client/rocketchat-tooltip.js +++ b/packages/rocketchat-tooltip/client/rocketchat-tooltip.js @@ -1,4 +1,6 @@ /* globals Blaze, RocketChat */ +import { Template } from 'meteor/templating'; + RocketChat.tooltip = { source: null, initiated: false, diff --git a/packages/rocketchat-ui-account/client/account.js b/packages/rocketchat-ui-account/client/account.js index 561564d499d9..40a0e36da2aa 100644 --- a/packages/rocketchat-ui-account/client/account.js +++ b/packages/rocketchat-ui-account/client/account.js @@ -1,4 +1,5 @@ import { Tracker } from 'meteor/tracker'; +import { Template } from 'meteor/templating'; Template.account.onRendered(function() { Tracker.afterFlush(function() { diff --git a/packages/rocketchat-ui-account/client/accountFlex.js b/packages/rocketchat-ui-account/client/accountFlex.js index 40fca5532992..8d38234ebf28 100644 --- a/packages/rocketchat-ui-account/client/accountFlex.js +++ b/packages/rocketchat-ui-account/client/accountFlex.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.accountFlex.events({ 'click [data-action="close"]'() { SideNav.closeFlex(); diff --git a/packages/rocketchat-ui-account/client/accountIntegrations.js b/packages/rocketchat-ui-account/client/accountIntegrations.js index 1ae306dca61c..115f43c814f2 100644 --- a/packages/rocketchat-ui-account/client/accountIntegrations.js +++ b/packages/rocketchat-ui-account/client/accountIntegrations.js @@ -1,6 +1,7 @@ /* global */ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; Template.accountIntegrations.helpers({ diff --git a/packages/rocketchat-ui-account/client/accountPreferences.js b/packages/rocketchat-ui-account/client/accountPreferences.js index 54fcaf3d5690..e75932e174c7 100644 --- a/packages/rocketchat-ui-account/client/accountPreferences.js +++ b/packages/rocketchat-ui-account/client/accountPreferences.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { Reload } from 'meteor/reload'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-account/client/accountProfile.js b/packages/rocketchat-ui-account/client/accountProfile.js index 619f7b8d83e5..fa70e6cbb4b7 100644 --- a/packages/rocketchat-ui-account/client/accountProfile.js +++ b/packages/rocketchat-ui-account/client/accountProfile.js @@ -3,6 +3,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-account/client/avatar/avatar.js b/packages/rocketchat-ui-account/client/avatar/avatar.js index afd19b944b18..e35c1012dd1e 100644 --- a/packages/rocketchat-ui-account/client/avatar/avatar.js +++ b/packages/rocketchat-ui-account/client/avatar/avatar.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; Template.avatar.helpers({ src() { diff --git a/packages/rocketchat-ui-account/client/avatar/prompt.js b/packages/rocketchat-ui-account/client/avatar/prompt.js index 6c733de88b2a..a3f550635ec4 100644 --- a/packages/rocketchat-ui-account/client/avatar/prompt.js +++ b/packages/rocketchat-ui-account/client/avatar/prompt.js @@ -4,6 +4,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import s from 'underscore.string'; import toastr from 'toastr'; import mime from 'mime-type/with-db'; diff --git a/packages/rocketchat-ui-admin/client/admin.js b/packages/rocketchat-ui-admin/client/admin.js index 5f3ef6a06eed..27ea56feff59 100644 --- a/packages/rocketchat-ui-admin/client/admin.js +++ b/packages/rocketchat-ui-admin/client/admin.js @@ -5,6 +5,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-admin/client/adminFlex.js b/packages/rocketchat-ui-admin/client/adminFlex.js index dc961f734a4c..8a2a2e9f795f 100644 --- a/packages/rocketchat-ui-admin/client/adminFlex.js +++ b/packages/rocketchat-ui-admin/client/adminFlex.js @@ -1,4 +1,5 @@ import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-admin/client/adminInfo.js b/packages/rocketchat-ui-admin/client/adminInfo.js index 578ea470c4b4..b17154612294 100644 --- a/packages/rocketchat-ui-admin/client/adminInfo.js +++ b/packages/rocketchat-ui-admin/client/adminInfo.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { Template } from 'meteor/templating'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js b/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js index 06b60fafabbe..776d2a417944 100644 --- a/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js +++ b/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; Template.adminRoomInfo.helpers({ diff --git a/packages/rocketchat-ui-admin/client/rooms/adminRooms.js b/packages/rocketchat-ui-admin/client/rooms/adminRooms.js index 30b1283f69bf..1bde31301941 100644 --- a/packages/rocketchat-ui-admin/client/rooms/adminRooms.js +++ b/packages/rocketchat-ui-admin/client/rooms/adminRooms.js @@ -4,6 +4,7 @@ import { Tracker } from 'meteor/tracker'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-admin/client/rooms/channelSettingsDefault.js b/packages/rocketchat-ui-admin/client/rooms/channelSettingsDefault.js index 4358bde620e6..19dad7a04db3 100644 --- a/packages/rocketchat-ui-admin/client/rooms/channelSettingsDefault.js +++ b/packages/rocketchat-ui-admin/client/rooms/channelSettingsDefault.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; /* globals AdminChatRoom */ diff --git a/packages/rocketchat-ui-admin/client/users/adminInviteUser.js b/packages/rocketchat-ui-admin/client/users/adminInviteUser.js index f77303e9341a..5462bf83a400 100644 --- a/packages/rocketchat-ui-admin/client/users/adminInviteUser.js +++ b/packages/rocketchat-ui-admin/client/users/adminInviteUser.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-admin/client/users/adminUserChannels.js b/packages/rocketchat-ui-admin/client/users/adminUserChannels.js index 5812b9bc0d6d..ccc6101cd16f 100644 --- a/packages/rocketchat-ui-admin/client/users/adminUserChannels.js +++ b/packages/rocketchat-ui-admin/client/users/adminUserChannels.js @@ -1,4 +1,5 @@ import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; Template.adminUserChannels.helpers({ type() { diff --git a/packages/rocketchat-ui-admin/client/users/adminUsers.js b/packages/rocketchat-ui-admin/client/users/adminUsers.js index 1f189a929587..83a117541c3a 100644 --- a/packages/rocketchat-ui-admin/client/users/adminUsers.js +++ b/packages/rocketchat-ui-admin/client/users/adminUsers.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js b/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js index 1cf508418534..f277e5741d89 100644 --- a/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js +++ b/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js @@ -3,6 +3,7 @@ import { Tracker } from 'meteor/tracker'; import { Blaze } from 'meteor/blaze'; import { ReactiveVar } from 'meteor/reactive-var'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import moment from 'moment'; import { call } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-ui-flextab/client/flexTabBar.js b/packages/rocketchat-ui-flextab/client/flexTabBar.js index daef82fb5a22..75bf308dca4d 100644 --- a/packages/rocketchat-ui-flextab/client/flexTabBar.js +++ b/packages/rocketchat-ui-flextab/client/flexTabBar.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; const commonHelpers = { diff --git a/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js b/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js index c4b2e2acee8b..d9e1b34e6b8e 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js +++ b/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Blaze } from 'meteor/blaze'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; const acEvents = { diff --git a/packages/rocketchat-ui-flextab/client/tabs/membersList.js b/packages/rocketchat-ui-flextab/client/tabs/membersList.js index bb154b0a555e..7566899fc779 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/membersList.js +++ b/packages/rocketchat-ui-flextab/client/tabs/membersList.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import { getActions } from './userActions'; diff --git a/packages/rocketchat-ui-flextab/client/tabs/uploadedFilesList.js b/packages/rocketchat-ui-flextab/client/tabs/uploadedFilesList.js index 7d677fd9f203..197364bac188 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/uploadedFilesList.js +++ b/packages/rocketchat-ui-flextab/client/tabs/uploadedFilesList.js @@ -2,6 +2,7 @@ import { Mongo } from 'meteor/mongo'; import { fixCordova } from 'meteor/rocketchat:lazy-load'; import { ReactiveVar } from 'meteor/reactive-var'; import { DateFormat } from 'meteor/rocketchat:lib'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; const roomFiles = new Mongo.Collection('room_files'); diff --git a/packages/rocketchat-ui-flextab/client/tabs/userEdit.js b/packages/rocketchat-ui-flextab/client/tabs/userEdit.js index ca4b53e15963..422c79587b8c 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/userEdit.js +++ b/packages/rocketchat-ui-flextab/client/tabs/userEdit.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-flextab/client/tabs/userInfo.js b/packages/rocketchat-ui-flextab/client/tabs/userInfo.js index 8ce8ccb82767..302e313c44d9 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/userInfo.js +++ b/packages/rocketchat-ui-flextab/client/tabs/userInfo.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-ui-login/client/login/footer.js b/packages/rocketchat-ui-login/client/login/footer.js index 77ebc79fcbaf..6d93a1e0ab5a 100644 --- a/packages/rocketchat-ui-login/client/login/footer.js +++ b/packages/rocketchat-ui-login/client/login/footer.js @@ -1,4 +1,5 @@ import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; Template.loginFooter.onCreated(function() { this.suggestedLanguage = new ReactiveVar(); diff --git a/packages/rocketchat-ui-login/client/login/form.js b/packages/rocketchat-ui-login/client/login/form.js index 4d2a7bbc0e57..a0a63bf421ea 100644 --- a/packages/rocketchat-ui-login/client/login/form.js +++ b/packages/rocketchat-ui-login/client/login/form.js @@ -4,6 +4,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-login/client/login/header.js b/packages/rocketchat-ui-login/client/login/header.js index a6f6ad226769..3b91ad9116ca 100644 --- a/packages/rocketchat-ui-login/client/login/header.js +++ b/packages/rocketchat-ui-login/client/login/header.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.loginHeader.helpers({ logoUrl() { const asset = RocketChat.settings.get('Assets_logo'); diff --git a/packages/rocketchat-ui-login/client/login/layout.js b/packages/rocketchat-ui-login/client/login/layout.js index ed697b814771..81b047c54694 100644 --- a/packages/rocketchat-ui-login/client/login/layout.js +++ b/packages/rocketchat-ui-login/client/login/layout.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.loginLayout.onRendered(function() { $('#initial-page-loading').remove(); }); diff --git a/packages/rocketchat-ui-login/client/login/services.js b/packages/rocketchat-ui-login/client/login/services.js index 77a60249a6b3..dde41ea3d059 100644 --- a/packages/rocketchat-ui-login/client/login/services.js +++ b/packages/rocketchat-ui-login/client/login/services.js @@ -1,5 +1,6 @@ /* globals CustomOAuth */ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-login/client/reset-password/resetPassword.js b/packages/rocketchat-ui-login/client/reset-password/resetPassword.js index 7a486dacf17e..8c554cb1de9c 100644 --- a/packages/rocketchat-ui-login/client/reset-password/resetPassword.js +++ b/packages/rocketchat-ui-login/client/reset-password/resetPassword.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Accounts } from 'meteor/accounts-base'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; Template.resetPassword.helpers({ diff --git a/packages/rocketchat-ui-login/client/username/layout.js b/packages/rocketchat-ui-login/client/username/layout.js index 288aae5138a0..52c080c85c44 100644 --- a/packages/rocketchat-ui-login/client/username/layout.js +++ b/packages/rocketchat-ui-login/client/username/layout.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.usernameLayout.helpers({ backgroundUrl() { const asset = RocketChat.settings.get('Assets_background'); diff --git a/packages/rocketchat-ui-login/client/username/username.js b/packages/rocketchat-ui-login/client/username/username.js index f7c9c9a31270..f819ad641250 100644 --- a/packages/rocketchat-ui-login/client/username/username.js +++ b/packages/rocketchat-ui-login/client/username/username.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; Template.username.onCreated(function() { diff --git a/packages/rocketchat-ui-master/client/main.js b/packages/rocketchat-ui-master/client/main.js index eb0ca3d69282..05d6c9e33e00 100644 --- a/packages/rocketchat-ui-master/client/main.js +++ b/packages/rocketchat-ui-master/client/main.js @@ -5,6 +5,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import Clipboard from 'clipboard'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-message/client/message.js b/packages/rocketchat-ui-message/client/message.js index 38089f1d6da8..997afd8a5724 100644 --- a/packages/rocketchat-ui-message/client/message.js +++ b/packages/rocketchat-ui-message/client/message.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { Blaze } from 'meteor/blaze'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import moment from 'moment'; import { DateFormat } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-ui-message/client/messageBox.js b/packages/rocketchat-ui-message/client/messageBox.js index 80ccdb662fd9..93a75f387136 100644 --- a/packages/rocketchat-ui-message/client/messageBox.js +++ b/packages/rocketchat-ui-message/client/messageBox.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; import moment from 'moment'; import _ from 'underscore'; diff --git a/packages/rocketchat-ui-message/client/popup/messagePopup.js b/packages/rocketchat-ui-message/client/popup/messagePopup.js index 8d44708cf0f3..f0ea02323d0a 100644 --- a/packages/rocketchat-ui-message/client/popup/messagePopup.js +++ b/packages/rocketchat-ui-message/client/popup/messagePopup.js @@ -5,6 +5,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import { lazyloadtick } from 'meteor/rocketchat:lazy-load'; diff --git a/packages/rocketchat-ui-message/client/popup/messagePopupChannel.js b/packages/rocketchat-ui-message/client/popup/messagePopupChannel.js index 64b5d8ef15c6..13fd69bb2c05 100644 --- a/packages/rocketchat-ui-message/client/popup/messagePopupChannel.js +++ b/packages/rocketchat-ui-message/client/popup/messagePopupChannel.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.messagePopupChannel.helpers({ channelIcon() { return RocketChat.roomTypes.getIcon(this.t); diff --git a/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js b/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js index 01298a2708eb..9a9b8085c1c9 100644 --- a/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js +++ b/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js @@ -3,6 +3,7 @@ import { Mongo } from 'meteor/mongo'; import { Tracker } from 'meteor/tracker'; import { Blaze } from 'meteor/blaze'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; const usersFromRoomMessages = new Mongo.Collection(null); diff --git a/packages/rocketchat-ui-message/client/popup/messagePopupEmoji.js b/packages/rocketchat-ui-message/client/popup/messagePopupEmoji.js index 588945bed93e..5b7f97b11cfe 100644 --- a/packages/rocketchat-ui-message/client/popup/messagePopupEmoji.js +++ b/packages/rocketchat-ui-message/client/popup/messagePopupEmoji.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.messagePopupEmoji.helpers({ value() { const { length } = this.data; diff --git a/packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js b/packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js index d5b82d1e4935..5c4acba9aa7a 100644 --- a/packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js +++ b/packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; const keys = { diff --git a/packages/rocketchat-ui-sidenav/client/chatRoomItem.js b/packages/rocketchat-ui-sidenav/client/chatRoomItem.js index f74ac0951ee9..82c9275ddee2 100644 --- a/packages/rocketchat-ui-sidenav/client/chatRoomItem.js +++ b/packages/rocketchat-ui-sidenav/client/chatRoomItem.js @@ -1,5 +1,6 @@ import { Tracker } from 'meteor/tracker'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; Template.chatRoomItem.helpers({ roomData() { diff --git a/packages/rocketchat-ui-sidenav/client/createCombinedFlex.js b/packages/rocketchat-ui-sidenav/client/createCombinedFlex.js index 384fe5dfc1db..18961020c182 100644 --- a/packages/rocketchat-ui-sidenav/client/createCombinedFlex.js +++ b/packages/rocketchat-ui-sidenav/client/createCombinedFlex.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; Template.createCombinedFlex.helpers({ diff --git a/packages/rocketchat-ui-sidenav/client/listChannelsFlex.js b/packages/rocketchat-ui-sidenav/client/listChannelsFlex.js index 8952e7a8c295..db48950e7152 100644 --- a/packages/rocketchat-ui-sidenav/client/listChannelsFlex.js +++ b/packages/rocketchat-ui-sidenav/client/listChannelsFlex.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-sidenav/client/listCombinedFlex.js b/packages/rocketchat-ui-sidenav/client/listCombinedFlex.js index 8dd2cc5df7dc..e2e0003a19e3 100644 --- a/packages/rocketchat-ui-sidenav/client/listCombinedFlex.js +++ b/packages/rocketchat-ui-sidenav/client/listCombinedFlex.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-sidenav/client/listPrivateGroupsFlex.js b/packages/rocketchat-ui-sidenav/client/listPrivateGroupsFlex.js index f7d707c80ee6..e5052de26abf 100644 --- a/packages/rocketchat-ui-sidenav/client/listPrivateGroupsFlex.js +++ b/packages/rocketchat-ui-sidenav/client/listPrivateGroupsFlex.js @@ -1,6 +1,7 @@ import _ from 'underscore'; import s from 'underscore.string'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; Template.listPrivateGroupsFlex.helpers({ groups() { diff --git a/packages/rocketchat-ui-sidenav/client/roomList.js b/packages/rocketchat-ui-sidenav/client/roomList.js index c25669a019b2..558eff571379 100644 --- a/packages/rocketchat-ui-sidenav/client/roomList.js +++ b/packages/rocketchat-ui-sidenav/client/roomList.js @@ -1,6 +1,7 @@ /* globals RocketChat */ import { Meteor } from 'meteor/meteor'; import { UiTextContext } from 'meteor/rocketchat:lib'; +import { Template } from 'meteor/templating'; Template.roomList.helpers({ rooms() { diff --git a/packages/rocketchat-ui-sidenav/client/sideNav.js b/packages/rocketchat-ui-sidenav/client/sideNav.js index f9a2c72728ba..0474135186ad 100644 --- a/packages/rocketchat-ui-sidenav/client/sideNav.js +++ b/packages/rocketchat-ui-sidenav/client/sideNav.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { lazyloadtick } from 'meteor/rocketchat:lazy-load'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; /* globals menu*/ diff --git a/packages/rocketchat-ui-sidenav/client/sidebarHeader.js b/packages/rocketchat-ui-sidenav/client/sidebarHeader.js index 38635877d10e..d9fdb8d17399 100644 --- a/packages/rocketchat-ui-sidenav/client/sidebarHeader.js +++ b/packages/rocketchat-ui-sidenav/client/sidebarHeader.js @@ -1,6 +1,7 @@ /* globals popover menu */ import { Meteor } from 'meteor/meteor'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; const setStatus = (status) => { AccountBox.setStatus(status); diff --git a/packages/rocketchat-ui-sidenav/client/sidebarItem.js b/packages/rocketchat-ui-sidenav/client/sidebarItem.js index 533a07cd7738..cf649d83dedb 100644 --- a/packages/rocketchat-ui-sidenav/client/sidebarItem.js +++ b/packages/rocketchat-ui-sidenav/client/sidebarItem.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import moment from 'moment'; Template.sidebarItem.helpers({ diff --git a/packages/rocketchat-ui-sidenav/client/sortlist.js b/packages/rocketchat-ui-sidenav/client/sortlist.js index 9b083c6e6e5c..fc381364b3e4 100644 --- a/packages/rocketchat-ui-sidenav/client/sortlist.js +++ b/packages/rocketchat-ui-sidenav/client/sortlist.js @@ -1,5 +1,6 @@ /* globals popover */ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; const checked = function(prop, field) { const userId = Meteor.userId(); diff --git a/packages/rocketchat-ui-sidenav/client/toolbar.js b/packages/rocketchat-ui-sidenav/client/toolbar.js index 93cd45e44b36..cf8cd7aa6858 100644 --- a/packages/rocketchat-ui-sidenav/client/toolbar.js +++ b/packages/rocketchat-ui-sidenav/client/toolbar.js @@ -5,6 +5,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; let isLoading; diff --git a/packages/rocketchat-ui-vrecord/client/VRecDialog.js b/packages/rocketchat-ui-vrecord/client/VRecDialog.js index 8c331d1c817f..776ec0c0389c 100644 --- a/packages/rocketchat-ui-vrecord/client/VRecDialog.js +++ b/packages/rocketchat-ui-vrecord/client/VRecDialog.js @@ -1,4 +1,5 @@ import { Blaze } from 'meteor/blaze'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; export const VRecDialog = new class { diff --git a/packages/rocketchat-ui-vrecord/client/vrecord.js b/packages/rocketchat-ui-vrecord/client/vrecord.js index 7a9bba19b124..c88b3890f7b4 100644 --- a/packages/rocketchat-ui-vrecord/client/vrecord.js +++ b/packages/rocketchat-ui-vrecord/client/vrecord.js @@ -1,5 +1,6 @@ /* globals VideoRecorder, fileUpload */ import { VRecDialog } from './VRecDialog'; +import { Template } from 'meteor/templating'; Template.vrecDialog.helpers({ recordIcon() { diff --git a/packages/rocketchat-ui/client/components/contextualBar.js b/packages/rocketchat-ui/client/components/contextualBar.js index c72c53f9ade9..d8e52e5b4917 100644 --- a/packages/rocketchat-ui/client/components/contextualBar.js +++ b/packages/rocketchat-ui/client/components/contextualBar.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.contextualBar.events({ 'click .js-close'(e, t) { t.tabBar.close(); diff --git a/packages/rocketchat-ui/client/components/header/header.js b/packages/rocketchat-ui/client/components/header/header.js index 934dd740538a..e2a1fd576a36 100644 --- a/packages/rocketchat-ui/client/components/header/header.js +++ b/packages/rocketchat-ui/client/components/header/header.js @@ -1,6 +1,7 @@ /* globals fireGlobalEvent*/ import { Meteor } from 'meteor/meteor'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; const isSubscribed = (_id) => ChatSubscription.find({ rid: _id }).count() > 0; diff --git a/packages/rocketchat-ui/client/components/icon.js b/packages/rocketchat-ui/client/components/icon.js index 96dd7b3f9099..bf942d44cd1e 100644 --- a/packages/rocketchat-ui/client/components/icon.js +++ b/packages/rocketchat-ui/client/components/icon.js @@ -1,5 +1,6 @@ /* globals isFirefox, isChrome */ import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; const baseUrlFix = () => `${ window.location.origin }${ FlowRouter.current().path }`; diff --git a/packages/rocketchat-ui/client/components/popupList.js b/packages/rocketchat-ui/client/components/popupList.js index a7636771fb44..4fa3a349b56b 100644 --- a/packages/rocketchat-ui/client/components/popupList.js +++ b/packages/rocketchat-ui/client/components/popupList.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.popupList.helpers({ config() { return { diff --git a/packages/rocketchat-ui/client/components/selectDropdown.js b/packages/rocketchat-ui/client/components/selectDropdown.js index a8b239ef3826..71937cd6a558 100644 --- a/packages/rocketchat-ui/client/components/selectDropdown.js +++ b/packages/rocketchat-ui/client/components/selectDropdown.js @@ -1,4 +1,5 @@ import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; Template.selectDropdown.events({ 'focus input'(e, i) { diff --git a/packages/rocketchat-ui/client/components/table.js b/packages/rocketchat-ui/client/components/table.js index 89da6164b86d..1e3bd67c0763 100644 --- a/packages/rocketchat-ui/client/components/table.js +++ b/packages/rocketchat-ui/client/components/table.js @@ -1,3 +1,4 @@ +import { Template } from 'meteor/templating'; import _ from 'underscore'; Template.table.onRendered(function() { diff --git a/packages/rocketchat-ui/client/components/tabs.js b/packages/rocketchat-ui/client/components/tabs.js index f9752e569698..ab49fa82d191 100644 --- a/packages/rocketchat-ui/client/components/tabs.js +++ b/packages/rocketchat-ui/client/components/tabs.js @@ -1,4 +1,5 @@ import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; Template.tabs.onCreated(function() { this.activeTab = new ReactiveVar(this.data.tabs.tabs.find((tab) => tab.active).value); diff --git a/packages/rocketchat-ui/client/lib/RoomManager.js b/packages/rocketchat-ui/client/lib/RoomManager.js index a0bb5d850ea0..54e6c9897ad5 100644 --- a/packages/rocketchat-ui/client/lib/RoomManager.js +++ b/packages/rocketchat-ui/client/lib/RoomManager.js @@ -3,6 +3,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { Blaze } from 'meteor/blaze'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import { upsertMessage } from './RoomHistoryManager'; diff --git a/packages/rocketchat-ui/client/lib/codeMirror/codeMirrorComponent.js b/packages/rocketchat-ui/client/lib/codeMirror/codeMirrorComponent.js index 7e5a71d2db33..193a5a8a209a 100644 --- a/packages/rocketchat-ui/client/lib/codeMirror/codeMirrorComponent.js +++ b/packages/rocketchat-ui/client/lib/codeMirror/codeMirrorComponent.js @@ -3,6 +3,7 @@ CodeMirrors = {}; import { Meteor } from 'meteor/meteor'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import 'codemirror/lib/codemirror.css'; import CodeMirror from 'codemirror/lib/codemirror.js'; diff --git a/packages/rocketchat-ui/client/views/404/roomNotFound.js b/packages/rocketchat-ui/client/views/404/roomNotFound.js index f27812da6e74..da7ebe9704ca 100644 --- a/packages/rocketchat-ui/client/views/404/roomNotFound.js +++ b/packages/rocketchat-ui/client/views/404/roomNotFound.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Blaze } from 'meteor/blaze'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; Template.roomNotFound.helpers({ data() { diff --git a/packages/rocketchat-ui/client/views/app/alerts.js b/packages/rocketchat-ui/client/views/app/alerts.js index d62ff6d88317..9558678857fe 100644 --- a/packages/rocketchat-ui/client/views/app/alerts.js +++ b/packages/rocketchat-ui/client/views/app/alerts.js @@ -1,5 +1,6 @@ /* globals alerts */ import { Blaze } from 'meteor/blaze'; +import { Template } from 'meteor/templating'; this.alerts = { renderedAlert: null, diff --git a/packages/rocketchat-ui/client/views/app/burger.js b/packages/rocketchat-ui/client/views/app/burger.js index 46fff3e5be2c..a3c61d480528 100644 --- a/packages/rocketchat-ui/client/views/app/burger.js +++ b/packages/rocketchat-ui/client/views/app/burger.js @@ -1,4 +1,5 @@ import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; Template.burger.helpers({ unread() { diff --git a/packages/rocketchat-ui/client/views/app/createChannel.js b/packages/rocketchat-ui/client/views/app/createChannel.js index 2702c10b8846..4cf0a907e6b4 100644 --- a/packages/rocketchat-ui/client/views/app/createChannel.js +++ b/packages/rocketchat-ui/client/views/app/createChannel.js @@ -3,6 +3,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { Blaze } from 'meteor/blaze'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; const acEvents = { diff --git a/packages/rocketchat-ui/client/views/app/directory.js b/packages/rocketchat-ui/client/views/app/directory.js index fbb1847c34fc..3ac767a92cdd 100644 --- a/packages/rocketchat-ui/client/views/app/directory.js +++ b/packages/rocketchat-ui/client/views/app/directory.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import { timeAgo } from './helpers'; diff --git a/packages/rocketchat-ui/client/views/app/fullModal.js b/packages/rocketchat-ui/client/views/app/fullModal.js index b1bb83b2bc21..21674210c290 100644 --- a/packages/rocketchat-ui/client/views/app/fullModal.js +++ b/packages/rocketchat-ui/client/views/app/fullModal.js @@ -1,6 +1,7 @@ import { Blaze } from 'meteor/blaze'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { BlazeLayout } from 'meteor/kadira:blaze-layout'; +import { Template } from 'meteor/templating'; let oldRoute = ''; const parent = document.querySelector('.main-content'); diff --git a/packages/rocketchat-ui/client/views/app/home.js b/packages/rocketchat-ui/client/views/app/home.js index 8f45898cf590..07f79aa9cce2 100644 --- a/packages/rocketchat-ui/client/views/app/home.js +++ b/packages/rocketchat-ui/client/views/app/home.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.home.helpers({ title() { return RocketChat.settings.get('Layout_Home_Title'); diff --git a/packages/rocketchat-ui/client/views/app/modal.js b/packages/rocketchat-ui/client/views/app/modal.js index e23c2d43dbc3..7f3be4e93977 100644 --- a/packages/rocketchat-ui/client/views/app/modal.js +++ b/packages/rocketchat-ui/client/views/app/modal.js @@ -1,6 +1,7 @@ /* globals modal */ import { Meteor } from 'meteor/meteor'; import { Blaze } from 'meteor/blaze'; +import { Template } from 'meteor/templating'; this.modal = { renderedModal: null, diff --git a/packages/rocketchat-ui/client/views/app/popout.js b/packages/rocketchat-ui/client/views/app/popout.js index 4730be49a93a..7c51e0421947 100644 --- a/packages/rocketchat-ui/client/views/app/popout.js +++ b/packages/rocketchat-ui/client/views/app/popout.js @@ -1,6 +1,7 @@ /* globals popout */ import { Blaze } from 'meteor/blaze'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; this.popout = { context: null, diff --git a/packages/rocketchat-ui/client/views/app/popover.js b/packages/rocketchat-ui/client/views/app/popover.js index 2078e9b8aac5..d2a3cf87de1d 100644 --- a/packages/rocketchat-ui/client/views/app/popover.js +++ b/packages/rocketchat-ui/client/views/app/popover.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { Blaze } from 'meteor/blaze'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import { hide, leave } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-ui/client/views/app/room.js b/packages/rocketchat-ui/client/views/app/room.js index 1b72191bef8e..f18171289bb4 100644 --- a/packages/rocketchat-ui/client/views/app/room.js +++ b/packages/rocketchat-ui/client/views/app/room.js @@ -7,6 +7,7 @@ import { Blaze } from 'meteor/blaze'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { RocketChatTabBar } from 'meteor/rocketchat:lib'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import moment from 'moment'; diff --git a/packages/rocketchat-ui/client/views/app/roomSearch.js b/packages/rocketchat-ui/client/views/app/roomSearch.js index 32b27cadd701..26c451fbf364 100644 --- a/packages/rocketchat-ui/client/views/app/roomSearch.js +++ b/packages/rocketchat-ui/client/views/app/roomSearch.js @@ -1,3 +1,5 @@ +import { Template } from 'meteor/templating'; + Template.roomSearch.helpers({ roomIcon() { if (this.type === 'u') { diff --git a/packages/rocketchat-ui/client/views/app/secretURL.js b/packages/rocketchat-ui/client/views/app/secretURL.js index cec7e0339939..6a9e7cf89421 100644 --- a/packages/rocketchat-ui/client/views/app/secretURL.js +++ b/packages/rocketchat-ui/client/views/app/secretURL.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; Template.secretURL.helpers({ registrationAllowed() { diff --git a/packages/rocketchat-ui/client/views/app/videoCall/videoButtons.js b/packages/rocketchat-ui/client/views/app/videoCall/videoButtons.js index b411757e1f18..f43a0fcad29d 100644 --- a/packages/rocketchat-ui/client/views/app/videoCall/videoButtons.js +++ b/packages/rocketchat-ui/client/views/app/videoCall/videoButtons.js @@ -1,5 +1,6 @@ /* globals WebRTC */ import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; Template.videoButtons.helpers({ videoAvaliable() { diff --git a/packages/rocketchat-ui/client/views/app/videoCall/videoCall.js b/packages/rocketchat-ui/client/views/app/videoCall/videoCall.js index f8ad86ab2dda..3a76a2176b1d 100644 --- a/packages/rocketchat-ui/client/views/app/videoCall/videoCall.js +++ b/packages/rocketchat-ui/client/views/app/videoCall/videoCall.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; Template.videoCall.onCreated(function() { return this.mainVideo = new ReactiveVar('$auto'); diff --git a/packages/rocketchat-ui/client/views/cmsPage.js b/packages/rocketchat-ui/client/views/cmsPage.js index 8dea78360c16..1b6c994372cc 100644 --- a/packages/rocketchat-ui/client/views/cmsPage.js +++ b/packages/rocketchat-ui/client/views/cmsPage.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; Template.cmsPage.onCreated(function() { this.page = new ReactiveVar(''); diff --git a/packages/rocketchat-ui/client/views/fxos.js b/packages/rocketchat-ui/client/views/fxos.js index a6d4476e8e6d..fef0a8167cd2 100644 --- a/packages/rocketchat-ui/client/views/fxos.js +++ b/packages/rocketchat-ui/client/views/fxos.js @@ -1,4 +1,5 @@ import { BlazeLayout } from 'meteor/kadira:blaze-layout'; +import { Template } from 'meteor/templating'; Template.fxOsInstallPrompt.onRendered(function() { diff --git a/packages/rocketchat-ui/client/views/modal.js b/packages/rocketchat-ui/client/views/modal.js index a13b6eeb7622..fecf7b82f473 100644 --- a/packages/rocketchat-ui/client/views/modal.js +++ b/packages/rocketchat-ui/client/views/modal.js @@ -1 +1,3 @@ +import { Template } from 'meteor/templating'; + Template.modal.rendered = function() {}; diff --git a/packages/rocketchat-videobridge/client/views/videoFlexTab.js b/packages/rocketchat-videobridge/client/views/videoFlexTab.js index 8eb620c3d6c9..a4374626d96c 100644 --- a/packages/rocketchat-videobridge/client/views/videoFlexTab.js +++ b/packages/rocketchat-videobridge/client/views/videoFlexTab.js @@ -2,6 +2,7 @@ /* eslint new-cap: [2, {"capIsNewExceptions": ["MD5"]}] */ import { Meteor } from 'meteor/meteor'; import { Session } from 'meteor/session'; +import { Template } from 'meteor/templating'; Template.videoFlexTab.helpers({ openInNewWindow() { diff --git a/packages/rocketchat-videobridge/client/views/videoFlexTabBbb.js b/packages/rocketchat-videobridge/client/views/videoFlexTabBbb.js index fb2bc9819cf6..26de77736168 100644 --- a/packages/rocketchat-videobridge/client/views/videoFlexTabBbb.js +++ b/packages/rocketchat-videobridge/client/views/videoFlexTabBbb.js @@ -1,6 +1,7 @@ /* eslint new-cap: [2, {"capIsNewExceptions": ["MD5"]}] */ /* globals popout */ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; Template.videoFlexTabBbb.helpers({ openInNewWindow() { diff --git a/packages/rocketchat-webdav/client/addWebdavAccount.js b/packages/rocketchat-webdav/client/addWebdavAccount.js index d32572c005f7..c3c5d1e6ca3e 100644 --- a/packages/rocketchat-webdav/client/addWebdavAccount.js +++ b/packages/rocketchat-webdav/client/addWebdavAccount.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-webdav/client/selectWebdavAccount.js b/packages/rocketchat-webdav/client/selectWebdavAccount.js index aa5c51eb65a9..3485c9abdec9 100644 --- a/packages/rocketchat-webdav/client/selectWebdavAccount.js +++ b/packages/rocketchat-webdav/client/selectWebdavAccount.js @@ -1,5 +1,6 @@ /* global */ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; import toastr from 'toastr'; Template.selectWebdavAccount.helpers({ diff --git a/packages/rocketchat-webdav/client/webdavFilePicker.js b/packages/rocketchat-webdav/client/webdavFilePicker.js index 1f207c3cb38f..c9896421b96e 100644 --- a/packages/rocketchat-webdav/client/webdavFilePicker.js +++ b/packages/rocketchat-webdav/client/webdavFilePicker.js @@ -1,5 +1,6 @@ /* global fileUploadHandler, Handlebars */ import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; import _ from 'underscore'; import toastr from 'toastr'; import { Session } from 'meteor/session'; From 39e7721421b6bf68e83f42896c6519d90844389e Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Fri, 26 Oct 2018 13:44:53 -0300 Subject: [PATCH 28/34] Remove global variable TAPi18n --- .eslintrc | 1 - client/lib/handleError.js | 1 + client/startup/emailVerification.js | 1 + client/startup/i18n.js | 2 +- lib/francocatena_fix.js | 2 ++ packages/chatpal-search/client/template/admin.js | 1 + packages/chatpal-search/client/template/result.js | 1 + packages/rocketchat-api/server/v1/misc.js | 1 + packages/rocketchat-api/server/v1/users.js | 1 + packages/rocketchat-apps/client/admin/appLogs.js | 1 + packages/rocketchat-apps/client/admin/appManage.js | 1 + .../rocketchat-channel-settings/client/views/channelSettings.js | 1 + .../server/functions/saveRoomType.js | 1 + packages/rocketchat-custom-sounds/client/admin/soundEdit.js | 1 + packages/rocketchat-emoji-custom/admin/emojiEdit.js | 1 + packages/rocketchat-emoji/client/emojiPicker.js | 1 + packages/rocketchat-file-upload/globalFileRestrictions.js | 1 + packages/rocketchat-file-upload/lib/FileUpload.js | 2 +- packages/rocketchat-google-vision/server/googlevision.js | 1 + packages/rocketchat-importer/client/admin/adminImport.js | 1 + packages/rocketchat-integrations/client/views/integrations.js | 1 + .../client/views/integrationsIncoming.js | 2 +- .../client/views/integrationsOutgoing.js | 2 +- .../client/views/integrationsOutgoingHistory.js | 2 +- packages/rocketchat-lib/client/CustomTranslations.js | 1 + packages/rocketchat-lib/client/MessageAction.js | 2 +- packages/rocketchat-lib/lib/Message.js | 1 + packages/rocketchat-lib/server/functions/cleanRoomHistory.js | 2 ++ packages/rocketchat-lib/server/functions/deleteUser.js | 1 + packages/rocketchat-lib/server/functions/notifications/email.js | 1 + packages/rocketchat-lib/server/functions/notifications/index.js | 1 + packages/rocketchat-lib/server/methods/filterATAllTag.js | 1 + packages/rocketchat-lib/server/methods/filterATHereTag.js | 1 + packages/rocketchat-lib/server/methods/sendMessage.js | 1 + packages/rocketchat-livechat/.app/client/lib/_livechat.js | 1 + packages/rocketchat-livechat/.app/client/lib/commands.js | 1 + packages/rocketchat-livechat/.app/client/lib/tapi18n.js | 1 + .../rocketchat-livechat/.app/client/views/livechatWindow.js | 1 + packages/rocketchat-livechat/.app/client/views/offlineForm.js | 1 + packages/rocketchat-livechat/.app/client/views/register.js | 1 + packages/rocketchat-livechat/client/lib/chartHandler.js | 1 + .../rocketchat-livechat/client/views/app/livechatOfficeHours.js | 1 + packages/rocketchat-livechat/messageTypes.js | 1 + packages/rocketchat-livechat/server/api/v1/offlineMessage.js | 1 + packages/rocketchat-livechat/server/api/v1/room.js | 1 + packages/rocketchat-livechat/server/api/v1/transcript.js | 1 + packages/rocketchat-livechat/server/lib/Livechat.js | 1 + packages/rocketchat-livechat/server/lib/QueueMethods.js | 1 + packages/rocketchat-livechat/server/methods/closeByVisitor.js | 1 + packages/rocketchat-livechat/server/startup.js | 1 + packages/rocketchat-livestream/client/views/liveStreamTab.js | 1 + packages/rocketchat-mail-messages/client/views/mailer.js | 1 + packages/rocketchat-mailer/server/api.js | 1 + packages/rocketchat-mapview/client/mapview.js | 1 + packages/rocketchat-mentions/server/server.js | 1 + packages/rocketchat-message-pin/client/actionButton.js | 1 + packages/rocketchat-message-star/client/actionButton.js | 1 + .../admin/client/views/oauthApp.js | 1 + packages/rocketchat-otr/client/rocketchat.otr.room.js | 1 + packages/rocketchat-reactions/setReaction.js | 1 + packages/rocketchat-setup-wizard/client/setupWizard.js | 1 + .../rocketchat-slackbridge/server/slackbridge_import.server.js | 1 + packages/rocketchat-slashcommands-archiveroom/server/server.js | 1 + packages/rocketchat-slashcommands-create/server/server.js | 1 + packages/rocketchat-slashcommands-help/server.js | 1 + packages/rocketchat-slashcommands-hide/server/hide.js | 1 + packages/rocketchat-slashcommands-invite/server/server.js | 1 + packages/rocketchat-slashcommands-inviteall/server/server.js | 1 + packages/rocketchat-slashcommands-join/server/server.js | 1 + packages/rocketchat-slashcommands-kick/server/server.js | 1 + packages/rocketchat-slashcommands-leave/leave.js | 1 + packages/rocketchat-slashcommands-msg/server.js | 1 + packages/rocketchat-slashcommands-mute/server/mute.js | 1 + packages/rocketchat-slashcommands-mute/server/unmute.js | 1 + .../rocketchat-slashcommands-unarchiveroom/server/server.js | 1 + .../rocketchat-smarsh-connector/server/functions/generateEml.js | 1 + .../rocketchat-tokenpass/client/tokenpassChannelSettings.js | 1 + packages/rocketchat-ui-account/client/accountPreferences.js | 1 + packages/rocketchat-ui-admin/client/admin.js | 1 + packages/rocketchat-ui-admin/client/adminFlex.js | 1 + packages/rocketchat-ui-admin/client/adminInfo.js | 1 + packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js | 1 + packages/rocketchat-ui-admin/client/rooms/adminRooms.js | 1 + .../rocketchat-ui-admin/client/rooms/channelSettingsDefault.js | 1 + packages/rocketchat-ui-flextab/client/flexTabBar.js | 1 + packages/rocketchat-ui-flextab/client/tabs/userActions.js | 1 + packages/rocketchat-ui-flextab/client/tabs/userEdit.js | 1 + packages/rocketchat-ui-flextab/client/tabs/userInfo.js | 1 + packages/rocketchat-ui-login/client/login/footer.js | 1 + packages/rocketchat-ui-message/client/message.js | 1 + packages/rocketchat-ui-message/client/messageBox.js | 1 + .../rocketchat-ui-message/client/popup/messagePopupConfig.js | 1 + packages/rocketchat-ui-sidenav/client/toolbar.js | 1 + packages/rocketchat-ui-vrecord/client/vrecord.js | 1 + packages/rocketchat-ui/client/lib/chatMessages.js | 1 + packages/rocketchat-ui/client/lib/tapi18n.js | 1 + packages/rocketchat-ui/client/views/app/popover.js | 1 + .../server/cronProcessDownloads.js | 1 + packages/rocketchat-version-check/client/client.js | 1 + .../server/functions/checkVersionUpdate.js | 1 + packages/rocketchat-videobridge/client/actionLink.js | 1 + packages/rocketchat-videobridge/lib/messageType.js | 1 + .../rocketchat-videobridge/server/methods/jitsiSetTimeout.js | 1 + packages/rocketchat-webrtc/client/WebRTCClass.js | 1 + server/lib/accounts.js | 1 + server/lib/cordova.js | 1 + 106 files changed, 107 insertions(+), 7 deletions(-) diff --git a/.eslintrc b/.eslintrc index c8a7583d7b80..a0c5cebd23c3 100644 --- a/.eslintrc +++ b/.eslintrc @@ -37,7 +37,6 @@ "Settings" : false, "SideNav" : false, "t" : false, - "TAPi18n" : false, "TAPi18next" : false, "TimeSync" : false, "toastr" : false, diff --git a/client/lib/handleError.js b/client/lib/handleError.js index e4bff4ad3c7e..b7301d7f0c7c 100644 --- a/client/lib/handleError.js +++ b/client/lib/handleError.js @@ -1,3 +1,4 @@ +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/client/startup/emailVerification.js b/client/startup/emailVerification.js index 8dccb0d1bd6c..04cdd75cfbb1 100644 --- a/client/startup/emailVerification.js +++ b/client/startup/emailVerification.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { Session } from 'meteor/session'; +import { TAPi18n } from 'meteor/tap:i18n'; import toastr from 'toastr'; Meteor.startup(function() { diff --git a/client/startup/i18n.js b/client/startup/i18n.js index 19e5ce25e34c..61ca1031914e 100644 --- a/client/startup/i18n.js +++ b/client/startup/i18n.js @@ -1,8 +1,8 @@ /* globals isRtl */ - import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { TAPi18n } from 'meteor/tap:i18n'; import moment from 'moment'; const currentLanguage = new ReactiveVar(); diff --git a/lib/francocatena_fix.js b/lib/francocatena_fix.js index 12125e918539..f8806bf32baa 100644 --- a/lib/francocatena_fix.js +++ b/lib/francocatena_fix.js @@ -1,3 +1,5 @@ +import { TAPi18n } from 'meteor/tap:i18n'; + this.i18n_status_func = function(key, options) { return TAPi18n.__(key, options); }; diff --git a/packages/chatpal-search/client/template/admin.js b/packages/chatpal-search/client/template/admin.js index df7be6bf5ccc..ded6c6176ee2 100644 --- a/packages/chatpal-search/client/template/admin.js +++ b/packages/chatpal-search/client/template/admin.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import toastr from 'toastr'; Template.ChatpalAdmin.onCreated(function() { diff --git a/packages/chatpal-search/client/template/result.js b/packages/chatpal-search/client/template/result.js index bca2de535ec5..9cee9304f589 100644 --- a/packages/chatpal-search/client/template/result.js +++ b/packages/chatpal-search/client/template/result.js @@ -2,6 +2,7 @@ import { DateFormat } from 'meteor/rocketchat:lib'; import { ReactiveVar } from 'meteor/reactive-var'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; Template.ChatpalSearchResultTemplate.onCreated(function() { this.badRequest = new ReactiveVar(false); diff --git a/packages/rocketchat-api/server/v1/misc.js b/packages/rocketchat-api/server/v1/misc.js index 14c4583227e8..bc8601d5dbaa 100644 --- a/packages/rocketchat-api/server/v1/misc.js +++ b/packages/rocketchat-api/server/v1/misc.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { check } from 'meteor/check'; +import { TAPi18n } from 'meteor/tap:i18n'; RocketChat.API.v1.addRoute('info', { authRequired: false }, { get() { diff --git a/packages/rocketchat-api/server/v1/users.js b/packages/rocketchat-api/server/v1/users.js index 88a6dadb2aee..2c587c7079ee 100644 --- a/packages/rocketchat-api/server/v1/users.js +++ b/packages/rocketchat-api/server/v1/users.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Match, check } from 'meteor/check'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import Busboy from 'busboy'; diff --git a/packages/rocketchat-apps/client/admin/appLogs.js b/packages/rocketchat-apps/client/admin/appLogs.js index 4212257aa03d..865bf4dcbfab 100644 --- a/packages/rocketchat-apps/client/admin/appLogs.js +++ b/packages/rocketchat-apps/client/admin/appLogs.js @@ -1,6 +1,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import moment from 'moment'; import hljs from 'highlight.js'; diff --git a/packages/rocketchat-apps/client/admin/appManage.js b/packages/rocketchat-apps/client/admin/appManage.js index f2114356932a..3b5504ce7f27 100644 --- a/packages/rocketchat-apps/client/admin/appManage.js +++ b/packages/rocketchat-apps/client/admin/appManage.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-channel-settings/client/views/channelSettings.js b/packages/rocketchat-channel-settings/client/views/channelSettings.js index 35d6ba612a69..ba6cc3013858 100644 --- a/packages/rocketchat-channel-settings/client/views/channelSettings.js +++ b/packages/rocketchat-channel-settings/client/views/channelSettings.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import toastr from 'toastr'; import moment from 'moment'; import s from 'underscore.string'; diff --git a/packages/rocketchat-channel-settings/server/functions/saveRoomType.js b/packages/rocketchat-channel-settings/server/functions/saveRoomType.js index e407e56655ba..cd46aa28b723 100644 --- a/packages/rocketchat-channel-settings/server/functions/saveRoomType.js +++ b/packages/rocketchat-channel-settings/server/functions/saveRoomType.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; +import { TAPi18n } from 'meteor/tap:i18n'; RocketChat.saveRoomType = function(rid, roomType, user, sendMessage = true) { if (!Match.test(rid, String)) { diff --git a/packages/rocketchat-custom-sounds/client/admin/soundEdit.js b/packages/rocketchat-custom-sounds/client/admin/soundEdit.js index 0936ce7058df..818548631a45 100644 --- a/packages/rocketchat-custom-sounds/client/admin/soundEdit.js +++ b/packages/rocketchat-custom-sounds/client/admin/soundEdit.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import toastr from 'toastr'; import s from 'underscore.string'; diff --git a/packages/rocketchat-emoji-custom/admin/emojiEdit.js b/packages/rocketchat-emoji-custom/admin/emojiEdit.js index db54ad90d871..fd9501347045 100644 --- a/packages/rocketchat-emoji-custom/admin/emojiEdit.js +++ b/packages/rocketchat-emoji-custom/admin/emojiEdit.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import toastr from 'toastr'; import s from 'underscore.string'; diff --git a/packages/rocketchat-emoji/client/emojiPicker.js b/packages/rocketchat-emoji/client/emojiPicker.js index e8e180e8b9a0..0c559cf8e52e 100644 --- a/packages/rocketchat-emoji/client/emojiPicker.js +++ b/packages/rocketchat-emoji/client/emojiPicker.js @@ -1,5 +1,6 @@ /* globals Template, isSetNotNull */ import { ReactiveVar } from 'meteor/reactive-var'; +import { TAPi18n } from 'meteor/tap:i18n'; const emojiCategories = {}; /** diff --git a/packages/rocketchat-file-upload/globalFileRestrictions.js b/packages/rocketchat-file-upload/globalFileRestrictions.js index 8ecbe26e95ea..677202d1dba5 100644 --- a/packages/rocketchat-file-upload/globalFileRestrictions.js +++ b/packages/rocketchat-file-upload/globalFileRestrictions.js @@ -1,5 +1,6 @@ /* globals Slingshot */ import { Meteor } from 'meteor/meteor'; +import { TAPi18n } from 'meteor/tap:i18n'; import filesize from 'filesize'; diff --git a/packages/rocketchat-file-upload/lib/FileUpload.js b/packages/rocketchat-file-upload/lib/FileUpload.js index 5a44f10e3369..86508e369e52 100644 --- a/packages/rocketchat-file-upload/lib/FileUpload.js +++ b/packages/rocketchat-file-upload/lib/FileUpload.js @@ -1,8 +1,8 @@ /* globals FileUpload:true */ /* exported FileUpload */ - import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; +import { TAPi18n } from 'meteor/tap:i18n'; import filesize from 'filesize'; let maxFileSize = 0; diff --git a/packages/rocketchat-google-vision/server/googlevision.js b/packages/rocketchat-google-vision/server/googlevision.js index d2609c89e97d..ae675d924bdf 100644 --- a/packages/rocketchat-google-vision/server/googlevision.js +++ b/packages/rocketchat-google-vision/server/googlevision.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; class GoogleVision { constructor() { diff --git a/packages/rocketchat-importer/client/admin/adminImport.js b/packages/rocketchat-importer/client/admin/adminImport.js index 3ece3a281ef6..7b07f634bfe9 100644 --- a/packages/rocketchat-importer/client/admin/adminImport.js +++ b/packages/rocketchat-importer/client/admin/adminImport.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { Importers } from 'meteor/rocketchat:importer'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; Template.adminImport.helpers({ isAdmin() { diff --git a/packages/rocketchat-integrations/client/views/integrations.js b/packages/rocketchat-integrations/client/views/integrations.js index 4bfc283894dc..c80924e3f866 100644 --- a/packages/rocketchat-integrations/client/views/integrations.js +++ b/packages/rocketchat-integrations/client/views/integrations.js @@ -1,5 +1,6 @@ /* global ChatIntegrations */ import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import moment from 'moment'; Template.integrations.helpers({ diff --git a/packages/rocketchat-integrations/client/views/integrationsIncoming.js b/packages/rocketchat-integrations/client/views/integrationsIncoming.js index adefe458cfda..1fb51a130f85 100644 --- a/packages/rocketchat-integrations/client/views/integrationsIncoming.js +++ b/packages/rocketchat-integrations/client/views/integrationsIncoming.js @@ -1,10 +1,10 @@ /* global ChatIntegrations */ - import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import hljs from 'highlight.js'; import toastr from 'toastr'; diff --git a/packages/rocketchat-integrations/client/views/integrationsOutgoing.js b/packages/rocketchat-integrations/client/views/integrationsOutgoing.js index dad25ba99e29..c5587da3b13e 100644 --- a/packages/rocketchat-integrations/client/views/integrationsOutgoing.js +++ b/packages/rocketchat-integrations/client/views/integrationsOutgoing.js @@ -1,10 +1,10 @@ /* global ChatIntegrations */ - import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import hljs from 'highlight.js'; import toastr from 'toastr'; diff --git a/packages/rocketchat-integrations/client/views/integrationsOutgoingHistory.js b/packages/rocketchat-integrations/client/views/integrationsOutgoingHistory.js index f6a4e50db5a0..2e4086d316de 100644 --- a/packages/rocketchat-integrations/client/views/integrationsOutgoingHistory.js +++ b/packages/rocketchat-integrations/client/views/integrationsOutgoingHistory.js @@ -1,9 +1,9 @@ /* global ChatIntegrations, ChatIntegrationHistory */ - import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import hljs from 'highlight.js'; import moment from 'moment'; diff --git a/packages/rocketchat-lib/client/CustomTranslations.js b/packages/rocketchat-lib/client/CustomTranslations.js index 7c2270dfc6d1..442016fe483c 100644 --- a/packages/rocketchat-lib/client/CustomTranslations.js +++ b/packages/rocketchat-lib/client/CustomTranslations.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Session } from 'meteor/session'; +import { TAPi18n } from 'meteor/tap:i18n'; RocketChat.applyCustomTranslations = function applyCustomTranslations() { let CustomTranslations = RocketChat.settings.get('Custom_Translations'); diff --git a/packages/rocketchat-lib/client/MessageAction.js b/packages/rocketchat-lib/client/MessageAction.js index e2ccb736fe5d..0548b33e7ce5 100644 --- a/packages/rocketchat-lib/client/MessageAction.js +++ b/packages/rocketchat-lib/client/MessageAction.js @@ -1,6 +1,6 @@ /* globals chatMessages cordova */ - import { Meteor } from 'meteor/meteor'; +import { TAPi18n } from 'meteor/tap:i18n'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { Session } from 'meteor/session'; diff --git a/packages/rocketchat-lib/lib/Message.js b/packages/rocketchat-lib/lib/Message.js index 5c5cc5e09f74..dbe0c18470a2 100644 --- a/packages/rocketchat-lib/lib/Message.js +++ b/packages/rocketchat-lib/lib/Message.js @@ -1,3 +1,4 @@ +import { TAPi18n } from 'meteor/tap:i18n'; import s from 'underscore.string'; RocketChat.Message = { diff --git a/packages/rocketchat-lib/server/functions/cleanRoomHistory.js b/packages/rocketchat-lib/server/functions/cleanRoomHistory.js index ac542f14e4ee..b68352325bd1 100644 --- a/packages/rocketchat-lib/server/functions/cleanRoomHistory.js +++ b/packages/rocketchat-lib/server/functions/cleanRoomHistory.js @@ -1,3 +1,5 @@ +import { TAPi18n } from 'meteor/tap:i18n'; + RocketChat.cleanRoomHistory = function({ rid, latest = new Date(), oldest = new Date('0001-01-01T00:00:00Z'), inclusive = true, limit = 0, excludePinned = true, filesOnly = false, fromUsers = [] }) { const gt = inclusive ? '$gte' : '$gt'; const lt = inclusive ? '$lte' : '$lt'; diff --git a/packages/rocketchat-lib/server/functions/deleteUser.js b/packages/rocketchat-lib/server/functions/deleteUser.js index 9382e49a8d22..40f05e4db3d0 100644 --- a/packages/rocketchat-lib/server/functions/deleteUser.js +++ b/packages/rocketchat-lib/server/functions/deleteUser.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { TAPi18n } from 'meteor/tap:i18n'; RocketChat.deleteUser = function(userId) { const user = RocketChat.models.Users.findOneById(userId, { diff --git a/packages/rocketchat-lib/server/functions/notifications/email.js b/packages/rocketchat-lib/server/functions/notifications/email.js index bf68e765f635..e8b486536cb0 100644 --- a/packages/rocketchat-lib/server/functions/notifications/email.js +++ b/packages/rocketchat-lib/server/functions/notifications/email.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { TAPi18n } from 'meteor/tap:i18n'; import s from 'underscore.string'; import * as Mailer from 'meteor/rocketchat:mailer'; diff --git a/packages/rocketchat-lib/server/functions/notifications/index.js b/packages/rocketchat-lib/server/functions/notifications/index.js index d0aa8207a82d..e2316590a351 100644 --- a/packages/rocketchat-lib/server/functions/notifications/index.js +++ b/packages/rocketchat-lib/server/functions/notifications/index.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { TAPi18n } from 'meteor/tap:i18n'; import s from 'underscore.string'; /** diff --git a/packages/rocketchat-lib/server/methods/filterATAllTag.js b/packages/rocketchat-lib/server/methods/filterATAllTag.js index 7a2f596a670b..3db1ee27ac50 100644 --- a/packages/rocketchat-lib/server/methods/filterATAllTag.js +++ b/packages/rocketchat-lib/server/methods/filterATAllTag.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; RocketChat.callbacks.add('beforeSaveMessage', function(message) { diff --git a/packages/rocketchat-lib/server/methods/filterATHereTag.js b/packages/rocketchat-lib/server/methods/filterATHereTag.js index 9ca5680d4c55..90bfec4516aa 100644 --- a/packages/rocketchat-lib/server/methods/filterATHereTag.js +++ b/packages/rocketchat-lib/server/methods/filterATHereTag.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; RocketChat.callbacks.add('beforeSaveMessage', function(message) { diff --git a/packages/rocketchat-lib/server/methods/sendMessage.js b/packages/rocketchat-lib/server/methods/sendMessage.js index b888669b19c3..20d7dd19ffdd 100644 --- a/packages/rocketchat-lib/server/methods/sendMessage.js +++ b/packages/rocketchat-lib/server/methods/sendMessage.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { check } from 'meteor/check'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; import moment from 'moment'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/.app/client/lib/_livechat.js b/packages/rocketchat-livechat/.app/client/lib/_livechat.js index d2eeca5eb322..f9581b3cfaa6 100644 --- a/packages/rocketchat-livechat/.app/client/lib/_livechat.js +++ b/packages/rocketchat-livechat/.app/client/lib/_livechat.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; +import { TAPi18n } from 'meteor/tap:i18n'; import visitor from '../../imports/client/visitor'; this.Livechat = new (class Livechat { diff --git a/packages/rocketchat-livechat/.app/client/lib/commands.js b/packages/rocketchat-livechat/.app/client/lib/commands.js index 71462d0ba35e..76268455eef4 100644 --- a/packages/rocketchat-livechat/.app/client/lib/commands.js +++ b/packages/rocketchat-livechat/.app/client/lib/commands.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { Blaze } from 'meteor/blaze'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import swal from 'sweetalert2'; import visitor from '../../imports/client/visitor'; diff --git a/packages/rocketchat-livechat/.app/client/lib/tapi18n.js b/packages/rocketchat-livechat/.app/client/lib/tapi18n.js index 18216eb23956..57ce066d5b77 100644 --- a/packages/rocketchat-livechat/.app/client/lib/tapi18n.js +++ b/packages/rocketchat-livechat/.app/client/lib/tapi18n.js @@ -1,3 +1,4 @@ +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; this.t = function(key, ...replaces) { diff --git a/packages/rocketchat-livechat/.app/client/views/livechatWindow.js b/packages/rocketchat-livechat/.app/client/views/livechatWindow.js index 29b7ac220e54..72db06685edf 100644 --- a/packages/rocketchat-livechat/.app/client/views/livechatWindow.js +++ b/packages/rocketchat-livechat/.app/client/views/livechatWindow.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import visitor from '../../imports/client/visitor'; function showDepartments() { diff --git a/packages/rocketchat-livechat/.app/client/views/offlineForm.js b/packages/rocketchat-livechat/.app/client/views/offlineForm.js index 0243ecef6d20..436758697a42 100644 --- a/packages/rocketchat-livechat/.app/client/views/offlineForm.js +++ b/packages/rocketchat-livechat/.app/client/views/offlineForm.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-livechat/.app/client/views/register.js b/packages/rocketchat-livechat/.app/client/views/register.js index 6eef0bf169e9..e613f4942ddf 100644 --- a/packages/rocketchat-livechat/.app/client/views/register.js +++ b/packages/rocketchat-livechat/.app/client/views/register.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import visitor from '../../imports/client/visitor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-livechat/client/lib/chartHandler.js b/packages/rocketchat-livechat/client/lib/chartHandler.js index 657f6077f79b..14550f2e48cd 100644 --- a/packages/rocketchat-livechat/client/lib/chartHandler.js +++ b/packages/rocketchat-livechat/client/lib/chartHandler.js @@ -1,4 +1,5 @@ import Chart from 'chart.js/src/chart.js'; +import { TAPi18n } from 'meteor/tap:i18n'; const lineChartConfiguration = ({ legends = false, anim = false, smallTicks = false }) => { const config = { diff --git a/packages/rocketchat-livechat/client/views/app/livechatOfficeHours.js b/packages/rocketchat-livechat/client/views/app/livechatOfficeHours.js index e6d29bc9b7c2..f97272ce9177 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatOfficeHours.js +++ b/packages/rocketchat-livechat/client/views/app/livechatOfficeHours.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import toastr from 'toastr'; /* globals LivechatOfficeHour */ import moment from 'moment'; diff --git a/packages/rocketchat-livechat/messageTypes.js b/packages/rocketchat-livechat/messageTypes.js index 364d0a8ae217..8a71e78c40fa 100644 --- a/packages/rocketchat-livechat/messageTypes.js +++ b/packages/rocketchat-livechat/messageTypes.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { TAPi18n } from 'meteor/tap:i18n'; RocketChat.MessageTypes.registerType({ id: 'livechat_navigation_history', diff --git a/packages/rocketchat-livechat/server/api/v1/offlineMessage.js b/packages/rocketchat-livechat/server/api/v1/offlineMessage.js index 3edd4330e61d..7658beb3d6fa 100644 --- a/packages/rocketchat-livechat/server/api/v1/offlineMessage.js +++ b/packages/rocketchat-livechat/server/api/v1/offlineMessage.js @@ -1,4 +1,5 @@ import { check } from 'meteor/check'; +import { TAPi18n } from 'meteor/tap:i18n'; RocketChat.API.v1.addRoute('livechat/offline.message', { post() { diff --git a/packages/rocketchat-livechat/server/api/v1/room.js b/packages/rocketchat-livechat/server/api/v1/room.js index 81e1000f9070..4dcecb4d6eda 100644 --- a/packages/rocketchat-livechat/server/api/v1/room.js +++ b/packages/rocketchat-livechat/server/api/v1/room.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Match, check } from 'meteor/check'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; import { findGuest, findRoom, getRoom, settings } from '../lib/livechat'; RocketChat.API.v1.addRoute('livechat/room', { diff --git a/packages/rocketchat-livechat/server/api/v1/transcript.js b/packages/rocketchat-livechat/server/api/v1/transcript.js index c8a922c36a4e..43a0f57deb81 100644 --- a/packages/rocketchat-livechat/server/api/v1/transcript.js +++ b/packages/rocketchat-livechat/server/api/v1/transcript.js @@ -1,4 +1,5 @@ import { check } from 'meteor/check'; +import { TAPi18n } from 'meteor/tap:i18n'; RocketChat.API.v1.addRoute('livechat/transcript', { post() { diff --git a/packages/rocketchat-livechat/server/lib/Livechat.js b/packages/rocketchat-livechat/server/lib/Livechat.js index 6af1d6dfd8ee..897f13f1a17d 100644 --- a/packages/rocketchat-livechat/server/lib/Livechat.js +++ b/packages/rocketchat-livechat/server/lib/Livechat.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { Match, check } from 'meteor/check'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-livechat/server/lib/QueueMethods.js b/packages/rocketchat-livechat/server/lib/QueueMethods.js index c13e1f69f933..fc77e8cf57c2 100644 --- a/packages/rocketchat-livechat/server/lib/QueueMethods.js +++ b/packages/rocketchat-livechat/server/lib/QueueMethods.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import { sendNotification } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-livechat/server/methods/closeByVisitor.js b/packages/rocketchat-livechat/server/methods/closeByVisitor.js index 5e631489e79a..8cb324a0cef4 100644 --- a/packages/rocketchat-livechat/server/methods/closeByVisitor.js +++ b/packages/rocketchat-livechat/server/methods/closeByVisitor.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { TAPi18n } from 'meteor/tap:i18n'; import LivechatVisitors from '../models/LivechatVisitors'; Meteor.methods({ diff --git a/packages/rocketchat-livechat/server/startup.js b/packages/rocketchat-livechat/server/startup.js index 5c44e0e25cfa..dcc89dbd2da8 100644 --- a/packages/rocketchat-livechat/server/startup.js +++ b/packages/rocketchat-livechat/server/startup.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { TAPi18n } from 'meteor/tap:i18n'; Meteor.startup(() => { RocketChat.roomTypes.setRoomFind('l', (_id) => RocketChat.models.Rooms.findLivechatById(_id).fetch()); diff --git a/packages/rocketchat-livestream/client/views/liveStreamTab.js b/packages/rocketchat-livestream/client/views/liveStreamTab.js index a8e61533db17..80af0ee2b753 100644 --- a/packages/rocketchat-livestream/client/views/liveStreamTab.js +++ b/packages/rocketchat-livestream/client/views/liveStreamTab.js @@ -4,6 +4,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Blaze } from 'meteor/blaze'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import toastr from 'toastr'; import { auth } from '../oauth.js'; import { RocketChatAnnouncement } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-mail-messages/client/views/mailer.js b/packages/rocketchat-mail-messages/client/views/mailer.js index b6f1829ca54c..8cb7be7d7eb6 100644 --- a/packages/rocketchat-mail-messages/client/views/mailer.js +++ b/packages/rocketchat-mail-messages/client/views/mailer.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import toastr from 'toastr'; Template.mailer.helpers({ diff --git a/packages/rocketchat-mailer/server/api.js b/packages/rocketchat-mailer/server/api.js index 6b8e3bf4b6ca..1f66ee0618c5 100644 --- a/packages/rocketchat-mailer/server/api.js +++ b/packages/rocketchat-mailer/server/api.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Email } from 'meteor/email'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import s from 'underscore.string'; import juice from 'juice'; diff --git a/packages/rocketchat-mapview/client/mapview.js b/packages/rocketchat-mapview/client/mapview.js index a8f9be92d358..9223c6bfd71e 100644 --- a/packages/rocketchat-mapview/client/mapview.js +++ b/packages/rocketchat-mapview/client/mapview.js @@ -1,3 +1,4 @@ +import { TAPi18n } from 'meteor/tap:i18n'; /* * MapView is a named function that will replace geolocation in messages with a Google Static Map * @param {Object} message - The message object diff --git a/packages/rocketchat-mentions/server/server.js b/packages/rocketchat-mentions/server/server.js index 1dba02354ad8..b0ad7d1598d1 100644 --- a/packages/rocketchat-mentions/server/server.js +++ b/packages/rocketchat-mentions/server/server.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import MentionsServer from './Mentions'; diff --git a/packages/rocketchat-message-pin/client/actionButton.js b/packages/rocketchat-message-pin/client/actionButton.js index 42c349cb7a17..dfcbe63fdb46 100644 --- a/packages/rocketchat-message-pin/client/actionButton.js +++ b/packages/rocketchat-message-pin/client/actionButton.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import toastr from 'toastr'; Meteor.startup(function() { diff --git a/packages/rocketchat-message-star/client/actionButton.js b/packages/rocketchat-message-star/client/actionButton.js index cbe428be367d..15da070a7d59 100644 --- a/packages/rocketchat-message-star/client/actionButton.js +++ b/packages/rocketchat-message-star/client/actionButton.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.js b/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.js index 545e78849bc6..3991ad831235 100644 --- a/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.js +++ b/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.js @@ -4,6 +4,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import toastr from 'toastr'; Template.oauthApp.onCreated(function() { diff --git a/packages/rocketchat-otr/client/rocketchat.otr.room.js b/packages/rocketchat-otr/client/rocketchat.otr.room.js index 71dd7a9a02f0..59047f74646f 100644 --- a/packages/rocketchat-otr/client/rocketchat.otr.room.js +++ b/packages/rocketchat-otr/client/rocketchat.otr.room.js @@ -4,6 +4,7 @@ import { Random } from 'meteor/random'; import { EJSON } from 'meteor/ejson'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import toastr from 'toastr'; /* globals crypto */ diff --git a/packages/rocketchat-reactions/setReaction.js b/packages/rocketchat-reactions/setReaction.js index 5c0b0163ce57..4c16d79f7485 100644 --- a/packages/rocketchat-reactions/setReaction.js +++ b/packages/rocketchat-reactions/setReaction.js @@ -1,6 +1,7 @@ /* globals msgStream */ import { Meteor } from 'meteor/meteor'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; const removeUserReaction = (message, reaction, username) => { diff --git a/packages/rocketchat-setup-wizard/client/setupWizard.js b/packages/rocketchat-setup-wizard/client/setupWizard.js index d5ad717ea636..0bac5d0e394a 100644 --- a/packages/rocketchat-setup-wizard/client/setupWizard.js +++ b/packages/rocketchat-setup-wizard/client/setupWizard.js @@ -4,6 +4,7 @@ import { ReactiveDict } from 'meteor/reactive-dict'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; const cannotSetup = () => { const showSetupWizard = RocketChat.settings.get('Show_Setup_Wizard'); diff --git a/packages/rocketchat-slackbridge/server/slackbridge_import.server.js b/packages/rocketchat-slackbridge/server/slackbridge_import.server.js index 29de87498e90..eadd5e2d8ae9 100644 --- a/packages/rocketchat-slackbridge/server/slackbridge_import.server.js +++ b/packages/rocketchat-slackbridge/server/slackbridge_import.server.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; function SlackBridgeImport(command, params, item) { if (command !== 'slackbridge-import' || !Match.test(params, String)) { diff --git a/packages/rocketchat-slashcommands-archiveroom/server/server.js b/packages/rocketchat-slashcommands-archiveroom/server/server.js index ddb74a79b3d4..c87af6906198 100644 --- a/packages/rocketchat-slashcommands-archiveroom/server/server.js +++ b/packages/rocketchat-slashcommands-archiveroom/server/server.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; function Archive(command, params, item) { if (command !== 'archive' || !Match.test(params, String)) { diff --git a/packages/rocketchat-slashcommands-create/server/server.js b/packages/rocketchat-slashcommands-create/server/server.js index 75582a52d0f2..461f941e2eb3 100644 --- a/packages/rocketchat-slashcommands-create/server/server.js +++ b/packages/rocketchat-slashcommands-create/server/server.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; function Create(command, params, item) { function getParams(str) { diff --git a/packages/rocketchat-slashcommands-help/server.js b/packages/rocketchat-slashcommands-help/server.js index 19f054bb7e6c..892594cd124d 100644 --- a/packages/rocketchat-slashcommands-help/server.js +++ b/packages/rocketchat-slashcommands-help/server.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; /* * Help is a named function that will replace /join commands diff --git a/packages/rocketchat-slashcommands-hide/server/hide.js b/packages/rocketchat-slashcommands-hide/server/hide.js index 4a68c9f1de15..f7bfbc4e2638 100644 --- a/packages/rocketchat-slashcommands-hide/server/hide.js +++ b/packages/rocketchat-slashcommands-hide/server/hide.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; /* * Hide is a named function that will replace /hide commands diff --git a/packages/rocketchat-slashcommands-invite/server/server.js b/packages/rocketchat-slashcommands-invite/server/server.js index 28a37d365b3e..1f58b0aff3ed 100644 --- a/packages/rocketchat-slashcommands-invite/server/server.js +++ b/packages/rocketchat-slashcommands-invite/server/server.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; /* * Invite is a named function that will replace /invite commands diff --git a/packages/rocketchat-slashcommands-inviteall/server/server.js b/packages/rocketchat-slashcommands-inviteall/server/server.js index 4cb6531c50a2..fd3a50e40258 100644 --- a/packages/rocketchat-slashcommands-inviteall/server/server.js +++ b/packages/rocketchat-slashcommands-inviteall/server/server.js @@ -5,6 +5,7 @@ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; function inviteAll(type) { return function inviteAll(command, params, item) { diff --git a/packages/rocketchat-slashcommands-join/server/server.js b/packages/rocketchat-slashcommands-join/server/server.js index c3ca93a99528..00b2df450e1a 100644 --- a/packages/rocketchat-slashcommands-join/server/server.js +++ b/packages/rocketchat-slashcommands-join/server/server.js @@ -6,6 +6,7 @@ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; RocketChat.slashCommands.add('join', function Join(command, params, item) { diff --git a/packages/rocketchat-slashcommands-kick/server/server.js b/packages/rocketchat-slashcommands-kick/server/server.js index af95c42b4d6c..ee1e65702007 100644 --- a/packages/rocketchat-slashcommands-kick/server/server.js +++ b/packages/rocketchat-slashcommands-kick/server/server.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; const Kick = function(command, params, { rid }) { if (command !== 'kick' || !Match.test(params, String)) { diff --git a/packages/rocketchat-slashcommands-leave/leave.js b/packages/rocketchat-slashcommands-leave/leave.js index d337c746576d..bf231f304d2e 100644 --- a/packages/rocketchat-slashcommands-leave/leave.js +++ b/packages/rocketchat-slashcommands-leave/leave.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; /* * Leave is a named function that will replace /leave commands diff --git a/packages/rocketchat-slashcommands-msg/server.js b/packages/rocketchat-slashcommands-msg/server.js index be0253d4a3b9..6a276c732d93 100644 --- a/packages/rocketchat-slashcommands-msg/server.js +++ b/packages/rocketchat-slashcommands-msg/server.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; /* * Msg is a named function that will replace /msg commands diff --git a/packages/rocketchat-slashcommands-mute/server/mute.js b/packages/rocketchat-slashcommands-mute/server/mute.js index 8d5d3cde96e2..617ddd22e5aa 100644 --- a/packages/rocketchat-slashcommands-mute/server/mute.js +++ b/packages/rocketchat-slashcommands-mute/server/mute.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; /* * Mute is a named function that will replace /mute commands diff --git a/packages/rocketchat-slashcommands-mute/server/unmute.js b/packages/rocketchat-slashcommands-mute/server/unmute.js index c8952970a565..869b727bca1d 100644 --- a/packages/rocketchat-slashcommands-mute/server/unmute.js +++ b/packages/rocketchat-slashcommands-mute/server/unmute.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; /* * Unmute is a named function that will replace /unmute commands diff --git a/packages/rocketchat-slashcommands-unarchiveroom/server/server.js b/packages/rocketchat-slashcommands-unarchiveroom/server/server.js index d0cccc4b9670..fa2433cb5a54 100644 --- a/packages/rocketchat-slashcommands-unarchiveroom/server/server.js +++ b/packages/rocketchat-slashcommands-unarchiveroom/server/server.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; +import { TAPi18n } from 'meteor/tap:i18n'; function Unarchive(command, params, item) { if (command !== 'unarchive' || !Match.test(params, String)) { diff --git a/packages/rocketchat-smarsh-connector/server/functions/generateEml.js b/packages/rocketchat-smarsh-connector/server/functions/generateEml.js index 2fd90a1f455f..0ad7d46fa73a 100644 --- a/packages/rocketchat-smarsh-connector/server/functions/generateEml.js +++ b/packages/rocketchat-smarsh-connector/server/functions/generateEml.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import moment from 'moment'; import 'moment-timezone'; diff --git a/packages/rocketchat-tokenpass/client/tokenpassChannelSettings.js b/packages/rocketchat-tokenpass/client/tokenpassChannelSettings.js index 082993b45cc9..07696dbbfa46 100644 --- a/packages/rocketchat-tokenpass/client/tokenpassChannelSettings.js +++ b/packages/rocketchat-tokenpass/client/tokenpassChannelSettings.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; Template.channelSettings__tokenpass.helpers({ addDisabled() { diff --git a/packages/rocketchat-ui-account/client/accountPreferences.js b/packages/rocketchat-ui-account/client/accountPreferences.js index e75932e174c7..04f8194b8ad1 100644 --- a/packages/rocketchat-ui-account/client/accountPreferences.js +++ b/packages/rocketchat-ui-account/client/accountPreferences.js @@ -4,6 +4,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { Reload } from 'meteor/reload'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-admin/client/admin.js b/packages/rocketchat-ui-admin/client/admin.js index 27ea56feff59..7c85cd2b0182 100644 --- a/packages/rocketchat-ui-admin/client/admin.js +++ b/packages/rocketchat-ui-admin/client/admin.js @@ -6,6 +6,7 @@ import { Random } from 'meteor/random'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-admin/client/adminFlex.js b/packages/rocketchat-ui-admin/client/adminFlex.js index 8a2a2e9f795f..6b0ccd2ca68e 100644 --- a/packages/rocketchat-ui-admin/client/adminFlex.js +++ b/packages/rocketchat-ui-admin/client/adminFlex.js @@ -1,5 +1,6 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-admin/client/adminInfo.js b/packages/rocketchat-ui-admin/client/adminInfo.js index b17154612294..1a7fbe79d44d 100644 --- a/packages/rocketchat-ui-admin/client/adminInfo.js +++ b/packages/rocketchat-ui-admin/client/adminInfo.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js b/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js index 776d2a417944..3b449fb0000b 100644 --- a/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js +++ b/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import toastr from 'toastr'; Template.adminRoomInfo.helpers({ diff --git a/packages/rocketchat-ui-admin/client/rooms/adminRooms.js b/packages/rocketchat-ui-admin/client/rooms/adminRooms.js index 1bde31301941..431e6e6a733d 100644 --- a/packages/rocketchat-ui-admin/client/rooms/adminRooms.js +++ b/packages/rocketchat-ui-admin/client/rooms/adminRooms.js @@ -5,6 +5,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-admin/client/rooms/channelSettingsDefault.js b/packages/rocketchat-ui-admin/client/rooms/channelSettingsDefault.js index 19dad7a04db3..4b9e57011356 100644 --- a/packages/rocketchat-ui-admin/client/rooms/channelSettingsDefault.js +++ b/packages/rocketchat-ui-admin/client/rooms/channelSettingsDefault.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import toastr from 'toastr'; /* globals AdminChatRoom */ diff --git a/packages/rocketchat-ui-flextab/client/flexTabBar.js b/packages/rocketchat-ui-flextab/client/flexTabBar.js index 75bf308dca4d..c52453b7b545 100644 --- a/packages/rocketchat-ui-flextab/client/flexTabBar.js +++ b/packages/rocketchat-ui-flextab/client/flexTabBar.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; const commonHelpers = { diff --git a/packages/rocketchat-ui-flextab/client/tabs/userActions.js b/packages/rocketchat-ui-flextab/client/tabs/userActions.js index adfa26b11c67..15d10c5bca12 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/userActions.js +++ b/packages/rocketchat-ui-flextab/client/tabs/userActions.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Session } from 'meteor/session'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import toastr from 'toastr'; diff --git a/packages/rocketchat-ui-flextab/client/tabs/userEdit.js b/packages/rocketchat-ui-flextab/client/tabs/userEdit.js index 422c79587b8c..19c159a1b8d5 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/userEdit.js +++ b/packages/rocketchat-ui-flextab/client/tabs/userEdit.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import toastr from 'toastr'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-flextab/client/tabs/userInfo.js b/packages/rocketchat-ui-flextab/client/tabs/userInfo.js index 302e313c44d9..8a422b6ca0b7 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/userInfo.js +++ b/packages/rocketchat-ui-flextab/client/tabs/userInfo.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-ui-login/client/login/footer.js b/packages/rocketchat-ui-login/client/login/footer.js index 6d93a1e0ab5a..3d855ff984ad 100644 --- a/packages/rocketchat-ui-login/client/login/footer.js +++ b/packages/rocketchat-ui-login/client/login/footer.js @@ -1,5 +1,6 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; Template.loginFooter.onCreated(function() { this.suggestedLanguage = new ReactiveVar(); diff --git a/packages/rocketchat-ui-message/client/message.js b/packages/rocketchat-ui-message/client/message.js index 997afd8a5724..4eba55a18c38 100644 --- a/packages/rocketchat-ui-message/client/message.js +++ b/packages/rocketchat-ui-message/client/message.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { Blaze } from 'meteor/blaze'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import moment from 'moment'; import { DateFormat } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-ui-message/client/messageBox.js b/packages/rocketchat-ui-message/client/messageBox.js index 93a75f387136..22ae36fe5d19 100644 --- a/packages/rocketchat-ui-message/client/messageBox.js +++ b/packages/rocketchat-ui-message/client/messageBox.js @@ -4,6 +4,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import toastr from 'toastr'; import moment from 'moment'; import _ from 'underscore'; diff --git a/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js b/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js index 9a9b8085c1c9..7685dd7d3cc1 100644 --- a/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js +++ b/packages/rocketchat-ui-message/client/popup/messagePopupConfig.js @@ -4,6 +4,7 @@ import { Tracker } from 'meteor/tracker'; import { Blaze } from 'meteor/blaze'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; const usersFromRoomMessages = new Mongo.Collection(null); diff --git a/packages/rocketchat-ui-sidenav/client/toolbar.js b/packages/rocketchat-ui-sidenav/client/toolbar.js index cf8cd7aa6858..1f401deb2f3e 100644 --- a/packages/rocketchat-ui-sidenav/client/toolbar.js +++ b/packages/rocketchat-ui-sidenav/client/toolbar.js @@ -6,6 +6,7 @@ import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; let isLoading; diff --git a/packages/rocketchat-ui-vrecord/client/vrecord.js b/packages/rocketchat-ui-vrecord/client/vrecord.js index c88b3890f7b4..241c53684456 100644 --- a/packages/rocketchat-ui-vrecord/client/vrecord.js +++ b/packages/rocketchat-ui-vrecord/client/vrecord.js @@ -1,6 +1,7 @@ /* globals VideoRecorder, fileUpload */ import { VRecDialog } from './VRecDialog'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; Template.vrecDialog.helpers({ recordIcon() { diff --git a/packages/rocketchat-ui/client/lib/chatMessages.js b/packages/rocketchat-ui/client/lib/chatMessages.js index 48a89f1f1108..f3de1008a815 100644 --- a/packages/rocketchat-ui/client/lib/chatMessages.js +++ b/packages/rocketchat-ui/client/lib/chatMessages.js @@ -5,6 +5,7 @@ import { Random } from 'meteor/random'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Session } from 'meteor/session'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import s from 'underscore.string'; import moment from 'moment'; diff --git a/packages/rocketchat-ui/client/lib/tapi18n.js b/packages/rocketchat-ui/client/lib/tapi18n.js index a470bb992627..d9d50065ca7b 100644 --- a/packages/rocketchat-ui/client/lib/tapi18n.js +++ b/packages/rocketchat-ui/client/lib/tapi18n.js @@ -1,4 +1,5 @@ import _ from 'underscore'; +import { TAPi18n } from 'meteor/tap:i18n'; this.t = function(key, ...replaces) { if (_.isObject(replaces[0])) { diff --git a/packages/rocketchat-ui/client/views/app/popover.js b/packages/rocketchat-ui/client/views/app/popover.js index d2a3cf87de1d..4a2c92db2d52 100644 --- a/packages/rocketchat-ui/client/views/app/popover.js +++ b/packages/rocketchat-ui/client/views/app/popover.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { Blaze } from 'meteor/blaze'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import { hide, leave } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-user-data-download/server/cronProcessDownloads.js b/packages/rocketchat-user-data-download/server/cronProcessDownloads.js index 7de2b053477b..8ec042a0f2cd 100644 --- a/packages/rocketchat-user-data-download/server/cronProcessDownloads.js +++ b/packages/rocketchat-user-data-download/server/cronProcessDownloads.js @@ -1,6 +1,7 @@ /* globals SyncedCron */ import { Meteor } from 'meteor/meteor'; +import { TAPi18n } from 'meteor/tap:i18n'; import fs from 'fs'; import path from 'path'; import archiver from 'archiver'; diff --git a/packages/rocketchat-version-check/client/client.js b/packages/rocketchat-version-check/client/client.js index 0a6f8c156ce6..86972d176e50 100644 --- a/packages/rocketchat-version-check/client/client.js +++ b/packages/rocketchat-version-check/client/client.js @@ -1,6 +1,7 @@ /* globals alerts */ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; +import { TAPi18n } from 'meteor/tap:i18n'; Meteor.startup(function() { Tracker.autorun(() => { diff --git a/packages/rocketchat-version-check/server/functions/checkVersionUpdate.js b/packages/rocketchat-version-check/server/functions/checkVersionUpdate.js index 72d1a7fe8f12..cf05b40bfd84 100644 --- a/packages/rocketchat-version-check/server/functions/checkVersionUpdate.js +++ b/packages/rocketchat-version-check/server/functions/checkVersionUpdate.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { TAPi18n } from 'meteor/tap:i18n'; import semver from 'semver'; import getNewUpdates from './getNewUpdates'; import logger from '../logger'; diff --git a/packages/rocketchat-videobridge/client/actionLink.js b/packages/rocketchat-videobridge/client/actionLink.js index 0603aa2e8111..0cfe8e673871 100644 --- a/packages/rocketchat-videobridge/client/actionLink.js +++ b/packages/rocketchat-videobridge/client/actionLink.js @@ -1,4 +1,5 @@ import { Session } from 'meteor/session'; +import { TAPi18n } from 'meteor/tap:i18n'; import toastr from 'toastr'; RocketChat.actionLinks.register('joinJitsiCall', function(message, params, instance) { diff --git a/packages/rocketchat-videobridge/lib/messageType.js b/packages/rocketchat-videobridge/lib/messageType.js index 6ae145e68f1a..0033e5f066ae 100644 --- a/packages/rocketchat-videobridge/lib/messageType.js +++ b/packages/rocketchat-videobridge/lib/messageType.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { TAPi18n } from 'meteor/tap:i18n'; Meteor.startup(function() { RocketChat.MessageTypes.registerType({ diff --git a/packages/rocketchat-videobridge/server/methods/jitsiSetTimeout.js b/packages/rocketchat-videobridge/server/methods/jitsiSetTimeout.js index f581fdca031e..c3fcbaed39a5 100644 --- a/packages/rocketchat-videobridge/server/methods/jitsiSetTimeout.js +++ b/packages/rocketchat-videobridge/server/methods/jitsiSetTimeout.js @@ -1,4 +1,5 @@ import { Meteor } from 'meteor/meteor'; +import { TAPi18n } from 'meteor/tap:i18n'; Meteor.methods({ 'jitsi:updateTimeout': (rid) => { diff --git a/packages/rocketchat-webrtc/client/WebRTCClass.js b/packages/rocketchat-webrtc/client/WebRTCClass.js index 79e296e7b5ed..604d27cd69e7 100644 --- a/packages/rocketchat-webrtc/client/WebRTCClass.js +++ b/packages/rocketchat-webrtc/client/WebRTCClass.js @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router' ; +import { TAPi18n } from 'meteor/tap:i18n'; class WebRTCTransportClass { constructor(webrtcInstance) { diff --git a/server/lib/accounts.js b/server/lib/accounts.js index 7ce9c42c76b3..1530c90c3e0e 100644 --- a/server/lib/accounts.js +++ b/server/lib/accounts.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { Accounts } from 'meteor/accounts-base'; +import { TAPi18n } from 'meteor/tap:i18n'; import _ from 'underscore'; import s from 'underscore.string'; import * as Mailer from 'meteor/rocketchat:mailer'; diff --git a/server/lib/cordova.js b/server/lib/cordova.js index d57738d62f16..b74bb87daab5 100644 --- a/server/lib/cordova.js +++ b/server/lib/cordova.js @@ -1,6 +1,7 @@ /* global Push, SystemLogger */ import { Meteor } from 'meteor/meteor'; import { HTTP } from 'meteor/http'; +import { TAPi18n } from 'meteor/tap:i18n'; Meteor.methods({ // log() { From f1fa949bb922810ea6050d15e9c249140bf2294e Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Fri, 26 Oct 2018 14:48:19 -0300 Subject: [PATCH 29/34] Remove global variable TAPi18next --- .eslintrc | 1 - packages/rocketchat-apps/client/admin/appManage.js | 1 + packages/rocketchat-apps/client/orchestrator.js | 1 + packages/rocketchat-lib/client/CustomTranslations.js | 1 + packages/tap-i18n/lib/tap_i18next/tap_i18next_init.js | 3 +-- server/startup/i18n-validation.js | 1 + 6 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.eslintrc b/.eslintrc index a0c5cebd23c3..5198a4f18be1 100644 --- a/.eslintrc +++ b/.eslintrc @@ -37,7 +37,6 @@ "Settings" : false, "SideNav" : false, "t" : false, - "TAPi18next" : false, "TimeSync" : false, "toastr" : false, "Trigger" : false, diff --git a/packages/rocketchat-apps/client/admin/appManage.js b/packages/rocketchat-apps/client/admin/appManage.js index 3b5504ce7f27..f47ec13b217f 100644 --- a/packages/rocketchat-apps/client/admin/appManage.js +++ b/packages/rocketchat-apps/client/admin/appManage.js @@ -3,6 +3,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; import { TAPi18n } from 'meteor/tap:i18n'; +import { TAPi18next } from 'meteor/tap:i18n'; import _ from 'underscore'; import s from 'underscore.string'; import toastr from 'toastr'; diff --git a/packages/rocketchat-apps/client/orchestrator.js b/packages/rocketchat-apps/client/orchestrator.js index b861fe692813..fb85e8da85a6 100644 --- a/packages/rocketchat-apps/client/orchestrator.js +++ b/packages/rocketchat-apps/client/orchestrator.js @@ -3,6 +3,7 @@ import { AppWebsocketReceiver } from './communication'; import { Utilities } from '../lib/misc/Utilities'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { BlazeLayout } from 'meteor/kadira:blaze-layout'; +import { TAPi18next } from 'meteor/tap:i18n'; class AppClientOrchestrator { constructor() { diff --git a/packages/rocketchat-lib/client/CustomTranslations.js b/packages/rocketchat-lib/client/CustomTranslations.js index 442016fe483c..3d7c0e99b488 100644 --- a/packages/rocketchat-lib/client/CustomTranslations.js +++ b/packages/rocketchat-lib/client/CustomTranslations.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Session } from 'meteor/session'; import { TAPi18n } from 'meteor/tap:i18n'; +import { TAPi18next } from 'meteor/tap:i18n'; RocketChat.applyCustomTranslations = function applyCustomTranslations() { let CustomTranslations = RocketChat.settings.get('Custom_Translations'); diff --git a/packages/tap-i18n/lib/tap_i18next/tap_i18next_init.js b/packages/tap-i18n/lib/tap_i18next/tap_i18next_init.js index 51fa7ffccc53..a3417a2be076 100755 --- a/packages/tap-i18n/lib/tap_i18next/tap_i18next_init.js +++ b/packages/tap-i18n/lib/tap_i18next/tap_i18next_init.js @@ -1,3 +1,2 @@ /* globals globals: 1 */ - -TAPi18next.init({ resStore: {}, fallbackLng: globals.fallback_language, useCookie: false }); +TAPi18next.init({ resStore: {}, fallbackLng: globals.fallback_language, useCookie: false }); // eslint-disable-line diff --git a/server/startup/i18n-validation.js b/server/startup/i18n-validation.js index adfcda4addf1..87fc70142389 100644 --- a/server/startup/i18n-validation.js +++ b/server/startup/i18n-validation.js @@ -1,3 +1,4 @@ +import { TAPi18next } from 'meteor/tap:i18n'; import _ from 'underscore'; import s from 'underscore.string'; From 2d8544aff81d873067c23dee5b6df39901eb9205 Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Tue, 30 Oct 2018 10:08:39 -0300 Subject: [PATCH 30/34] Exposing t function from rocketchat:ui package --- packages/rocketchat-ui/client/lib/tapi18n.js | 2 +- packages/rocketchat-ui/package.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/rocketchat-ui/client/lib/tapi18n.js b/packages/rocketchat-ui/client/lib/tapi18n.js index d9d50065ca7b..4ea4f5aaa5bf 100644 --- a/packages/rocketchat-ui/client/lib/tapi18n.js +++ b/packages/rocketchat-ui/client/lib/tapi18n.js @@ -1,7 +1,7 @@ import _ from 'underscore'; import { TAPi18n } from 'meteor/tap:i18n'; -this.t = function(key, ...replaces) { +t = function(key, ...replaces) { if (_.isObject(replaces[0])) { return TAPi18n.__(key, ...replaces); } else { diff --git a/packages/rocketchat-ui/package.js b/packages/rocketchat-ui/package.js index a2cff069c5d7..c1345a87ea93 100644 --- a/packages/rocketchat-ui/package.js +++ b/packages/rocketchat-ui/package.js @@ -145,4 +145,5 @@ Package.onUse(function(api) { api.addFiles('client/components/contextualBar.js', 'client'); api.export('fileUpload'); + api.export('t'); }); From 011bd154af6b56c2420ab412715d8bfc177c822f Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Tue, 30 Oct 2018 10:09:31 -0300 Subject: [PATCH 31/34] Convert chatpal search to main module structure --- packages/chatpal-search/client/index.js | 8 +++++ packages/chatpal-search/client/route.js | 1 + .../chatpal-search/client/template/admin.js | 1 + .../chatpal-search/client/template/result.js | 1 + packages/chatpal-search/package.js | 30 ++++--------------- .../chatpal-search/server/asset/config.js | 2 +- packages/chatpal-search/server/index.js | 3 ++ .../chatpal-search/server/provider/index.js | 1 + .../server/provider/provider.js | 1 + .../chatpal-search/server/utils/logger.js | 2 ++ 10 files changed, 24 insertions(+), 26 deletions(-) create mode 100644 packages/chatpal-search/client/index.js create mode 100644 packages/chatpal-search/server/index.js diff --git a/packages/chatpal-search/client/index.js b/packages/chatpal-search/client/index.js new file mode 100644 index 000000000000..1b4cd56f4199 --- /dev/null +++ b/packages/chatpal-search/client/index.js @@ -0,0 +1,8 @@ +import './style.css'; +import './template/admin.html'; +import './template/result.html'; +import './template/suggestion.html'; +import './template/admin'; +import './template/result'; +import './template/suggestion'; +import './route'; diff --git a/packages/chatpal-search/client/route.js b/packages/chatpal-search/client/route.js index 202cdb929991..42361a139674 100644 --- a/packages/chatpal-search/client/route.js +++ b/packages/chatpal-search/client/route.js @@ -1,5 +1,6 @@ import { FlowRouter } from 'meteor/kadira:flow-router'; import { BlazeLayout } from 'meteor/kadira:blaze-layout'; +import { t } from 'meteor/rocketchat:ui'; FlowRouter.route('/admin/chatpal', { name: 'chatpal-admin', diff --git a/packages/chatpal-search/client/template/admin.js b/packages/chatpal-search/client/template/admin.js index ded6c6176ee2..d104c08311d3 100644 --- a/packages/chatpal-search/client/template/admin.js +++ b/packages/chatpal-search/client/template/admin.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Template } from 'meteor/templating'; import { TAPi18n } from 'meteor/tap:i18n'; +import { RocketChat } from 'meteor/rocketchat:lib'; import toastr from 'toastr'; Template.ChatpalAdmin.onCreated(function() { diff --git a/packages/chatpal-search/client/template/result.js b/packages/chatpal-search/client/template/result.js index 9cee9304f589..6028c81a6e6b 100644 --- a/packages/chatpal-search/client/template/result.js +++ b/packages/chatpal-search/client/template/result.js @@ -3,6 +3,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; import { TAPi18n } from 'meteor/tap:i18n'; +import { RocketChat } from 'meteor/rocketchat:lib'; Template.ChatpalSearchResultTemplate.onCreated(function() { this.badRequest = new ReactiveVar(false); diff --git a/packages/chatpal-search/package.js b/packages/chatpal-search/package.js index 8dbde5d1dd2d..f55bfeb282d6 100644 --- a/packages/chatpal-search/package.js +++ b/packages/chatpal-search/package.js @@ -9,33 +9,13 @@ Package.onUse(function(api) { api.use([ 'ecmascript', 'templating', - 'rocketchat:lib', - 'rocketchat:logger', - 'rocketchat:search', - 'kadira:flow-router', - 'kadira:blaze-layout', - 'meteorhacks:inject-initial', ]); - api.addFiles('server/asset/chatpal-enter.svg', 'server', { isAsset:true }); - api.addFiles('server/asset/chatpal-logo-icon-darkblue.svg', 'server', { isAsset:true }); - - api.addFiles([ - 'server/provider/provider.js', - 'server/provider/index.js', - 'server/utils/logger.js', - 'server/utils/utils.js', - 'server/asset/config.js', + api.addAssets([ + 'server/asset/chatpal-enter.svg', + 'server/asset/chatpal-logo-icon-darkblue.svg', ], 'server'); - api.addFiles([ - 'client/template/suggestion.html', - 'client/template/suggestion.js', - 'client/template/result.html', - 'client/template/result.js', - 'client/template/admin.html', - 'client/template/admin.js', - 'client/style.css', - 'client/route.js', - ], 'client'); + api.mainModule('client/index.js', 'client'); + api.mainModule('server/index.js', 'server'); }); diff --git a/packages/chatpal-search/server/asset/config.js b/packages/chatpal-search/server/asset/config.js index add37dbca271..266f8d46348e 100644 --- a/packages/chatpal-search/server/asset/config.js +++ b/packages/chatpal-search/server/asset/config.js @@ -1,4 +1,4 @@ -/* globals Inject */ +import { Inject } from 'meteor/meteorhacks:inject-initial'; Inject.rawBody('chatpal-enter', Assets.getText('server/asset/chatpal-enter.svg')); Inject.rawBody('chatpal-logo-icon-darkblue', Assets.getText('server/asset/chatpal-logo-icon-darkblue.svg')); diff --git a/packages/chatpal-search/server/index.js b/packages/chatpal-search/server/index.js new file mode 100644 index 000000000000..2a7f1094d090 --- /dev/null +++ b/packages/chatpal-search/server/index.js @@ -0,0 +1,3 @@ +import './asset/config'; +import './provider/provider'; +import './utils/utils'; diff --git a/packages/chatpal-search/server/provider/index.js b/packages/chatpal-search/server/provider/index.js index 9a393ce05362..fcccc7d96cde 100644 --- a/packages/chatpal-search/server/provider/index.js +++ b/packages/chatpal-search/server/provider/index.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { HTTP } from 'meteor/http'; import ChatpalLogger from '../utils/logger'; import { Random } from 'meteor/random'; +import { RocketChat } from 'meteor/rocketchat:lib'; /** * Enables HTTP functions on Chatpal Backend diff --git a/packages/chatpal-search/server/provider/provider.js b/packages/chatpal-search/server/provider/provider.js index cf400662a7fc..d6175f48c318 100644 --- a/packages/chatpal-search/server/provider/provider.js +++ b/packages/chatpal-search/server/provider/provider.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { searchProviderService, SearchProvider } from 'meteor/rocketchat:search'; import Index from './index'; import ChatpalLogger from '../utils/logger'; +import { RocketChat } from 'meteor/rocketchat:lib'; /** * The chatpal search provider enables chatpal search. An appropriate backedn has to be specified by settings. diff --git a/packages/chatpal-search/server/utils/logger.js b/packages/chatpal-search/server/utils/logger.js index 2e5278a11924..cbae16ba41eb 100644 --- a/packages/chatpal-search/server/utils/logger.js +++ b/packages/chatpal-search/server/utils/logger.js @@ -1,2 +1,4 @@ +import { Logger } from 'meteor/rocketchat:logger'; + const ChatpalLogger = new Logger('Chatpal Logger', {}); export default ChatpalLogger; From b844ba10f6645487090b61e8e12846cede014e25 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Tue, 30 Oct 2018 12:46:12 -0300 Subject: [PATCH 32/34] Fix ESLint --- packages/rocketchat-message-star/client/actionButton.js | 1 - server/methods/loadNextMessages.js | 1 - server/methods/loadSurroundingMessages.js | 1 - server/publications/messages.js | 1 - 4 files changed, 4 deletions(-) diff --git a/packages/rocketchat-message-star/client/actionButton.js b/packages/rocketchat-message-star/client/actionButton.js index a0a4dd915b08..82f69ecd44e5 100644 --- a/packages/rocketchat-message-star/client/actionButton.js +++ b/packages/rocketchat-message-star/client/actionButton.js @@ -1,5 +1,4 @@ import { Meteor } from 'meteor/meteor'; -import _ from 'underscore'; import toastr from 'toastr'; Meteor.startup(function() { diff --git a/server/methods/loadNextMessages.js b/server/methods/loadNextMessages.js index 1f04b82e7c1b..173f7cd9ccd1 100644 --- a/server/methods/loadNextMessages.js +++ b/server/methods/loadNextMessages.js @@ -1,5 +1,4 @@ import { Meteor } from 'meteor/meteor'; -import _ from 'underscore'; Meteor.methods({ loadNextMessages(rid, end, limit = 20) { diff --git a/server/methods/loadSurroundingMessages.js b/server/methods/loadSurroundingMessages.js index c6ed2ef4e8eb..f7f14dcb483f 100644 --- a/server/methods/loadSurroundingMessages.js +++ b/server/methods/loadSurroundingMessages.js @@ -1,5 +1,4 @@ import { Meteor } from 'meteor/meteor'; -import _ from 'underscore'; Meteor.methods({ loadSurroundingMessages(message, limit = 50) { diff --git a/server/publications/messages.js b/server/publications/messages.js index 180f5d997d21..6d3620ed0d23 100644 --- a/server/publications/messages.js +++ b/server/publications/messages.js @@ -1,5 +1,4 @@ import { Meteor } from 'meteor/meteor'; -import _ from 'underscore'; Meteor.publish('messages', function(rid/* , start*/) { if (!this.userId) { From ac5bfe1a8ee1c69bebdde3293891dd88bcac35b3 Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Tue, 30 Oct 2018 14:37:03 -0300 Subject: [PATCH 33/34] Convert meteor-accounts-saml to main module structure --- packages/meteor-accounts-saml/client/index.js | 1 + .../meteor-accounts-saml/{ => client}/saml_client.js | 1 + packages/meteor-accounts-saml/package.js | 12 +++++------- packages/meteor-accounts-saml/server/index.js | 2 ++ .../{ => server}/saml_rocketchat.js | 3 +++ .../meteor-accounts-saml/{ => server}/saml_server.js | 5 +++-- .../meteor-accounts-saml/{ => server}/saml_utils.js | 9 +++++---- 7 files changed, 20 insertions(+), 13 deletions(-) create mode 100644 packages/meteor-accounts-saml/client/index.js rename packages/meteor-accounts-saml/{ => client}/saml_client.js (98%) create mode 100644 packages/meteor-accounts-saml/server/index.js rename packages/meteor-accounts-saml/{ => server}/saml_rocketchat.js (97%) rename packages/meteor-accounts-saml/{ => server}/saml_server.js (98%) rename packages/meteor-accounts-saml/{ => server}/saml_utils.js (99%) diff --git a/packages/meteor-accounts-saml/client/index.js b/packages/meteor-accounts-saml/client/index.js new file mode 100644 index 000000000000..5ca4ae3d5c18 --- /dev/null +++ b/packages/meteor-accounts-saml/client/index.js @@ -0,0 +1 @@ +import './saml_client'; diff --git a/packages/meteor-accounts-saml/saml_client.js b/packages/meteor-accounts-saml/client/saml_client.js similarity index 98% rename from packages/meteor-accounts-saml/saml_client.js rename to packages/meteor-accounts-saml/client/saml_client.js index bc0076e9ac94..a30ad29dca19 100644 --- a/packages/meteor-accounts-saml/saml_client.js +++ b/packages/meteor-accounts-saml/client/saml_client.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { Accounts } from 'meteor/accounts-base'; import { Random } from 'meteor/random'; +import { ServiceConfiguration } from 'meteor/service-configuration'; if (!Accounts.saml) { Accounts.saml = {}; diff --git a/packages/meteor-accounts-saml/package.js b/packages/meteor-accounts-saml/package.js index 919afa37eb62..6771ecdd678d 100644 --- a/packages/meteor-accounts-saml/package.js +++ b/packages/meteor-accounts-saml/package.js @@ -6,12 +6,10 @@ Package.describe({ }); Package.on_use(function(api) { - api.use('rocketchat:lib', 'server'); - api.use('ecmascript'); - api.use(['routepolicy', 'webapp', 'service-configuration'], 'server'); - api.use(['http', 'accounts-base'], ['client', 'server']); + api.use([ + 'ecmascript', + ]); - api.add_files(['saml_server.js', 'saml_utils.js'], 'server'); - api.add_files(['saml_rocketchat.js'], 'server'); - api.add_files('saml_client.js', 'client'); + api.mainModule('client/index.js', 'client'); + api.mainModule('server/index.js', 'server'); }); diff --git a/packages/meteor-accounts-saml/server/index.js b/packages/meteor-accounts-saml/server/index.js new file mode 100644 index 000000000000..b9c087f10847 --- /dev/null +++ b/packages/meteor-accounts-saml/server/index.js @@ -0,0 +1,2 @@ +import './saml_rocketchat'; +import './saml_server'; diff --git a/packages/meteor-accounts-saml/saml_rocketchat.js b/packages/meteor-accounts-saml/server/saml_rocketchat.js similarity index 97% rename from packages/meteor-accounts-saml/saml_rocketchat.js rename to packages/meteor-accounts-saml/server/saml_rocketchat.js index 40d18a5cb0bd..4b08f8f0e5c4 100644 --- a/packages/meteor-accounts-saml/saml_rocketchat.js +++ b/packages/meteor-accounts-saml/server/saml_rocketchat.js @@ -1,5 +1,8 @@ import { Meteor } from 'meteor/meteor'; import { Accounts } from 'meteor/accounts-base'; +import { RocketChat } from 'meteor/rocketchat:lib'; +import { Logger } from 'meteor/rocketchat:logger'; +import { ServiceConfiguration } from 'meteor/service-configuration'; const logger = new Logger('steffo:meteor-accounts-saml', { methods: { diff --git a/packages/meteor-accounts-saml/saml_server.js b/packages/meteor-accounts-saml/server/saml_server.js similarity index 98% rename from packages/meteor-accounts-saml/saml_server.js rename to packages/meteor-accounts-saml/server/saml_server.js index 4bc41a2e5445..4794b9d6254e 100644 --- a/packages/meteor-accounts-saml/saml_server.js +++ b/packages/meteor-accounts-saml/server/saml_server.js @@ -1,9 +1,10 @@ -/* globals RoutePolicy, SAML */ -/* jshint newcap: false */ import { Meteor } from 'meteor/meteor'; import { Accounts } from 'meteor/accounts-base'; import { Random } from 'meteor/random'; import { WebApp } from 'meteor/webapp'; +import { RocketChat } from 'meteor/rocketchat:lib'; +import { RoutePolicy } from 'meteor/routepolicy'; +import { SAML } from './saml_utils'; import _ from 'underscore'; if (!Accounts.saml) { diff --git a/packages/meteor-accounts-saml/saml_utils.js b/packages/meteor-accounts-saml/server/saml_utils.js similarity index 99% rename from packages/meteor-accounts-saml/saml_utils.js rename to packages/meteor-accounts-saml/server/saml_utils.js index 97ea454c7292..fc9ff50d6902 100644 --- a/packages/meteor-accounts-saml/saml_utils.js +++ b/packages/meteor-accounts-saml/server/saml_utils.js @@ -1,5 +1,3 @@ -/* globals SAML:true */ - import { Meteor } from 'meteor/meteor'; import zlib from 'zlib'; import xmlCrypto from 'xml-crypto'; @@ -8,11 +6,10 @@ import xmldom from 'xmldom'; import querystring from 'querystring'; import xmlbuilder from 'xmlbuilder'; import array2string from 'arraybuffer-to-string'; - // var prefixMatch = new RegExp(/(?!xmlns)^.*:/); -SAML = function(options) { +const SAML = function(options) { this.options = this.initialize(options); }; @@ -548,3 +545,7 @@ SAML.prototype.generateServiceProviderMetadata = function(callbackUrl) { newline: '\n', }); }; + +export { + SAML, +}; From d1b39216dae81c608d73ca851194874bef0c3a0c Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Tue, 30 Oct 2018 20:18:30 -0300 Subject: [PATCH 34/34] Convert meteor-autocomplete to main module structure --- .../client/autocomplete-client.js | 7 +++--- packages/meteor-autocomplete/client/index.js | 8 +++++++ .../meteor-autocomplete/client/templates.js | 2 +- packages/meteor-autocomplete/package.js | 24 +++++-------------- packages/meteor-autocomplete/server/index.js | 1 + .../client/views/mailMessagesInstructions.js | 3 ++- .../package.js | 1 + .../client/views/cleanHistory.js | 2 +- .../client/tabs/inviteUsers.js | 3 ++- packages/rocketchat-ui-flextab/package.js | 1 + .../client/views/app/createChannel.js | 3 ++- packages/rocketchat-ui/package.js | 1 + 12 files changed, 30 insertions(+), 26 deletions(-) create mode 100644 packages/meteor-autocomplete/client/index.js create mode 100644 packages/meteor-autocomplete/server/index.js diff --git a/packages/meteor-autocomplete/client/autocomplete-client.js b/packages/meteor-autocomplete/client/autocomplete-client.js index 2476c42db373..e57cbcbd6e00 100755 --- a/packages/meteor-autocomplete/client/autocomplete-client.js +++ b/packages/meteor-autocomplete/client/autocomplete-client.js @@ -1,9 +1,10 @@ -/* globals Deps, getCaretCoordinates*/ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { Blaze } from 'meteor/blaze'; +import { Deps } from 'meteor/deps'; import _ from 'underscore'; import AutoCompleteRecords from './collection'; +import { getCaretCoordinates } from 'meteor/dandv:caret-position'; const isServerSearch = function(rule) { return _.isString(rule.collection); @@ -72,7 +73,7 @@ const getField = function(obj, str) { return obj; }; -this.AutoComplete = class { +export default class AutoComplete { constructor(settings) { this.KEYS = [40, 38, 13, 27, 9]; this.limit = settings.limit || 5; @@ -454,4 +455,4 @@ this.AutoComplete = class { return this.rules[this.matched].template; } -}; +} diff --git a/packages/meteor-autocomplete/client/index.js b/packages/meteor-autocomplete/client/index.js new file mode 100644 index 000000000000..d77150ea4f49 --- /dev/null +++ b/packages/meteor-autocomplete/client/index.js @@ -0,0 +1,8 @@ +import './autocomplete.css'; +import './inputs.html'; +import './templates'; +import AutoComplete from './autocomplete-client'; + +export { + AutoComplete, +}; diff --git a/packages/meteor-autocomplete/client/templates.js b/packages/meteor-autocomplete/client/templates.js index 388bb5726b4f..81782c33ecd2 100755 --- a/packages/meteor-autocomplete/client/templates.js +++ b/packages/meteor-autocomplete/client/templates.js @@ -1,6 +1,6 @@ -/* globals AutoComplete */ import { Blaze } from 'meteor/blaze'; import { Template } from 'meteor/templating'; +import AutoComplete from './autocomplete-client'; import _ from 'underscore'; // Events on template instances, sent to the autocomplete class diff --git a/packages/meteor-autocomplete/package.js b/packages/meteor-autocomplete/package.js index 3143f3f22275..18d5164df4e0 100755 --- a/packages/meteor-autocomplete/package.js +++ b/packages/meteor-autocomplete/package.js @@ -6,23 +6,11 @@ Package.describe({ }); Package.onUse(function(api) { - api.use(['blaze', 'templating', 'jquery'], 'client'); - api.use(['ecmascript']); // both - api.use(['mongo', 'ddp']); - + api.use([ + 'ecmascript', + 'templating', + ]); api.use('dandv:caret-position@2.1.0-3', 'client'); - - // Our files - api.addFiles([ - 'client/autocomplete.css', - 'client/inputs.html', - 'client/autocomplete-client.js', - 'client/templates.js', - ], 'client'); - - api.addFiles([ - 'server/autocomplete-server.js', - ], 'server'); - - api.export('Autocomplete', 'server'); + api.mainModule('client/index.js', 'client'); + api.mainModule('server/index.js', 'server'); }); diff --git a/packages/meteor-autocomplete/server/index.js b/packages/meteor-autocomplete/server/index.js new file mode 100644 index 000000000000..6ababa09bd75 --- /dev/null +++ b/packages/meteor-autocomplete/server/index.js @@ -0,0 +1 @@ +import './autocomplete-server'; diff --git a/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js b/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js index 492a30b28c3d..f83f02603e2f 100644 --- a/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js +++ b/packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.js @@ -1,9 +1,10 @@ -/* global AutoComplete Deps */ +/* global Deps */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Blaze } from 'meteor/blaze'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; +import { AutoComplete } from 'meteor/mizzao:autocomplete'; import toastr from 'toastr'; import resetSelection from '../resetSelection'; diff --git a/packages/rocketchat-channel-settings-mail-messages/package.js b/packages/rocketchat-channel-settings-mail-messages/package.js index ddb5ed278493..3e363bf13460 100644 --- a/packages/rocketchat-channel-settings-mail-messages/package.js +++ b/packages/rocketchat-channel-settings-mail-messages/package.js @@ -13,6 +13,7 @@ Package.onUse(function(api) { 'less', 'rocketchat:lib', 'rocketchat:channel-settings', + 'mizzao:autocomplete', 'mongo', ]); diff --git a/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js b/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js index f277e5741d89..132bec2a7ed2 100644 --- a/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js +++ b/packages/rocketchat-ui-clean-history/client/views/cleanHistory.js @@ -1,9 +1,9 @@ -/* globals AutoComplete */ import { Tracker } from 'meteor/tracker'; import { Blaze } from 'meteor/blaze'; import { ReactiveVar } from 'meteor/reactive-var'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; +import { AutoComplete } from 'meteor/mizzao:autocomplete'; import moment from 'moment'; import { call } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js b/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js index d9e1b34e6b8e..26e60310006e 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js +++ b/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js @@ -3,6 +3,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Blaze } from 'meteor/blaze'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; +import { AutoComplete } from 'meteor/mizzao:autocomplete'; import toastr from 'toastr'; const acEvents = { @@ -121,7 +122,7 @@ Template.inviteUsers.onRendered(function() { users.set(usersArr); }); }); -/* global AutoComplete Deps */ +/* global Deps */ Template.inviteUsers.onCreated(function() { this.selectedUsers = new ReactiveVar([]); const filter = { exceptions :[Meteor.user().username].concat(this.selectedUsers.get().map((u) => u.username)) }; diff --git a/packages/rocketchat-ui-flextab/package.js b/packages/rocketchat-ui-flextab/package.js index 81709bdcff52..7a421084ec5f 100644 --- a/packages/rocketchat-ui-flextab/package.js +++ b/packages/rocketchat-ui-flextab/package.js @@ -16,6 +16,7 @@ Package.onUse(function(api) { 'ecmascript', 'templating', 'rocketchat:lib', + 'mizzao:autocomplete', ]); api.addFiles('client/flexTabBar.html', 'client'); diff --git a/packages/rocketchat-ui/client/views/app/createChannel.js b/packages/rocketchat-ui/client/views/app/createChannel.js index 4cf0a907e6b4..6a67df806389 100644 --- a/packages/rocketchat-ui/client/views/app/createChannel.js +++ b/packages/rocketchat-ui/client/views/app/createChannel.js @@ -4,6 +4,7 @@ import { Tracker } from 'meteor/tracker'; import { Blaze } from 'meteor/blaze'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; +import { AutoComplete } from 'meteor/mizzao:autocomplete'; import _ from 'underscore'; const acEvents = { @@ -266,7 +267,7 @@ Template.createChannel.onRendered(function() { users.set(usersArr); }); }); -/* global AutoComplete */ + Template.createChannel.onCreated(function() { this.selectedUsers = new ReactiveVar([]); diff --git a/packages/rocketchat-ui/package.js b/packages/rocketchat-ui/package.js index c1345a87ea93..c12b151dc0d6 100644 --- a/packages/rocketchat-ui/package.js +++ b/packages/rocketchat-ui/package.js @@ -26,6 +26,7 @@ Package.onUse(function(api) { 'raix:ui-dropped-event', 'rocketchat:lazy-load', 'rocketchat:e2e', + 'mizzao:autocomplete', ]); api.use('kadira:flow-router', 'client');