From 7f359006b63f4205fee4da3acdcca3aaa43429ed Mon Sep 17 00:00:00 2001 From: Marcos Spessatto Defendi Date: Fri, 15 Feb 2019 21:10:17 -0200 Subject: [PATCH] Convert rocketchat-lib to main module structure (#13415) * Remove some dependencies inside rocketchat-lib/client (#13210) * Move function to rc-utils * Change import from to export directly * Removing duplicated dependency and remove old code * Import some variables to remove dependency of RC namespace * Remove some dependencies inside rocketchat-lib/lib (#13212) * Move some functions from lib to rc-ui-utils * Move some functions from lib ro rc-utils * Remove hostname from RC namespace * Import variables to remove dependency of RC namespace * Remove some dependencies inside rocketchat-lib/server/functions (#13214) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Remove some dependencies inside rocketchat-lib/server/lib (#13217) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Remove some dependencies inside rocketchat-lib/server/methods (#13218) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Remove some dependencies inside rocketchat-lib/server/startup, publications... (#13222) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Import variables to remove dependency with RC namespace * Remove duplicated server settings (#13223) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Import variables to remove dependency with RC namespace * Remove duplicated server settings located in rc-lib * Export functions and lib function of rc-lib but keep it inside RC namespace (#13225) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Import variables to remove dependency with RC namespace * Remove duplicated server settings located in rc-lib * Export function and lib function of rc-lib but keep it inside RC namespace * Fix missed exports and re-add some functions to RC namespace * Import variables from functions and lib to remove RC namespace dependency (#13226) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Import variables to remove dependency with RC namespace * Remove duplicated server settings located in rc-lib * Export function and lib function of rc-lib but keep it inside RC namespace * Import variables from functions and lib to remove RC namespace dependency * Remove dependency of RC namespace in rc-sandstorm (#13227) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Import variables to remove dependency with RC namespace * Remove duplicated server settings located in rc-lib * Export function and lib function of rc-lib but keep it inside RC namespace * Import variables from functions and lib to remove RC namespace dependency * Remove dependency of RC namespace in rc-sandstorm * Remove dependency of RC namespace in chatpal-search (#13231) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Import variables to remove dependency with RC namespace * Remove duplicated server settings located in rc-lib * Export function and lib function of rc-lib but keep it inside RC namespace * Import variables from functions and lib to remove RC namespace dependency * Remove dependency of RC namespace in rc-sandstorm * Remove dependency of RC namespace in chatpal-search * Remove dependency of RC namespace in meteor saml (#13233) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Import variables to remove dependency with RC namespace * Remove duplicated server settings located in rc-lib * Export function and lib function of rc-lib but keep it inside RC namespace * Import variables from functions and lib to remove RC namespace dependency * Remove dependency of RC namespace in rc-sandstorm * Remove dependency of RC namespace in chatpal-search * Move CreadentialTokens model to rc-models * Move getUsernameSuggestion function and method from server/ to rc-lib * Remove dependency of RC namespace in meteor saml * Remove dependency of RC namespace in rc-theme (#13234) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Import variables to remove dependency with RC namespace * Remove duplicated server settings located in rc-lib * Export function and lib function of rc-lib but keep it inside RC namespace * Import variables from functions and lib to remove RC namespace dependency * Remove dependency of RC namespace in rc-sandstorm * Remove dependency of RC namespace in chatpal-search * Move CreadentialTokens model to rc-models * Move getUsernameSuggestion function and method from server/ to rc-lib * Remove dependency of RC namespace in meteor saml * Remove dependency of RC namespace in rc-theme * Remove dependency of RC namespace in rc-2fa (#13235) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Import variables to remove dependency with RC namespace * Remove duplicated server settings located in rc-lib * Export function and lib function of rc-lib but keep it inside RC namespace * Import variables from functions and lib to remove RC namespace dependency * Remove dependency of RC namespace in rc-sandstorm * Remove dependency of RC namespace in chatpal-search * Move CreadentialTokens model to rc-models * Move getUsernameSuggestion function and method from server/ to rc-lib * Remove dependency of RC namespace in meteor saml * Remove dependency of RC namespace in rc-theme * Move 2FA Users model to rc-models * Remove dependency of RC namespace in rc-2fa * Remove dependency of RC namespace in rc-action-links (#13236) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Import variables to remove dependency with RC namespace * Remove duplicated server settings located in rc-lib * Export function and lib function of rc-lib but keep it inside RC namespace * Import variables from functions and lib to remove RC namespace dependency * Remove dependency of RC namespace in rc-sandstorm * Remove dependency of RC namespace in chatpal-search * Move CreadentialTokens model to rc-models * Move getUsernameSuggestion function and method from server/ to rc-lib * Remove dependency of RC namespace in meteor saml * Remove dependency of RC namespace in rc-theme * Move 2FA Users model to rc-models * Remove dependency of RC namespace in rc-2fa * Remove dependency of RC namespace in rc-action-links * Add action links in the RC namespace * Remove dependency of RC namespace in rc-analytics and rc-assets (#13237) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Import variables to remove dependency with RC namespace * Remove duplicated server settings located in rc-lib * Export function and lib function of rc-lib but keep it inside RC namespace * Import variables from functions and lib to remove RC namespace dependency * Remove dependency of RC namespace in rc-sandstorm * Remove dependency of RC namespace in chatpal-search * Move CreadentialTokens model to rc-models * Move getUsernameSuggestion function and method from server/ to rc-lib * Remove dependency of RC namespace in meteor saml * Remove dependency of RC namespace in rc-theme * Move 2FA Users model to rc-models * Remove dependency of RC namespace in rc-2fa * Remove dependency of RC namespace in rc-action-links * Add action links in the RC namespace * Remove dependency of RC namespace in rc-analytics * Remove dependency of RC namespace in rc-assets * Add Assets in RC namespace * Rename Assets variable to avoid conflicts * Fix rename Assets * Remove dependency of RC namespace in rc-markdown, rc-autolinker and rc-autotranslate (#13240) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Import variables to remove dependency with RC namespace * Remove duplicated server settings located in rc-lib * Export function and lib function of rc-lib but keep it inside RC namespace * Import variables from functions and lib to remove RC namespace dependency * Remove dependency of RC namespace in rc-sandstorm * Remove dependency of RC namespace in chatpal-search * Move CreadentialTokens model to rc-models * Move getUsernameSuggestion function and method from server/ to rc-lib * Remove dependency of RC namespace in meteor saml * Remove dependency of RC namespace in rc-theme * Move 2FA Users model to rc-models * Remove dependency of RC namespace in rc-2fa * Remove dependency of RC namespace in rc-action-links * Add action links in the RC namespace * Remove dependency of RC namespace in rc-analytics * Remove dependency of RC namespace in rc-assets * Add Assets in RC namespace * Remove dependency of RC namespace in rc-autolinker * Move autotranslate models to rc-models * Partial remove dependency of Rc namespace in rc-autotranslate * Remove dependency of RC namespace in rc-markdown * Finish of remotion of RC namespace in rc-autotranslate * Import Autotranslate where it has been used * Fix lint * Rename Assets variable to avoid conflicts * Fix rename Assets * Fix wrong imports * Remove dependency of RC namespace in rc-blockstack, bot-helpers and cas (#13246) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Import variables to remove dependency with RC namespace * Remove duplicated server settings located in rc-lib * Export function and lib function of rc-lib but keep it inside RC namespace * Import variables from functions and lib to remove RC namespace dependency * Remove dependency of RC namespace in rc-sandstorm * Remove dependency of RC namespace in chatpal-search * Move CreadentialTokens model to rc-models * Move getUsernameSuggestion function and method from server/ to rc-lib * Remove dependency of RC namespace in meteor saml * Remove dependency of RC namespace in rc-theme * Move 2FA Users model to rc-models * Remove dependency of RC namespace in rc-2fa * Remove dependency of RC namespace in rc-action-links * Add action links in the RC namespace * Remove dependency of RC namespace in rc-analytics * Remove dependency of RC namespace in rc-assets * Add Assets in RC namespace * Remove dependency of RC namespace in rc-autolinker * Move autotranslate models to rc-models * Partial remove dependency of Rc namespace in rc-autotranslate * Remove dependency of RC namespace in rc-markdown * Finish of remotion of RC namespace in rc-autotranslate * Import Autotranslate where it has been used * Fix lint * Rename Assets variable to avoid conflicts * Fix rename Assets * Remove dependency of RC namespace in rc-blockstack * Remove RC dependency in bot-helpers * Remove RC dependency in rc-cas * Fix wrong imports * Remove dependency of RC namespace in rc-channel-settings (#13251) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Import variables to remove dependency with RC namespace * Remove duplicated server settings located in rc-lib * Export function and lib function of rc-lib but keep it inside RC namespace * Import variables from functions and lib to remove RC namespace dependency * Remove dependency of RC namespace in rc-sandstorm * Remove dependency of RC namespace in chatpal-search * Move CreadentialTokens model to rc-models * Move getUsernameSuggestion function and method from server/ to rc-lib * Remove dependency of RC namespace in meteor saml * Remove dependency of RC namespace in rc-theme * Move 2FA Users model to rc-models * Remove dependency of RC namespace in rc-2fa * Remove dependency of RC namespace in rc-action-links * Add action links in the RC namespace * Remove dependency of RC namespace in rc-analytics * Remove dependency of RC namespace in rc-assets * Add Assets in RC namespace * Remove dependency of RC namespace in rc-autolinker * Move autotranslate models to rc-models * Partial remove dependency of Rc namespace in rc-autotranslate * Remove dependency of RC namespace in rc-markdown * Finish of remotion of RC namespace in rc-autotranslate * Import Autotranslate where it has been used * Fix lint * Rename Assets variable to avoid conflicts * Fix rename Assets * Remove dependency of RC namespace in rc-blockstack * Remove RC dependency in bot-helpers * Remove RC dependency in rc-cas * Move some functions from tokenpass to channel settings and models * Move some function from livestream to channel settings * Remove dependency of RC namespace in rc-channel-settings * Fix wrong imports * readd saveRoomName to RC namespace * Remove dependency of RC namespace in rc-channel-mail-messages and cloud (#13254) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Import variables to remove dependency with RC namespace * Remove duplicated server settings located in rc-lib * Export function and lib function of rc-lib but keep it inside RC namespace * Import variables from functions and lib to remove RC namespace dependency * Remove dependency of RC namespace in rc-sandstorm * Remove dependency of RC namespace in chatpal-search * Move CreadentialTokens model to rc-models * Move getUsernameSuggestion function and method from server/ to rc-lib * Remove dependency of RC namespace in meteor saml * Remove dependency of RC namespace in rc-theme * Move 2FA Users model to rc-models * Remove dependency of RC namespace in rc-2fa * Remove dependency of RC namespace in rc-action-links * Add action links in the RC namespace * Remove dependency of RC namespace in rc-analytics * Remove dependency of RC namespace in rc-assets * Add Assets in RC namespace * Remove dependency of RC namespace in rc-autolinker * Move autotranslate models to rc-models * Partial remove dependency of Rc namespace in rc-autotranslate * Remove dependency of RC namespace in rc-markdown * Finish of remotion of RC namespace in rc-autotranslate * Import Autotranslate where it has been used * Fix lint * Rename Assets variable to avoid conflicts * Fix rename Assets * Remove dependency of RC namespace in rc-blockstack * Remove RC dependency in bot-helpers * Remove RC dependency in rc-cas * Move some functions from tokenpass to channel settings and models * Move some function from livestream to channel settings * Remove dependency of RC namespace in rc-channel-settings * Fix wrong imports * Remove dependency of RC namespace in rc-channel-mail-messages * Remove dependency of RC namespace in rc-cloud * Remove dependency of RC namespace in rc-colors, cors, crowd and dolphin (#13255) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Import variables to remove dependency with RC namespace * Remove duplicated server settings located in rc-lib * Export function and lib function of rc-lib but keep it inside RC namespace * Import variables from functions and lib to remove RC namespace dependency * Remove dependency of RC namespace in rc-sandstorm * Remove dependency of RC namespace in chatpal-search * Move CreadentialTokens model to rc-models * Move getUsernameSuggestion function and method from server/ to rc-lib * Remove dependency of RC namespace in meteor saml * Remove dependency of RC namespace in rc-theme * Move 2FA Users model to rc-models * Remove dependency of RC namespace in rc-2fa * Remove dependency of RC namespace in rc-action-links * Add action links in the RC namespace * Remove dependency of RC namespace in rc-analytics * Remove dependency of RC namespace in rc-assets * Add Assets in RC namespace * Remove dependency of RC namespace in rc-autolinker * Move autotranslate models to rc-models * Partial remove dependency of Rc namespace in rc-autotranslate * Remove dependency of RC namespace in rc-markdown * Finish of remotion of RC namespace in rc-autotranslate * Import Autotranslate where it has been used * Fix lint * Rename Assets variable to avoid conflicts * Fix rename Assets * Remove dependency of RC namespace in rc-blockstack * Remove RC dependency in bot-helpers * Remove RC dependency in rc-cas * Move some functions from tokenpass to channel settings and models * Move some function from livestream to channel settings * Remove dependency of RC namespace in rc-channel-settings * Fix wrong imports * Remove dependency of RC namespace in rc-channel-mail-messages * Remove dependency of RC namespace in rc-cloud * Remove dependency of RC namespace in rc-colors * Remove dependency of RC namespace in rc-cors * Remove dependency of RC namespace in rc-crowd * Remove dependency of RC namespace in rc-dolphin * Remove dependency of RC namespace in rc-emoji-custom and drupal (#13256) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Import variables to remove dependency with RC namespace * Remove duplicated server settings located in rc-lib * Export function and lib function of rc-lib but keep it inside RC namespace * Import variables from functions and lib to remove RC namespace dependency * Remove dependency of RC namespace in rc-sandstorm * Remove dependency of RC namespace in chatpal-search * Move CreadentialTokens model to rc-models * Move getUsernameSuggestion function and method from server/ to rc-lib * Remove dependency of RC namespace in meteor saml * Remove dependency of RC namespace in rc-theme * Move 2FA Users model to rc-models * Remove dependency of RC namespace in rc-2fa * Remove dependency of RC namespace in rc-action-links * Add action links in the RC namespace * Remove dependency of RC namespace in rc-analytics * Remove dependency of RC namespace in rc-assets * Add Assets in RC namespace * Remove dependency of RC namespace in rc-autolinker * Move autotranslate models to rc-models * Partial remove dependency of Rc namespace in rc-autotranslate * Remove dependency of RC namespace in rc-markdown * Finish of remotion of RC namespace in rc-autotranslate * Import Autotranslate where it has been used * Fix lint * Rename Assets variable to avoid conflicts * Fix rename Assets * Remove dependency of RC namespace in rc-blockstack * Remove RC dependency in bot-helpers * Remove RC dependency in rc-cas * Move some functions from tokenpass to channel settings and models * Move some function from livestream to channel settings * Remove dependency of RC namespace in rc-channel-settings * Fix wrong imports * Remove dependency of RC namespace in rc-channel-mail-messages * Remove dependency of RC namespace in rc-cloud * Remove dependency of RC namespace in rc-colors * Remove dependency of RC namespace in rc-cors * Remove dependency of RC namespace in rc-crowd * Remove dependency of RC namespace in rc-dolphin * Remove dependency of RC namespace in rc-drupal * Move Emoji custom server and client models to rc-models * Remove dependency of RC namespace in rc-emoji-custom * Remove dependency of RC namespace in rc-emojione, error-handler, gh-enterprise and gitlab (#13257) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Import variables to remove dependency with RC namespace * Remove duplicated server settings located in rc-lib * Export function and lib function of rc-lib but keep it inside RC namespace * Import variables from functions and lib to remove RC namespace dependency * Remove dependency of RC namespace in rc-sandstorm * Remove dependency of RC namespace in chatpal-search * Move CreadentialTokens model to rc-models * Move getUsernameSuggestion function and method from server/ to rc-lib * Remove dependency of RC namespace in meteor saml * Remove dependency of RC namespace in rc-theme * Move 2FA Users model to rc-models * Remove dependency of RC namespace in rc-2fa * Remove dependency of RC namespace in rc-action-links * Add action links in the RC namespace * Remove dependency of RC namespace in rc-analytics * Remove dependency of RC namespace in rc-assets * Add Assets in RC namespace * Remove dependency of RC namespace in rc-autolinker * Move autotranslate models to rc-models * Partial remove dependency of Rc namespace in rc-autotranslate * Remove dependency of RC namespace in rc-markdown * Finish of remotion of RC namespace in rc-autotranslate * Import Autotranslate where it has been used * Fix lint * Rename Assets variable to avoid conflicts * Fix rename Assets * Remove dependency of RC namespace in rc-blockstack * Remove RC dependency in bot-helpers * Remove RC dependency in rc-cas * Move some functions from tokenpass to channel settings and models * Move some function from livestream to channel settings * Remove dependency of RC namespace in rc-channel-settings * Fix wrong imports * Remove dependency of RC namespace in rc-channel-mail-messages * Remove dependency of RC namespace in rc-cloud * Remove dependency of RC namespace in rc-colors * Remove dependency of RC namespace in rc-cors * Remove dependency of RC namespace in rc-crowd * Remove dependency of RC namespace in rc-dolphin * Remove dependency of RC namespace in rc-drupal * Move Emoji custom server and client models to rc-models * Remove dependency of RC namespace in rc-emoji-custom * Remove dependency of RC namespace in rc-emojione * Remove dependency of RC namespace in rc-error-handler * Remove dependency of RC namespace in rc-gh-enterprise * Remove dependency of RC namespace in rc-gitlab * Remove dependency of RC namespace in rc-google-natural-language, grant, google-vision and highlight-words (#13258) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Import variables to remove dependency with RC namespace * Remove duplicated server settings located in rc-lib * Export function and lib function of rc-lib but keep it inside RC namespace * Import variables from functions and lib to remove RC namespace dependency * Remove dependency of RC namespace in rc-sandstorm * Remove dependency of RC namespace in chatpal-search * Move CreadentialTokens model to rc-models * Move getUsernameSuggestion function and method from server/ to rc-lib * Remove dependency of RC namespace in meteor saml * Remove dependency of RC namespace in rc-theme * Move 2FA Users model to rc-models * Remove dependency of RC namespace in rc-2fa * Remove dependency of RC namespace in rc-action-links * Add action links in the RC namespace * Remove dependency of RC namespace in rc-analytics * Remove dependency of RC namespace in rc-assets * Add Assets in RC namespace * Remove dependency of RC namespace in rc-autolinker * Move autotranslate models to rc-models * Partial remove dependency of Rc namespace in rc-autotranslate * Remove dependency of RC namespace in rc-markdown * Finish of remotion of RC namespace in rc-autotranslate * Import Autotranslate where it has been used * Fix lint * Rename Assets variable to avoid conflicts * Fix rename Assets * Remove dependency of RC namespace in rc-blockstack * Remove RC dependency in bot-helpers * Remove RC dependency in rc-cas * Move some functions from tokenpass to channel settings and models * Move some function from livestream to channel settings * Remove dependency of RC namespace in rc-channel-settings * Fix wrong imports * Remove dependency of RC namespace in rc-channel-mail-messages * Remove dependency of RC namespace in rc-cloud * Remove dependency of RC namespace in rc-colors * Remove dependency of RC namespace in rc-cors * Remove dependency of RC namespace in rc-crowd * Remove dependency of RC namespace in rc-dolphin * Remove dependency of RC namespace in rc-drupal * Move Emoji custom server and client models to rc-models * Remove dependency of RC namespace in rc-emoji-custom * Remove dependency of RC namespace in rc-emojione * Remove dependency of RC namespace in rc-error-handler * Remove dependency of RC namespace in rc-gh-enterprise * Remove dependency of RC namespace in rc-gitlab * Remove dependency of RC namespace in rc-google-natural-language * Remove dependency of RC namespace in rc-grant * Remove dependency of RC namespace in rc-highlight-words * Remove dependency of RC namespace in rc-google-vision * Fix lint * Remove dependency of RC namespace in rc-iframe-login and all imports, except hipchat-enterprise (#13259) * Move integrations models to rc-models * Move composeMessage function to rc-utils * Move PushNotifications class to push-notifications package * Import variables to remove dependency of RC namespace * Import variables to remove RC namespace dependency inside rc-lib/server/lib * Import variables to remove RC namespace inside rc-lib/server/methods * Import variables to remove dependency with RC namespace * Remove duplicated server settings located in rc-lib * Export function and lib function of rc-lib but keep it inside RC namespace * Import variables from functions and lib to remove RC namespace dependency * Remove dependency of RC namespace in rc-sandstorm * Remove dependency of RC namespace in chatpal-search * Move CreadentialTokens model to rc-models * Move getUsernameSuggestion function and method from server/ to rc-lib * Remove dependency of RC namespace in meteor saml * Remove dependency of RC namespace in rc-theme * Move 2FA Users model to rc-models * Remove dependency of RC namespace in rc-2fa * Remove dependency of RC namespace in rc-action-links * Add action links in the RC namespace * Remove dependency of RC namespace in rc-analytics * Remove dependency of RC namespace in rc-assets * Add Assets in RC namespace * Remove dependency of RC namespace in rc-autolinker * Move autotranslate models to rc-models * Partial remove dependency of Rc namespace in rc-autotranslate * Remove dependency of RC namespace in rc-markdown * Finish of remotion of RC namespace in rc-autotranslate * Import Autotranslate where it has been used * Fix lint * Rename Assets variable to avoid conflicts * Fix rename Assets * Remove dependency of RC namespace in rc-blockstack * Remove RC dependency in bot-helpers * Remove RC dependency in rc-cas * Move some functions from tokenpass to channel settings and models * Move some function from livestream to channel settings * Remove dependency of RC namespace in rc-channel-settings * Fix wrong imports * Remove dependency of RC namespace in rc-channel-mail-messages * Remove dependency of RC namespace in rc-cloud * Remove dependency of RC namespace in rc-colors * Remove dependency of RC namespace in rc-cors * Remove dependency of RC namespace in rc-crowd * Remove dependency of RC namespace in rc-dolphin * Remove dependency of RC namespace in rc-drupal * Move Emoji custom server and client models to rc-models * Remove dependency of RC namespace in rc-emoji-custom * Remove dependency of RC namespace in rc-emojione * Remove dependency of RC namespace in rc-error-handler * Remove dependency of RC namespace in rc-gh-enterprise * Remove dependency of RC namespace in rc-gitlab * Remove dependency of RC namespace in rc-google-natural-language * Remove dependency of RC namespace in rc-grant * Remove dependency of RC namespace in rc-highlight-words * Remove dependency of RC namespace in rc-google-vision * Fix lint * Remove dependency of RC namespace in rc-iframe-login * Remove dependency of RC namespace in all importes, except hipchat-enterprise * Move RestAPI client to rc-api package * Remove dependency of RC namespace in rc-api/helpers and api.js * Remove dependency of RC namespace on half of api files * Partial Remove dependency of RC namespace in rc-api * import API where it was being used by the RC namespace * Move processWebhookMessage function to rc-lib package * Remove API from RC namespace and import missing function that was being used with namespace * Remove dependency of RC namespace in rc-graphql * Fix import from wrong package * Remove dependency of RC namespace in rc-importer * Remove dependency of RC namespace in rc-issue-links * Remove dependency of RC namespace in rc-katex * Move templateVarHandler fn to rc-utils * Remove dependency of RC namespace in rc-ldap * Remove dependency of RC namespace in rc-livestream * Remove dependency of RC namespace in rc-mail-messages * Remove dependency of RC namespace in rc-mapview * Remove dependency of RC namespace in rc-mentions * Remove dependency of RC namespace in rc-mentions-flextab * Remove depedency of RC namespace in rc-message-attachements * Remove dependdency of RC namespace in rc-message-mark-as-unread * Remove dependency of RC namespace in rc-message-pin * Fix templateVarHandler that was in wrong folder * Remove namespace in the new livechat endpoint * Remove dependency of RC namespace in rc-message-snippet * Remove dependency of RC namespace in rc-message-star * Remove dependency of RC namespace in rc-oauth2 * Remove dependency of RC namespace in rc-oembed * Remove dependency of RC namespace in rc-otr * Remove dependency of RC namespace in rc-reactions * Remove dependency of RC namespace in rc-retention-policy * Remove dependency of RC namespace in rc-earch * Remove dependency of RC namespace in rc-setup-wizard * Remove dependency of RC namespace in rc-slackbridge * Remove dependency of Rc namespace in slashcommands-asciiarts * Remove depedency of RC namespace in rc-slash-archiveroom * Remove dependency of RC namespace in rc-slash-create * Remove dependency of RC namespace in rc-slash-help * Remove dependency of RC namespace in rc-slash-hide * Remove dependency of RC namespace in rc-slash-invite * Remove dependency of RC namespace in rc-slash-inviteall * Remove dependency of RC namespace in rc-slash-join * Remove dependency of RC namespace in rc-slash-kick * Remove dependency of RC namespace in rc-slash-leave * Remove dependency of RC namespace in rc-slash-me * Remove dependency of RC namespace in rc-slash-msg * Remove dependency of RC namespace in rc-slash-mute * Remove dependency of RC namespace in rc-slash-open * Remove dependency of RC namespace in rc-slash-topic * Remove dependency of RC namespace in rc-slash-unarchiveroom * Remove dependency of RC namespace in rc-smarsh-connector * Remove dependency of RC namespace in rc-sms * Remove dependency of RC namespace in rc-spotify * Remove dependency of RC namespace in rc-statistics * Move tokenpass models methods to rc-models * Remove dependency of RC namespace in rc-tokenpass * import tokenpass inside rc-lib * Remove dependency of RC namespace in rc-ui * Move webdavAccounts models to rc-model * Remove dependency of RC namespace in rc-ui-account * Remove dependency of RC namespace in rc-ui-admin * Remove dependency of RC namespace in rc-ui-clean-history * Remove dependency of RC namespace in rc-ui-flextab * Remove dependency of RC namespace in rc-ui-login * Remove dependency of RC namespace in rc-ui-master * Remove dependency of RC namespace in rc-ui-message * REmove dependency of RC namespace in rc-user-data-download * Remove dependency of RC namespace in rc-version-check * Remove dependency of RC namespace in rc-videobridge * Remove dependency of RC namespace in rc-webdav * Remove dependency of RC namespace in rc-wordpress * Remove some RC namespace use in chatpal-search * Remove dependency of RC namespace in rc-irc * Remove dependency of RC namespace in livechat/client * Move methods in common livechat models to rc-models * Remove dependency of RC namespace in rc-livechat/server/models * Remove LIvechat global variable from RC namespace * Remove dependency of RC namespace in rc-livechat/imports, lib, server/api, server/hooks and server/lib * Remove dependency of RC namespace in rc-livechat/server/methods * Fix duplicated import * Remove unused import * Remove dependency of RC namespace in rc-livechat/server/publications * MOve rc-livechat server models to rc-models * Change imports of livechat server models to rc-models package * Remove dependency of RC namespace in rc-api/helpers and api.js (#13273) * Move RestAPI client to rc-api package * Remove dependency of RC namespace in rc-api/helpers and api.js * Remove dependency of RC namespace on half of api files (#13275) * Move RestAPI client to rc-api package * Remove dependency of RC namespace in rc-api/helpers and api.js * Remove dependency of RC namespace on half of api files * Remove dependency of RC namespace in rc-integrations * Import missed functions in rc-irc * Remove dependency of RC namespace in rc-hipchat-enterprise-importer * Partial Remove dependency of RC namespace in rc-api (#13277) * Move RestAPI client to rc-api package * Remove dependency of RC namespace in rc-api/helpers and api.js * Remove dependency of RC namespace on half of api files * Partial Remove dependency of RC namespace in rc-api * Remove dependency of RC namespace in root client folder * Remove dependency of RC namespace in imports/message-read-receipt * Remove dependency of RC namespace in imports/personal-access-tokens * Remove dependency of RC namespace in rc-api (#13278) * Move RestAPI client to rc-api package * Remove dependency of RC namespace in rc-api/helpers and api.js * Remove dependency of RC namespace on half of api files * Partial Remove dependency of RC namespace in rc-api * import API where it was being used by the RC namespace * Move processWebhookMessage function to rc-lib package * Remove API from RC namespace and import missing function that was being used with namespace * Remove namespace in the new livechat endpoint * Remove dependency of RC namespace in rc-graphql (#13279) * Move RestAPI client to rc-api package * Remove dependency of RC namespace in rc-api/helpers and api.js * Remove dependency of RC namespace on half of api files * Partial Remove dependency of RC namespace in rc-api * import API where it was being used by the RC namespace * Move processWebhookMessage function to rc-lib package * Remove API from RC namespace and import missing function that was being used with namespace * Remove dependency of RC namespace in rc-graphql * Fix import from wrong package * Remove namespace in the new livechat endpoint * Remove dependency of RC namespace in root server folder - step 1 * Remove dependency of RC namespace in rc-importer (#13280) * Move RestAPI client to rc-api package * Remove dependency of RC namespace in rc-api/helpers and api.js * Remove dependency of RC namespace on half of api files * Partial Remove dependency of RC namespace in rc-api * import API where it was being used by the RC namespace * Move processWebhookMessage function to rc-lib package * Remove API from RC namespace and import missing function that was being used with namespace * Remove dependency of RC namespace in rc-graphql * Fix import from wrong package * Remove dependency of RC namespace in rc-importer * Remove namespace in the new livechat endpoint * Remove dependency of RC namespace in rc-ldap, katex and issue-links (#13281) * Move RestAPI client to rc-api package * Remove dependency of RC namespace in rc-api/helpers and api.js * Remove dependency of RC namespace on half of api files * Partial Remove dependency of RC namespace in rc-api * import API where it was being used by the RC namespace * Move processWebhookMessage function to rc-lib package * Remove API from RC namespace and import missing function that was being used with namespace * Remove dependency of RC namespace in rc-graphql * Fix import from wrong package * Remove dependency of RC namespace in rc-importer * Remove dependency of RC namespace in rc-issue-links * Remove dependency of RC namespace in rc-katex * Move templateVarHandler fn to rc-utils * Remove dependency of RC namespace in rc-ldap * Fix templateVarHandler that was in wrong folder * Remove namespace in the new livechat endpoint * Remove dependency of RC namespace in rc-livestream and rc-mail-messages (#13320) * Move RestAPI client to rc-api package * Remove dependency of RC namespace in rc-api/helpers and api.js * Remove dependency of RC namespace on half of api files * Partial Remove dependency of RC namespace in rc-api * import API where it was being used by the RC namespace * Move processWebhookMessage function to rc-lib package * Remove API from RC namespace and import missing function that was being used with namespace * Remove dependency of RC namespace in rc-graphql * Fix import from wrong package * Remove dependency of RC namespace in rc-importer * Remove dependency of RC namespace in rc-issue-links * Remove dependency of RC namespace in rc-katex * Move templateVarHandler fn to rc-utils * Remove dependency of RC namespace in rc-ldap * Remove dependency of RC namespace in rc-livestream * Remove dependency of RC namespace in rc-mail-messages * Fix templateVarHandler that was in wrong folder * Remove namespace in the new livechat endpoint * Remove dependency of RC namespace in root server folder - step 2 * Remove dependency of RC namespace in root server folder - step 3 * Remove dependency of RC namespace in root server folder - step 4 * Remove dependency of RC namespace in root server folder - step 5 * Remove dependency of RC namespace in root server folder - step 6 * Move RestAPIClient to package rc-utils to remove cyclic dependency between lib, apps and api * Move apps model to rc-models * Convert rocketchat-apps to main module structure * Import Apps where it is being used * Remove global variable Apps from eslintrc * Import missed functions to remove dependency of RC namespace * MOve roomExit function to rc-utils * Fix lint * Fix roomExit function, put currentTracker in the window to be able to keep the function sync * Convert rocketchat-lib to main module structure * Fix import from wrong package * Fix tests * Remove RC namespace * Remove RC namespace * Remove RC namespace --- .../client/admin/adminEmoji.js | 2 +- .../client/lib/emojiCustom.js | 6 +- packages/rocketchat-lib/client/index.js | 14 + packages/rocketchat-lib/client/lib/index.js | 25 +- packages/rocketchat-lib/package.js | 339 +++--------------- .../rocketchat-lib/server/functions/index.js | 6 +- packages/rocketchat-lib/server/index.js | 68 ++++ packages/rocketchat-lib/server/lib/index.js | 23 +- .../server/methods/saveSettings.js | 9 +- .../server/publications/settings.js | 2 +- .../server/lib/SAUMonitor.js | 6 +- .../client/users/adminUsers.js | 4 +- .../client/messageBoxNotSubscribed.js | 14 +- .../client/startup/messageBoxActions.js | 4 +- .../client/startup/restoreText.js | 6 +- .../client/components/header/headerRoom.js | 8 +- server/lib/cordova.js | 2 +- 17 files changed, 180 insertions(+), 358 deletions(-) create mode 100644 packages/rocketchat-lib/client/index.js diff --git a/packages/rocketchat-emoji-custom/client/admin/adminEmoji.js b/packages/rocketchat-emoji-custom/client/admin/adminEmoji.js index 2d940f5bda16..254295a939ff 100644 --- a/packages/rocketchat-emoji-custom/client/admin/adminEmoji.js +++ b/packages/rocketchat-emoji-custom/client/admin/adminEmoji.js @@ -44,7 +44,7 @@ Template.adminEmoji.helpers({ onTableItemClick() { const instance = Template.instance(); return function({ _id }) { - instance.tabBarData.set(RocketChat.models.EmojiCustom.findOne({ _id })); + instance.tabBarData.set(EmojiCustom.findOne({ _id })); instance.tabBar.open('admin-emoji-info'); }; }, diff --git a/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js b/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js index a9042e84f155..fc8e93082b63 100644 --- a/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js +++ b/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js @@ -132,7 +132,7 @@ emoji.packages.emojiCustom = { render(html) { const emojisMatchGroup = emoji.packages.emojiCustom.list.map(RegExp.escape).join('|'); - if (emojisMatchGroup !== RocketChat.emoji.packages.emojiCustom._regexpSignature) { + if (emojisMatchGroup !== emoji.packages.emojiCustom._regexpSignature) { emoji.packages.emojiCustom._regexpSignature = emojisMatchGroup; emoji.packages.emojiCustom._regexp = new RegExp(`]*>.*?<\/object>|]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|(${ emojisMatchGroup })`, 'gi'); } @@ -144,10 +144,10 @@ emoji.packages.emojiCustom = { let emojiAlias = shortname.replace(/:/g, ''); - let dataCheck = RocketChat.emoji.list[shortname]; + let dataCheck = emoji.list[shortname]; if (dataCheck.hasOwnProperty('aliasOf')) { emojiAlias = dataCheck.aliasOf; - dataCheck = RocketChat.emoji.list[`:${ emojiAlias }:`]; + dataCheck = emoji.list[`:${ emojiAlias }:`]; } return `${ shortname }`; diff --git a/packages/rocketchat-lib/client/index.js b/packages/rocketchat-lib/client/index.js new file mode 100644 index 000000000000..b9a0bfa6f57e --- /dev/null +++ b/packages/rocketchat-lib/client/index.js @@ -0,0 +1,14 @@ +import '../lib/startup/settingsOnLoadSiteUrl'; +import '../lib/MessageTypes'; +import './CustomTranslations'; +import './defaultTabBars'; +import './OAuthProxy'; +import './UserDeleted'; +import './lib/startup/commands'; +import './lib/settings'; +import './lib/userRoles'; +import './methods/sendMessage'; +import './views/customFieldsForm.html'; +import './views/customFieldsForm'; +import '../startup/defaultRoomTypes'; +export * from './lib'; diff --git a/packages/rocketchat-lib/client/lib/index.js b/packages/rocketchat-lib/client/lib/index.js index 1964294de6b5..3b7017648ba7 100644 --- a/packages/rocketchat-lib/client/lib/index.js +++ b/packages/rocketchat-lib/client/lib/index.js @@ -5,25 +5,6 @@ for the *client* pieces of code which does include the shared library files. */ - -import { RocketChatTabBar } from './RocketChatTabBar'; -import { RocketChatAnnouncement } from './RocketChatAnnouncement'; -import { RoomSettingsEnum, RoomTypeConfig, RoomTypeRouteConfig, UiTextContext } from '../../lib/RoomTypeConfig'; -import { hide, leave, erase, call } from 'meteor/rocketchat:ui-utils'; -import { LoginPresence } from './LoginPresence'; -import * as DateFormat from './formatDate'; - -export { - call, - erase, - hide, - leave, - RocketChatTabBar, - RoomSettingsEnum, - RoomTypeConfig, - RoomTypeRouteConfig, - UiTextContext, - RocketChatAnnouncement, - LoginPresence, - DateFormat, -}; +export { RocketChatAnnouncement } from './RocketChatAnnouncement'; +export { LoginPresence } from './LoginPresence'; +export * as DateFormat from './formatDate'; diff --git a/packages/rocketchat-lib/package.js b/packages/rocketchat-lib/package.js index 09f1602961c6..76fbca3a0439 100644 --- a/packages/rocketchat-lib/package.js +++ b/packages/rocketchat-lib/package.js @@ -6,294 +6,59 @@ Package.describe({ }); Package.onUse(function(api) { - api.use('rate-limit'); - api.use('webapp'); - api.use('session'); - api.use('reactive-var'); - api.use('reactive-dict'); - api.use('accounts-base'); - api.use('ecmascript'); - api.use('random'); - api.use('google-oauth'); - api.use('check'); - api.use('tracker'); - api.use('jparker:gravatar'); - api.use('ddp-rate-limiter'); - api.use('mongo'); - api.use('oauth'); - api.use('matb33:collection-hooks'); - api.use('yasaricli:slugify'); - api.use('service-configuration'); - api.use('check'); - api.use('rocketchat:utils'); - api.use('rocketchat:models'); - api.use('rocketchat:migrations'); - api.use('rocketchat:metrics'); - api.use('rocketchat:callbacks'); - api.use('rocketchat:notifications'); - api.use('rocketchat:promises'); - api.use('rocketchat:ui-utils'); - api.use('rocketchat:tooltip'); - api.use('rocketchat:emoji'); - api.use('rocketchat:ui'); - api.use('rocketchat:accounts'); - api.use('modules'); - api.use('rocketchat:i18n'); - api.use('rocketchat:streamer'); - api.use('rocketchat:version'); - api.use('rocketchat:logger'); - api.use('rocketchat:mailer'); - api.use('rocketchat:settings'); - api.use('rocketchat:sandstorm'); - api.use('rocketchat:authorization'); - api.use('mizzao:timesync'); - api.use('rocketchat:custom-oauth'); - api.use('konecty:multiple-instances-status'); - api.use('rocketchat:file'); - api.use('rocketchat:file-upload'); - api.use('rocketchat:push-notifications'); - api.use('rocketchat:action-links'); - api.use('rocketchat:assets'); - api.use('rocketchat:markdown'); - api.use('rocketchat:channel-settings'); - api.use('rocketchat:tokenpass'); - api.use('rocketchat:apps'); - - api.use('templating', 'client'); - api.use('kadira:flow-router'); - api.use('kadira:blaze-layout', 'client'); - - api.addFiles('lib/core.js'); - - api.addFiles('lib/settings.js'); - - // DEBUGGER - api.addFiles('server/lib/debug.js', 'server'); - - // ROOM TYPES - api.addFiles('lib/RoomTypeConfig.js'); - api.addFiles([ - 'lib/roomTypes/conversation.js', - 'lib/roomTypes/direct.js', - 'lib/roomTypes/favorite.js', - 'lib/roomTypes/index.js', - 'lib/roomTypes/private.js', - 'lib/roomTypes/public.js', - 'lib/roomTypes/unread.js', + api.use([ + 'ecmascript', + 'templating', + 'rate-limit', + 'kadira:flow-router', + 'kadira:blaze-layout', + 'webapp', + 'session', + 'reactive-var', + 'reactive-dict', + 'accounts-base', + 'random', + 'google-oauth', + 'check', + 'tracker', + 'jparker:gravatar', + 'ddp-rate-limiter', + 'mongo', + 'oauth', + 'mizzao:timesync', + 'konecty:multiple-instances-status', + 'matb33:collection-hooks', + 'yasaricli:slugify', + 'service-configuration', + 'rocketchat:utils', + 'rocketchat:models', + 'rocketchat:migrations', + 'rocketchat:metrics', + 'rocketchat:callbacks', + 'rocketchat:notifications', + 'rocketchat:promises', + 'rocketchat:ui-utils', + 'rocketchat:tooltip', + 'rocketchat:ui', + 'rocketchat:accounts', + 'rocketchat:i18n', + 'rocketchat:mailer', + 'rocketchat:settings', + 'rocketchat:sandstorm', + 'rocketchat:authorization', + 'rocketchat:custom-oauth', + 'rocketchat:file', + 'rocketchat:file-upload', + 'rocketchat:push-notifications', + 'rocketchat:assets', + 'rocketchat:markdown', + 'rocketchat:channel-settings', + 'rocketchat:tokenpass', + 'rocketchat:apps', ]); + api.imply('tap:i18n'); + api.addFiles('lib/core.js'); - // COMMON LIB - api.addFiles('lib/getURL.js'); - api.addFiles('lib/callbacks.js'); - api.addFiles('lib/fileUploadRestrictions.js'); - api.addFiles('lib/getAvatarColor.js'); - api.addFiles('lib/getDefaultSubscriptionPref.js'); - api.addFiles('lib/getValidRoomName.js'); - api.addFiles('lib/placeholders.js'); - api.addFiles('lib/promises.js'); - api.addFiles('lib/RoomTypesCommon.js'); - api.addFiles('lib/slashCommand.js'); - api.addFiles('lib/Message.js'); - api.addFiles('lib/MessageProperties.js'); - api.addFiles('lib/messageBox.js'); - api.addFiles('lib/MessageTypes.js'); - api.addFiles('lib/templateVarHandler.js'); - api.addFiles('lib/info.js'); - api.addFiles('lib/authorization.js'); - api.addFiles('lib/actionLinks.js'); - api.addFiles('lib/Markdown.js'); - - api.addFiles('lib/getUserNotificationPreference.js'); - api.addFiles('lib/getUserPreference.js'); - api.addFiles('lib/emoji.js'); - - api.addFiles('server/lib/bugsnag.js', 'server'); - api.addFiles('server/lib/metrics_import.js', 'server'); - - api.addFiles('server/lib/RateLimiter.js', 'server'); - - // SERVER FUNCTIONS - api.addFiles('server/functions/isDocker.js', 'server'); - api.addFiles('server/functions/isTheLastMessage.js', 'server'); - api.addFiles('server/functions/addUserToDefaultChannels.js', 'server'); - api.addFiles('server/functions/addUserToRoom.js', 'server'); - api.addFiles('server/functions/archiveRoom.js', 'server'); - api.addFiles('server/functions/checkUsernameAvailability.js', 'server'); - api.addFiles('server/functions/checkEmailAvailability.js', 'server'); - api.addFiles('server/functions/composeMessageObjectWithUser_import.js', 'server'); - api.addFiles('server/functions/createRoom.js', 'server'); - api.addFiles('server/functions/cleanRoomHistory.js', 'server'); - api.addFiles('server/functions/deleteMessage.js', 'server'); - api.addFiles('server/functions/deleteUser.js', 'server'); - api.addFiles('server/functions/getFullUserData.js', 'server'); - api.addFiles('server/functions/getRoomByNameOrIdWithOptionToJoin.js', 'server'); - api.addFiles('server/functions/loadMessageHistory.js', 'server'); - api.addFiles('server/functions/removeUserFromRoom.js', 'server'); - api.addFiles('server/functions/saveUser.js', 'server'); - api.addFiles('server/functions/saveCustomFields.js', 'server'); - api.addFiles('server/functions/saveCustomFieldsWithoutValidation.js', 'server'); - api.addFiles('server/functions/sendMessage.js', 'server'); - api.addFiles('server/functions/insertMessage.js', 'server'); - api.addFiles('server/functions/setUserAvatar.js', 'server'); - api.addFiles('server/functions/setUsername.js', 'server'); - api.addFiles('server/functions/setRealName.js', 'server'); - api.addFiles('server/functions/setEmail.js', 'server'); - api.addFiles('server/functions/unarchiveRoom.js', 'server'); - api.addFiles('server/functions/updateMessage.js', 'server'); - api.addFiles('server/functions/validateCustomFields.js', 'server'); - api.addFiles('server/functions/Notifications.js', 'server'); - api.addFiles('server/functions/authorization.js', 'server'); - api.addFiles('server/functions/getUsernameSuggestion.js', 'server'); - api.addFiles('server/functions/saveRoomTopic.js', 'server'); - api.addFiles('server/functions/saveRoomName.js', 'server'); - - // SERVER LIB - api.addFiles('server/lib/configLogger.js', 'server'); - api.addFiles('server/lib/PushNotification_import.js', 'server'); - api.addFiles('server/lib/defaultBlockedDomainsList.js', 'server'); - api.addFiles('server/lib/interceptDirectReplyEmails.js', 'server'); - api.addFiles('server/lib/loginErrorMessageOverride.js', 'server'); - api.addFiles('server/lib/notifyUsersOnMessage.js', 'server'); - api.addFiles('server/lib/processDirectEmail.js', 'server'); - api.addFiles('server/lib/roomTypes.js', 'server'); - api.addFiles('server/lib/sendNotificationsOnMessage.js', 'server'); - api.addFiles('server/lib/validateEmailDomain.js', 'server'); - api.addFiles('server/lib/passwordPolicy.js', 'server'); - api.addFiles('server/lib/migrations.js', 'server'); - api.addFiles('server/lib/sandstorm.js', 'server'); - api.addFiles('server/lib/Assets.js', 'server'); - - // SERVER MODELS - api.addFiles('server/models/index.js', 'server'); - - api.addFiles('server/oauth/oauth.js', 'server'); - api.addFiles('server/oauth/facebook.js', 'server'); - api.addFiles('server/oauth/twitter.js', 'server'); - api.addFiles('server/oauth/google.js', 'server'); - api.addFiles('server/oauth/proxy.js', 'server'); - - api.addFiles('server/startup/statsTracker_import.js', 'server'); - api.addFiles('server/startup/robots.js', 'server'); - - // SERVER PUBLICATIONS - api.addFiles('server/publications/settings.js', 'server'); - - // SERVER METHODS - api.addFiles('server/methods/addOAuthService.js', 'server'); - api.addFiles('server/methods/refreshOAuthService.js', 'server'); - api.addFiles('server/methods/addUserToRoom.js', 'server'); - api.addFiles('server/methods/addUsersToRoom.js', 'server'); - api.addFiles('server/methods/archiveRoom.js', 'server'); - api.addFiles('server/methods/blockUser.js', 'server'); - api.addFiles('server/methods/checkRegistrationSecretURL.js', 'server'); - api.addFiles('server/methods/checkUsernameAvailability.js', 'server'); - api.addFiles('server/methods/cleanRoomHistory.js', 'server'); - api.addFiles('server/methods/createChannel.js', 'server'); - api.addFiles('server/methods/createToken.js', 'server'); - api.addFiles('server/methods/createPrivateGroup.js', 'server'); - api.addFiles('server/methods/deleteMessage.js', 'server'); - api.addFiles('server/methods/deleteUserOwnAccount.js', 'server'); - api.addFiles('server/methods/executeSlashCommandPreview.js', 'server'); - api.addFiles('server/methods/filterBadWords.js', ['server']); - api.addFiles('server/methods/filterATAllTag.js', 'server'); - api.addFiles('server/methods/filterATHereTag.js', 'server'); - api.addFiles('server/methods/getChannelHistory.js', 'server'); - api.addFiles('server/methods/getFullUserData.js', 'server'); - api.addFiles('server/methods/getRoomJoinCode.js', 'server'); - api.addFiles('server/methods/getRoomRoles.js', 'server'); - api.addFiles('server/methods/getServerInfo.js', 'server'); - api.addFiles('server/methods/getSingleMessage.js', 'server'); - api.addFiles('server/methods/getSlashCommandPreviews.js', 'server'); - api.addFiles('server/methods/getUserRoles.js', 'server'); - api.addFiles('server/methods/insertOrUpdateUser.js', 'server'); - api.addFiles('server/methods/joinDefaultChannels.js', 'server'); - api.addFiles('server/methods/joinRoom.js', 'server'); - api.addFiles('server/methods/leaveRoom.js', 'server'); - api.addFiles('server/methods/removeOAuthService.js', 'server'); - api.addFiles('server/methods/restartServer.js', 'server'); - api.addFiles('server/methods/robotMethods.js', 'server'); - api.addFiles('server/methods/saveSetting.js', 'server'); - api.addFiles('server/methods/saveSettings.js', 'server'); - api.addFiles('server/methods/sendInvitationEmail.js', 'server'); - api.addFiles('server/methods/sendMessage.js', 'server'); - api.addFiles('server/methods/sendSMTPTestEmail.js', 'server'); - api.addFiles('server/methods/setAdminStatus.js', 'server'); - api.addFiles('server/methods/setRealName.js', 'server'); - api.addFiles('server/methods/setUsername.js', 'server'); - api.addFiles('server/methods/setEmail.js', 'server'); - api.addFiles('server/methods/unarchiveRoom.js', 'server'); - api.addFiles('server/methods/unblockUser.js', 'server'); - api.addFiles('server/methods/updateMessage.js', 'server'); - api.addFiles('server/methods/getUsernameSuggestion.js', 'server'); - - // SERVER STARTUP - api.addFiles('server/startup/settingsOnLoadCdnPrefix.js', 'server'); - api.addFiles('server/startup/settingsOnLoadDirectReply.js', 'server'); - api.addFiles('server/startup/settingsOnLoadSMTP.js', 'server'); - api.addFiles('server/startup/oAuthServicesUpdate.js', 'server'); - api.addFiles('server/startup/settings.js', 'server'); - - // COMMON STARTUP - api.addFiles('lib/startup/settingsOnLoadSiteUrl.js'); - - // CLIENT LIB - api.addFiles('client/Notifications.js', 'client'); - api.addFiles('client/OAuthProxy.js', 'client'); - api.addFiles('client/UserDeleted.js', 'client'); - api.addFiles('client/lib/TabBar.js', 'client'); - api.addFiles('client/lib/RocketChatTabBar.js', 'client'); - api.addFiles('client/lib/RocketChatAnnouncement.js', 'client'); - api.addFiles('client/lib/cachedCollection.js', 'client'); - api.addFiles('client/lib/openRoom.js', 'client'); - api.addFiles('client/lib/settings.js', 'client'); - api.addFiles('client/lib/roomTypes.js', 'client'); - api.addFiles('client/lib/userRoles.js', 'client'); - api.addFiles('client/lib/Layout.js', 'client'); - api.addFiles('client/lib/handleError.js', 'client'); - api.addFiles('client/lib/authorization.js', 'client'); - api.addFiles('client/lib/tooltip.js', 'client'); - api.addFiles('client/lib/EmojiPicker.js', 'client'); - api.addFiles('client/lib/ui-buttons.js', 'client'); - api.addFiles('client/lib/sandstorm.js', 'client'); - api.addFiles('client/lib/ChannelSettings.js', 'client'); - - // CLIENT LIB STARTUP - api.addFiles('client/lib/startup/commands.js', 'client'); - - // CLIENT METHODS - api.addFiles('client/methods/sendMessage.js', 'client'); - api.addFiles('client/AdminBox.js', 'client'); - api.addFiles('client/MessageAction.js', 'client'); - - api.addFiles('client/defaultTabBars.js', 'client'); - api.addFiles('client/CustomTranslations.js', 'client'); - - // CLIENT MODELS - api.addFiles('client/models/index.js', 'client'); - api.addFiles('client/models/ChatPermissions.js', 'client'); - api.addFiles('client/models/Messages.js', 'client'); - api.addFiles('client/models/Roles.js', 'client'); - api.addFiles('client/models/Rooms.js', 'client'); - api.addFiles('client/models/Subscriptions.js', 'client'); - api.addFiles('client/models/Users.js', 'client'); - - // CLIENT VIEWS - api.addFiles('client/views/customFieldsForm.html', 'client'); - api.addFiles('client/views/customFieldsForm.js', 'client'); - - api.addFiles('startup/defaultRoomTypes.js'); - api.addFiles('startup/index.js', 'server'); - - api.addFiles('server/startup/rateLimiter.js', 'server'); - - // EXPORT - api.export('RocketChat'); - api.export('handleError', 'client'); - api.export('openRoom', 'client'); - - // exports api.mainModule('server/index.js', 'server'); - api.mainModule('client/lib/index.js', 'client'); - - api.imply('tap:i18n'); + api.mainModule('client/index.js', 'client'); }); diff --git a/packages/rocketchat-lib/server/functions/index.js b/packages/rocketchat-lib/server/functions/index.js index cffd2ebf4750..32358d53839f 100644 --- a/packages/rocketchat-lib/server/functions/index.js +++ b/packages/rocketchat-lib/server/functions/index.js @@ -9,8 +9,11 @@ export { deleteMessage } from './deleteMessage'; export { deleteUser } from './deleteUser'; export { getFullUserData } from './getFullUserData'; export { getRoomByNameOrIdWithOptionToJoin } from './getRoomByNameOrIdWithOptionToJoin'; +export { generateUsernameSuggestion } from './getUsernameSuggestion'; +export { insertMessage } from './insertMessage'; export { isTheLastMessage } from './isTheLastMessage'; export { loadMessageHistory } from './loadMessageHistory'; +export { processWebhookMessage } from './processWebhookMessage'; export { removeUserFromRoom } from './removeUserFromRoom'; export { saveCustomFields } from './saveCustomFields'; export { saveCustomFieldsWithoutValidation } from './saveCustomFieldsWithoutValidation'; @@ -23,6 +26,3 @@ export { setUsername } from './setUsername'; export { unarchiveRoom } from './unarchiveRoom'; export { updateMessage } from './updateMessage'; export { validateCustomFields } from './validateCustomFields'; -export { generateUsernameSuggestion } from './getUsernameSuggestion'; -export { processWebhookMessage } from './processWebhookMessage'; -export { insertMessage } from './insertMessage'; diff --git a/packages/rocketchat-lib/server/index.js b/packages/rocketchat-lib/server/index.js index d43727359c92..32753a449ea6 100644 --- a/packages/rocketchat-lib/server/index.js +++ b/packages/rocketchat-lib/server/index.js @@ -1,2 +1,70 @@ +export { hostname } from '../lib/startup/settingsOnLoadSiteUrl'; export * from './lib'; export * from './functions'; +import './startup/email'; +import './startup/oAuthServicesUpdate'; +import './startup/rateLimiter'; +import './startup/robots'; +import './startup/settings'; +import './startup/settingsOnLoadCdnPrefix'; +import './startup/settingsOnLoadDirectReply'; +import './startup/settingsOnLoadSMTP'; +import '../lib/MessageTypes'; +import '../startup'; +import '../startup/defaultRoomTypes'; +import './lib/bugsnag'; +import './lib/configLogger'; +import './lib/debug'; +import './lib/loginErrorMessageOverride'; +import './oauth/oauth'; +import './oauth/facebook'; +import './oauth/google'; +import './oauth/proxy'; +import './oauth/twitter'; +import './methods/addOAuthService'; +import './methods/addUsersToRoom'; +import './methods/addUserToRoom'; +import './methods/archiveRoom'; +import './methods/blockUser'; +import './methods/checkRegistrationSecretURL'; +import './methods/checkUsernameAvailability'; +import './methods/cleanRoomHistory'; +import './methods/createChannel'; +import './methods/createPrivateGroup'; +import './methods/createToken'; +import './methods/deleteMessage'; +import './methods/deleteUserOwnAccount'; +import './methods/executeSlashCommandPreview'; +import './methods/filterATAllTag'; +import './methods/filterATHereTag'; +import './methods/filterBadWords'; +import './methods/getChannelHistory'; +import './methods/getFullUserData'; +import './methods/getRoomJoinCode'; +import './methods/getRoomRoles'; +import './methods/getServerInfo'; +import './methods/getSingleMessage'; +import './methods/getSlashCommandPreviews'; +import './methods/getUsernameSuggestion'; +import './methods/getUserRoles'; +import './methods/insertOrUpdateUser'; +import './methods/joinDefaultChannels'; +import './methods/joinRoom'; +import './methods/leaveRoom'; +import './methods/refreshOAuthService'; +import './methods/removeOAuthService'; +import './methods/restartServer'; +import './methods/robotMethods'; +import './methods/saveSetting'; +import './methods/saveSettings'; +import './methods/sendInvitationEmail'; +import './methods/sendMessage'; +import './methods/sendSMTPTestEmail'; +import './methods/setAdminStatus'; +import './methods/setEmail'; +import './methods/setRealName'; +import './methods/setUsername'; +import './methods/unarchiveRoom'; +import './methods/unblockUser'; +import './methods/updateMessage'; +import './publications/settings'; diff --git a/packages/rocketchat-lib/server/lib/index.js b/packages/rocketchat-lib/server/lib/index.js index 2c20567bc166..e35c912c2411 100644 --- a/packages/rocketchat-lib/server/lib/index.js +++ b/packages/rocketchat-lib/server/lib/index.js @@ -5,22 +5,9 @@ for the *server* pieces of code which does include the shared library files. */ - -import { RoomSettingsEnum, RoomTypeConfig, RoomTypeRouteConfig } from '../../lib/RoomTypeConfig'; -import { sendNotification } from './sendNotificationsOnMessage.js'; +export { sendNotification } from './sendNotificationsOnMessage.js'; export { hostname } from '../../lib/startup/settingsOnLoadSiteUrl'; -import { passwordPolicy } from './passwordPolicy'; -import { validateEmailDomain } from './validateEmailDomain'; -import { RateLimiterClass as RateLimiter } from './RateLimiter'; -import { processDirectEmail } from './processDirectEmail'; - -export { - RoomSettingsEnum, - RoomTypeConfig, - RoomTypeRouteConfig, - sendNotification, - passwordPolicy, - validateEmailDomain, - RateLimiter, - processDirectEmail, -}; +export { passwordPolicy } from './passwordPolicy'; +export { validateEmailDomain } from './validateEmailDomain'; +export { RateLimiterClass as RateLimiter } from './RateLimiter'; +export { processDirectEmail } from './processDirectEmail'; diff --git a/packages/rocketchat-lib/server/methods/saveSettings.js b/packages/rocketchat-lib/server/methods/saveSettings.js index e94e1d9049a7..8fefea20fc60 100644 --- a/packages/rocketchat-lib/server/methods/saveSettings.js +++ b/packages/rocketchat-lib/server/methods/saveSettings.js @@ -1,5 +1,8 @@ import { Meteor } from 'meteor/meteor'; import { Match, check } from 'meteor/check'; +import { hasPermission } from 'meteor/rocketchat:authorization'; +import { settings } from 'meteor/rocketchat:settings'; +import { Settings } from 'meteor/rocketchat:models'; Meteor.methods({ saveSettings(params = []) { @@ -9,7 +12,7 @@ Meteor.methods({ }); } - if (!RocketChat.authz.hasPermission(Meteor.userId(), 'edit-privileged-setting')) { + if (!hasPermission(Meteor.userId(), 'edit-privileged-setting')) { throw new Meteor.Error('error-action-not-allowed', 'Editing settings is not allowed', { method: 'saveSetting', }); @@ -18,7 +21,7 @@ Meteor.methods({ // Verify the _id passed in is a string. check(_id, String); - const setting = RocketChat.models.Settings.db.findOneById(_id); + const setting = Settings.db.findOneById(_id); // Verify the value is what it should be switch (setting.type) { @@ -35,7 +38,7 @@ Meteor.methods({ check(value, String); break; } - RocketChat.settings.updateById(_id, value, editor); + settings.updateById(_id, value, editor); }); return true; }, diff --git a/packages/rocketchat-lib/server/publications/settings.js b/packages/rocketchat-lib/server/publications/settings.js index 667e028cc174..43f6375bedda 100644 --- a/packages/rocketchat-lib/server/publications/settings.js +++ b/packages/rocketchat-lib/server/publications/settings.js @@ -36,7 +36,7 @@ Meteor.methods({ } if (!(updatedAfter instanceof Date)) { - return RocketChat.models.Settings.findNotHidden().fetch(); + return Settings.findNotHidden().fetch(); } const records = Settings.findNotHidden({ updatedAfter }).fetch(); diff --git a/packages/rocketchat-statistics/server/lib/SAUMonitor.js b/packages/rocketchat-statistics/server/lib/SAUMonitor.js index dc66c06d4a16..2294e2031306 100644 --- a/packages/rocketchat-statistics/server/lib/SAUMonitor.js +++ b/packages/rocketchat-statistics/server/lib/SAUMonitor.js @@ -122,8 +122,10 @@ export class SAUMonitorClass { Accounts.onLogout((info) => { const sessionId = info.connection.id; - const userId = info.user._id; - Sessions.logoutByInstanceIdAndSessionIdAndUserId(this._instanceId, sessionId, userId); + if (info.user) { + const userId = info.user._id; + Sessions.logoutByInstanceIdAndSessionIdAndUserId(this._instanceId, sessionId, userId); + } }); } diff --git a/packages/rocketchat-ui-admin/client/users/adminUsers.js b/packages/rocketchat-ui-admin/client/users/adminUsers.js index 51d56b09abbb..7b2b40fae622 100644 --- a/packages/rocketchat-ui-admin/client/users/adminUsers.js +++ b/packages/rocketchat-ui-admin/client/users/adminUsers.js @@ -3,12 +3,10 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; -import { SideNav, TabBar } from 'meteor/rocketchat:ui-utils'; +import { SideNav, TabBar, RocketChatTabBar } from 'meteor/rocketchat:ui-utils'; import _ from 'underscore'; import s from 'underscore.string'; -import { RocketChatTabBar } from 'meteor/rocketchat:lib'; - Template.adminUsers.helpers({ searchText() { const instance = Template.instance(); diff --git a/packages/rocketchat-ui-message/client/messageBoxNotSubscribed.js b/packages/rocketchat-ui-message/client/messageBoxNotSubscribed.js index a995176a7eb6..f709eb56a8e7 100644 --- a/packages/rocketchat-ui-message/client/messageBoxNotSubscribed.js +++ b/packages/rocketchat-ui-message/client/messageBoxNotSubscribed.js @@ -2,23 +2,23 @@ import { Meteor } from 'meteor/meteor'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; import { settings } from 'meteor/rocketchat:settings'; -import { RoomHistoryManager, RoomManager } from 'meteor/rocketchat:ui'; -import { call } from 'meteor/rocketchat:ui-utils'; -import { t } from 'meteor/rocketchat:utils'; +import { RoomHistoryManager, RoomManager, call } from 'meteor/rocketchat:ui-utils'; +import { t, roomTypes } from 'meteor/rocketchat:utils'; +import { hasAllPermission } from 'meteor/rocketchat:authorization'; import toastr from 'toastr'; import './messageBoxNotSubscribed.html'; Template.messageBoxNotSubscribed.helpers({ customTemplate() { - return RocketChat.roomTypes.getNotSubscribedTpl(this.rid); + return roomTypes.getNotSubscribedTpl(this.rid); }, canJoinRoom() { - return Meteor.userId() && RocketChat.roomTypes.verifyShowJoinLink(this.rid); + return Meteor.userId() && roomTypes.verifyShowJoinLink(this.rid); }, roomName() { const room = Session.get(`roomData${ this.rid }`); - return RocketChat.roomTypes.getRoomName(room.t, room); + return roomTypes.getRoomName(room.t, room); }, isJoinCodeRequired() { const room = Session.get(`roomData${ this.rid }`); @@ -44,7 +44,7 @@ Template.messageBoxNotSubscribed.events({ try { await call('joinRoom', this.rid, joinCode); - if (RocketChat.authz.hasAllPermission('preview-c-room') === false && RoomHistoryManager.getRoom(this.rid).loaded === 0) { + if (hasAllPermission('preview-c-room') === false && RoomHistoryManager.getRoom(this.rid).loaded === 0) { RoomManager.getOpenedRoomByRid(this.rid).streamActive = false; RoomManager.getOpenedRoomByRid(this.rid).ready = false; RoomHistoryManager.getRoom(this.rid).loaded = null; diff --git a/packages/rocketchat-ui-message/client/startup/messageBoxActions.js b/packages/rocketchat-ui-message/client/startup/messageBoxActions.js index afba7959f513..022282c15cfd 100644 --- a/packages/rocketchat-ui-message/client/startup/messageBoxActions.js +++ b/packages/rocketchat-ui-message/client/startup/messageBoxActions.js @@ -102,9 +102,9 @@ Meteor.startup(() => { const handleGeolocationError = () => geolocation.set(false); Tracker.autorun(() => { - const isMapViewEnabled = RocketChat.settings.get('MapView_Enabled') === true; + const isMapViewEnabled = settings.get('MapView_Enabled') === true; const isGeolocationWatchSupported = navigator.geolocation && navigator.geolocation.watchPosition; - const googleMapsApiKey = RocketChat.settings.get('MapView_GMapsAPIKey'); + const googleMapsApiKey = settings.get('MapView_GMapsAPIKey'); const canGetGeolocation = isMapViewEnabled && isGeolocationWatchSupported && (googleMapsApiKey && googleMapsApiKey.length); diff --git a/packages/rocketchat-ui-message/client/startup/restoreText.js b/packages/rocketchat-ui-message/client/startup/restoreText.js index 81b8ac52e5dc..5d7565a8562f 100644 --- a/packages/rocketchat-ui-message/client/startup/restoreText.js +++ b/packages/rocketchat-ui-message/client/startup/restoreText.js @@ -1,9 +1,11 @@ import { Meteor } from 'meteor/meteor'; -import { RoomManager, chatMessages } from 'meteor/rocketchat:ui'; +import { RoomManager } from 'meteor/rocketchat:ui-utils'; +import { chatMessages } from 'meteor/rocketchat:ui'; +import { callbacks } from 'meteor/rocketchat:callbacks'; Meteor.startup(() => { - RocketChat.callbacks.add('enter-room', () => { + callbacks.add('enter-room', () => { setTimeout(() => { if (!chatMessages[RoomManager.openedRoom].input) { return; diff --git a/packages/rocketchat-ui/client/components/header/headerRoom.js b/packages/rocketchat-ui/client/components/header/headerRoom.js index 6c8cc0244978..5ebd17d7143a 100644 --- a/packages/rocketchat-ui/client/components/header/headerRoom.js +++ b/packages/rocketchat-ui/client/components/header/headerRoom.js @@ -6,6 +6,8 @@ import { t, roomTypes, handleError } from 'meteor/rocketchat:utils'; import { TabBar, fireGlobalEvent } from 'meteor/rocketchat:ui-utils'; import { ChatSubscription, Rooms } from 'meteor/rocketchat:models'; import { settings } from 'meteor/rocketchat:settings'; +import { emoji } from 'meteor/rocketchat:emoji'; +import { Markdown } from 'meteor/rocketchat:markdown'; const isSubscribed = (_id) => ChatSubscription.find({ rid: _id }).count() > 0; @@ -63,13 +65,13 @@ Template.headerRoom.helpers({ const roomData = Session.get(`roomData${ this._id }`); if (!roomData || !roomData.topic) { return ''; } - let roomTopic = RocketChat.Markdown.parse(roomData.topic); + let roomTopic = Markdown.parse(roomData.topic); // ' to apostrophe (') for emojis such as :') roomTopic = roomTopic.replace(/'/g, '\''); - Object.keys(RocketChat.emoji.packages).forEach((emojiPackage) => { - roomTopic = RocketChat.emoji.packages[emojiPackage].render(roomTopic); + Object.keys(emoji.packages).forEach((emojiPackage) => { + roomTopic = emoji.packages[emojiPackage].render(roomTopic); }); // apostrophe (') back to ' diff --git a/server/lib/cordova.js b/server/lib/cordova.js index 1c3eef13189a..35547155b8be 100644 --- a/server/lib/cordova.js +++ b/server/lib/cordova.js @@ -79,7 +79,7 @@ Meteor.methods({ }); function sendPush(service, token, options, tries = 0) { - options.uniqueId = RocketChat.settings.get('uniqueID'); + options.uniqueId = settings.get('uniqueID'); const data = { data: {