Remove dependency of RC namespace in rc-ui-master, ui-message- user-data-download and version-check (#13365)

* 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-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

* 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 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 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
pull/13366/head^2
Marcos Spessatto Defendi 6 years ago committed by Rodrigo Nascimento
parent 4fc80738ed
commit ed70ef6222
  1. 2
      packages/rocketchat-ui-master/client/main.js
  2. 1
      packages/rocketchat-ui-master/package.js
  3. 7
      packages/rocketchat-ui-master/server/dynamic-css.js
  4. 71
      packages/rocketchat-ui-message/client/message.js
  5. 59
      packages/rocketchat-ui-message/client/messageBox.js
  6. 4
      packages/rocketchat-ui-message/client/popup/messagePopupChannel.js
  7. 40
      packages/rocketchat-ui-message/client/popup/messagePopupConfig.js
  8. 7
      packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js
  9. 28
      packages/rocketchat-ui-message/client/startup/messageBoxActions.js
  10. 6
      packages/rocketchat-ui-message/package.js
  11. 3
      packages/rocketchat-user-data-download/package.js
  12. 43
      packages/rocketchat-user-data-download/server/cronProcessDownloads.js
  13. 4
      packages/rocketchat-user-data-download/server/startup/settings.js
  14. 2
      packages/rocketchat-version-check/client/client.js
  15. 5
      packages/rocketchat-version-check/package.js
  16. 4
      packages/rocketchat-version-check/server/addSettings.js
  17. 20
      packages/rocketchat-version-check/server/functions/checkVersionUpdate.js
  18. 10
      packages/rocketchat-version-check/server/functions/getNewUpdates.js
  19. 4
      packages/rocketchat-version-check/server/methods/banner_dismiss.js

@ -15,7 +15,7 @@ import { tooltip } from 'meteor/rocketchat:tooltip';
import Clipboard from 'clipboard';
import s from 'underscore.string';
settings.collection.find({ _id:/theme-color-rc/i }, { fields:{ value: 1 } }).observe({ changed: () => { DynamicCss.run(true); } });
settings.collection.find({ _id:/theme-color-rc/i }, { fields:{ value: 1 } }).observe({ changed: () => { DynamicCss.run(true, settings); } });
Template.body.onRendered(function() {
new Clipboard('.clipboard');

@ -18,6 +18,7 @@ Package.onUse(function(api) {
'reactive-var',
'rocketchat:utils',
'rocketchat:tooltip',
'rocketchat:settings',
'rocketchat:ui-utils',
'rocketchat:ui-sidenav',
'meteorhacks:inject-initial',

@ -144,9 +144,14 @@
DynamicCss.run = debounce(function () {
var replace = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var settings = arguments.length && arguments[1];
if (replace && !settings) {
console.error('You must provide settings to the "run" function in DynamicCss');
}
if (replace) {
var colors = RocketChat.settings.collection.find({
var colors = settings.collection.find({
_id: /theme-color-rc/i
}, {
fields: {

@ -7,11 +7,14 @@ import _ from 'underscore';
import moment from 'moment';
import { DateFormat } from 'meteor/rocketchat:lib';
import { renderEmoji } from 'meteor/rocketchat:emoji';
import { renderMessageBody } from 'meteor/rocketchat:ui-utils';
import { RocketChat } from 'meteor/rocketchat:lib';
import { RoomRoles, UserRoles } from 'meteor/rocketchat:ui';
import { renderMessageBody, MessageTypes, MessageAction } from 'meteor/rocketchat:ui-utils';
import { settings } from 'meteor/rocketchat:settings';
import { RoomRoles, UserRoles, Roles, Subscriptions, Rooms } from 'meteor/rocketchat:models';
import { AutoTranslate } from 'meteor/rocketchat:autotranslate';
import { t } from 'meteor/rocketchat:utils';
import { hasAtLeastOnePermission } from 'meteor/rocketchat:authorization';
import { callbacks } from 'meteor/rocketchat:callbacks';
import { Markdown } from 'meteor/rocketchat:markdown';
import { t, getUserPreference, roomTypes } from 'meteor/rocketchat:utils';
async function renderPdfToCanvas(canvasId, pdfLink) {
const isSafari = /constructor/i.test(window.HTMLElement) ||
@ -87,7 +90,7 @@ Template.message.helpers({
}
},
roleTags() {
if (!RocketChat.settings.get('UI_DisplayRoles') || RocketChat.getUserPreference(Meteor.userId(), 'hideRoles')) {
if (!settings.get('UI_DisplayRoles') || getUserPreference(Meteor.userId(), 'hideRoles')) {
return [];
}
@ -100,7 +103,7 @@ Template.message.helpers({
rid: this.rid,
});
const roles = [...(userRoles && userRoles.roles) || [], ...(roomRoles && roomRoles.roles) || []];
return RocketChat.models.Roles.find({
return Roles.find({
_id: {
$in: roles,
},
@ -142,10 +145,10 @@ Template.message.helpers({
if (!this.u) {
return '';
}
return (RocketChat.settings.get('UI_Use_Real_Name') && this.u.name) || this.u.username;
return (settings.get('UI_Use_Real_Name') && this.u.name) || this.u.username;
},
showUsername() {
return this.alias || (RocketChat.settings.get('UI_Use_Real_Name') && this.u && this.u.name);
return this.alias || (settings.get('UI_Use_Real_Name') && this.u && this.u.name);
},
own() {
if (this.u && this.u._id === Meteor.userId()) {
@ -156,7 +159,7 @@ Template.message.helpers({
return +this.ts;
},
chatops() {
if (this.u && this.u.username === RocketChat.settings.get('Chatops_Username')) {
if (this.u && this.u.username === settings.get('Chatops_Username')) {
return 'chatops-message';
}
},
@ -175,7 +178,7 @@ Template.message.helpers({
return Template.instance().body;
},
system(returnClass) {
if (RocketChat.MessageTypes.isSystemMessage(this)) {
if (MessageTypes.isSystemMessage(this)) {
if (returnClass) {
return 'color-info-font-color';
}
@ -183,8 +186,8 @@ Template.message.helpers({
}
},
showTranslated() {
if (RocketChat.settings.get('AutoTranslate_Enabled') && this.u && this.u._id !== Meteor.userId() && !RocketChat.MessageTypes.isSystemMessage(this)) {
const subscription = RocketChat.models.Subscriptions.findOne({
if (settings.get('AutoTranslate_Enabled') && this.u && this.u._id !== Meteor.userId() && !MessageTypes.isSystemMessage(this)) {
const subscription = Subscriptions.findOne({
rid: this.rid,
'u._id': Meteor.userId(),
}, {
@ -215,13 +218,13 @@ Template.message.helpers({
return (this.editedBy && this.editedBy.username) || '?';
},
canEdit() {
const hasPermission = RocketChat.authz.hasAtLeastOnePermission('edit-message', this.rid);
const isEditAllowed = RocketChat.settings.get('Message_AllowEditing');
const hasPermission = hasAtLeastOnePermission('edit-message', this.rid);
const isEditAllowed = settings.get('Message_AllowEditing');
const editOwn = this.u && this.u._id === Meteor.userId();
if (!(hasPermission || (isEditAllowed && editOwn))) {
return;
}
const blockEditInMinutes = RocketChat.settings.get('Message_AllowEditing_BlockEditInMinutes');
const blockEditInMinutes = settings.get('Message_AllowEditing_BlockEditInMinutes');
if (blockEditInMinutes) {
let msgTs;
if (this.ts != null) {
@ -237,13 +240,13 @@ Template.message.helpers({
}
},
canDelete() {
const hasPermission = RocketChat.authz.hasAtLeastOnePermission('delete-message', this.rid);
const isDeleteAllowed = RocketChat.settings.get('Message_AllowDeleting');
const hasPermission = hasAtLeastOnePermission('delete-message', this.rid);
const isDeleteAllowed = settings.get('Message_AllowDeleting');
const deleteOwn = this.u && this.u._id === Meteor.userId();
if (!(hasPermission || (isDeleteAllowed && deleteOwn))) {
return;
}
const blockDeleteInMinutes = RocketChat.settings.get('Message_AllowDeleting_BlockDeleteInMinutes');
const blockDeleteInMinutes = settings.get('Message_AllowDeleting_BlockDeleteInMinutes');
if (blockDeleteInMinutes) {
let msgTs;
if (this.ts != null) {
@ -259,7 +262,7 @@ Template.message.helpers({
}
},
showEditedStatus() {
return RocketChat.settings.get('Message_ShowEditedStatus');
return settings.get('Message_ShowEditedStatus');
},
label() {
if (this.i18nLabel) {
@ -270,12 +273,12 @@ Template.message.helpers({
},
hasOembed() {
// there is no URLs, there is no template to show the oembed (oembed package removed) or oembed is not enable
if (!(this.urls && this.urls.length > 0) || !Template.oembedBaseWidget || !RocketChat.settings.get('API_Embed')) {
if (!(this.urls && this.urls.length > 0) || !Template.oembedBaseWidget || !settings.get('API_Embed')) {
return false;
}
// check if oembed is disabled for message's sender
if ((RocketChat.settings.get('API_EmbedDisabledFor') || '').split(',').map((username) => username.trim()).includes(this.u && this.u.username)) {
if ((settings.get('API_EmbedDisabledFor') || '').split(',').map((username) => username.trim()).includes(this.u && this.u.username)) {
return false;
}
return true;
@ -337,7 +340,7 @@ Template.message.helpers({
data.index = index;
},
hideCog() {
const subscription = RocketChat.models.Subscriptions.findOne({
const subscription = Subscriptions.findOne({
rid: this.rid,
});
if (subscription == null) {
@ -345,7 +348,7 @@ Template.message.helpers({
}
},
channelName() {
const subscription = RocketChat.models.Subscriptions.findOne({ rid: this.rid });
const subscription = Subscriptions.findOne({ rid: this.rid });
return subscription && subscription.name;
},
roomIcon() {
@ -353,7 +356,7 @@ Template.message.helpers({
if (room && room.t === 'd') {
return 'at';
}
return RocketChat.roomTypes.getIcon(room && room.t);
return roomTypes.getIcon(room && room.t);
},
fromSearch() {
return this.customClass === 'search';
@ -373,7 +376,7 @@ Template.message.helpers({
context = 'message';
}
return RocketChat.MessageAction.getButtons(Template.currentData(), context, messageGroup);
return MessageAction.getButtons(Template.currentData(), context, messageGroup);
},
isSnippet() {
return this.actionContext === 'snippeted';
@ -384,9 +387,9 @@ Template.message.helpers({
Template.message.onCreated(function() {
let msg = Template.currentData();
this.wasEdited = (msg.editedAt != null) && !RocketChat.MessageTypes.isSystemMessage(msg);
this.wasEdited = (msg.editedAt != null) && !MessageTypes.isSystemMessage(msg);
this.room = RocketChat.models.Rooms.findOne({
this.room = Rooms.findOne({
_id: msg.rid,
}, {
fields: {
@ -395,8 +398,8 @@ Template.message.onCreated(function() {
});
return this.body = (() => {
const isSystemMessage = RocketChat.MessageTypes.isSystemMessage(msg);
const messageType = RocketChat.MessageTypes.getType(msg) || {};
const isSystemMessage = MessageTypes.isSystemMessage(msg);
const messageType = MessageTypes.getType(msg) || {};
if (messageType.render) {
msg = messageType.render(msg);
} else if (messageType.template) {
@ -407,16 +410,16 @@ Template.message.onCreated(function() {
} else {
msg = TAPi18n.__(messageType.message);
}
} else if (msg.u && msg.u.username === RocketChat.settings.get('Chatops_Username')) {
} else if (msg.u && msg.u.username === settings.get('Chatops_Username')) {
msg.html = msg.msg;
msg = RocketChat.callbacks.run('renderMentions', msg);
msg = callbacks.run('renderMentions', msg);
msg = msg.html;
} else {
msg = renderMessageBody(msg);
}
if (isSystemMessage) {
msg.html = RocketChat.Markdown.parse(msg.html);
msg.html = Markdown.parse(msg.html);
}
return msg;
})();
@ -458,7 +461,7 @@ Template.message.onViewRendered = function(context) {
}
if (previousDataset.groupable === 'false' || currentDataset.groupable === 'false') {
$currentNode.removeClass('sequential');
} else if (previousDataset.username !== currentDataset.username || parseInt(currentDataset.timestamp) - parseInt(previousDataset.timestamp) > RocketChat.settings.get('Message_GroupingPeriod') * 1000) {
} else if (previousDataset.username !== currentDataset.username || parseInt(currentDataset.timestamp) - parseInt(previousDataset.timestamp) > settings.get('Message_GroupingPeriod') * 1000) {
$currentNode.removeClass('sequential');
} else if (!$currentNode.hasClass('new-day')) {
$currentNode.addClass('sequential');
@ -472,7 +475,7 @@ Template.message.onViewRendered = function(context) {
$nextNode.removeClass('new-day');
}
if (nextDataset.groupable !== 'false') {
if (nextDataset.username !== currentDataset.username || parseInt(nextDataset.timestamp) - parseInt(currentDataset.timestamp) > RocketChat.settings.get('Message_GroupingPeriod') * 1000) {
if (nextDataset.username !== currentDataset.username || parseInt(nextDataset.timestamp) - parseInt(currentDataset.timestamp) > settings.get('Message_GroupingPeriod') * 1000) {
$nextNode.removeClass('sequential');
} else if (!$nextNode.hasClass('new-day') && !$currentNode.hasClass('temp')) {
$nextNode.addClass('sequential');

@ -2,19 +2,14 @@ import { Meteor } from 'meteor/meteor';
import { ReactiveVar } from 'meteor/reactive-var';
import { Session } from 'meteor/session';
import { Template } from 'meteor/templating';
import { katex } from 'meteor/rocketchat:katex';
import { RocketChat } from 'meteor/rocketchat:lib';
import { settings } from 'meteor/rocketchat:settings';
import {
ChatSubscription,
RoomManager,
KonchatNotification,
popover,
ChatMessages,
fileUpload,
chatMessages,
} from 'meteor/rocketchat:ui';
import { t } from 'meteor/rocketchat:utils';
import { Markdown } from 'meteor/rocketchat:markdown';
import { EmojiPicker } from 'meteor/rocketchat:emoji';
import { KonchatNotification, fileUpload, chatMessages, ChatMessages } from 'meteor/rocketchat:ui';
import { RoomManager, popover, messageBox, Layout } from 'meteor/rocketchat:ui-utils';
import { ChatSubscription } from 'meteor/rocketchat:models';
import { t, roomTypes, getUserPreference } from 'meteor/rocketchat:utils';
import { katex } from 'meteor/rocketchat:katex';
import moment from 'moment';
import './messageBoxReplyPreview';
import './messageBoxTyping';
@ -28,45 +23,45 @@ const formattingButtons = [
icon: 'bold',
pattern: '*{{text}}*',
command: 'b',
condition: () => RocketChat.Markdown && settings.get('Markdown_Parser') === 'original',
condition: () => Markdown && settings.get('Markdown_Parser') === 'original',
},
{
label: 'bold',
icon: 'bold',
pattern: '**{{text}}**',
command: 'b',
condition: () => RocketChat.Markdown && settings.get('Markdown_Parser') === 'marked',
condition: () => Markdown && settings.get('Markdown_Parser') === 'marked',
},
{
label: 'italic',
icon: 'italic',
pattern: '_{{text}}_',
command: 'i',
condition: () => RocketChat.Markdown && settings.get('Markdown_Parser') !== 'disabled',
condition: () => Markdown && settings.get('Markdown_Parser') !== 'disabled',
},
{
label: 'strike',
icon: 'strike',
pattern: '~{{text}}~',
condition: () => RocketChat.Markdown && settings.get('Markdown_Parser') === 'original',
condition: () => Markdown && settings.get('Markdown_Parser') === 'original',
},
{
label: 'strike',
icon: 'strike',
pattern: '~~{{text}}~~',
condition: () => RocketChat.Markdown && settings.get('Markdown_Parser') === 'marked',
condition: () => Markdown && settings.get('Markdown_Parser') === 'marked',
},
{
label: 'inline_code',
icon: 'code',
pattern: '`{{text}}`',
condition: () => RocketChat.Markdown && settings.get('Markdown_Parser') !== 'disabled',
condition: () => Markdown && settings.get('Markdown_Parser') !== 'disabled',
},
{
label: 'multi_line',
icon: 'multiline',
pattern: '```\n{{text}}\n``` ',
condition: () => RocketChat.Markdown && settings.get('Markdown_Parser') !== 'disabled',
condition: () => Markdown && settings.get('Markdown_Parser') !== 'disabled',
},
{
label: 'KaTeX',
@ -137,11 +132,11 @@ function applyFormatting(event, instance) {
Template.messageBox.onCreated(function() {
RocketChat.EmojiPicker.init();
EmojiPicker.init();
this.replyMessageData = new ReactiveVar();
this.isMessageFieldEmpty = new ReactiveVar(true);
this.sendIconDisabled = new ReactiveVar(false);
RocketChat.messageBox.emit('created', this);
messageBox.emit('created', this);
});
Template.messageBox.onRendered(function() {
@ -172,16 +167,16 @@ Template.messageBox.onRendered(function() {
Template.messageBox.helpers({
isEmbedded() {
return RocketChat.Layout.isEmbedded();
return Layout.isEmbedded();
},
subscribed() {
return RocketChat.roomTypes.verifyCanSendMessage(this._id);
return roomTypes.verifyCanSendMessage(this._id);
},
canSend() {
if (RocketChat.roomTypes.readOnly(this._id, Meteor.user())) {
if (roomTypes.readOnly(this._id, Meteor.user())) {
return false;
}
if (RocketChat.roomTypes.archived(this._id)) {
if (roomTypes.archived(this._id)) {
return false;
}
const roomData = Session.get(`roomData${ this._id }`);
@ -216,7 +211,7 @@ Template.messageBox.helpers({
return Template.instance().replyMessageData.get();
},
isEmojiEnabled() {
return RocketChat.getUserPreference(Meteor.userId(), 'useEmojis');
return getUserPreference(Meteor.userId(), 'useEmojis');
},
maxMessageLength() {
return settings.get('Message_MaxAllowedSize');
@ -233,7 +228,7 @@ Template.messageBox.helpers({
settings.get('FileUpload_MediaTypeWhiteList').match(/audio\/mp3|audio\/\*/i));
},
actions() {
const actionGroups = RocketChat.messageBox.actions.get();
const actionGroups = messageBox.actions.get();
return Object.values(actionGroups)
.reduce((actions, actionGroup) => [...actions, ...actionGroup], []);
},
@ -266,16 +261,16 @@ Template.messageBox.events({
event.stopPropagation();
event.preventDefault();
if (!RocketChat.getUserPreference(Meteor.userId(), 'useEmojis')) {
if (!getUserPreference(Meteor.userId(), 'useEmojis')) {
return;
}
if (RocketChat.EmojiPicker.isOpened()) {
RocketChat.EmojiPicker.close();
if (EmojiPicker.isOpened()) {
EmojiPicker.close();
return;
}
RocketChat.EmojiPicker.open(event.currentTarget, (emoji) => {
EmojiPicker.open(event.currentTarget, (emoji) => {
const emojiValue = `:${ emoji }:`;
const { input } = chatMessages[RoomManager.openedRoom];
@ -355,7 +350,7 @@ Template.messageBox.events({
});
},
'click .rc-message-box__action-menu'(event) {
const groups = RocketChat.messageBox.actions.get();
const groups = messageBox.actions.get();
const config = {
popoverClass: 'message-box',
columns: [

@ -1,8 +1,8 @@
import { Template } from 'meteor/templating';
import { RocketChat } from 'meteor/rocketchat:lib';
import { roomTypes } from 'meteor/rocketchat:utils';
Template.messagePopupChannel.helpers({
channelIcon() {
return RocketChat.roomTypes.getIcon(this.t);
return roomTypes.getIcon(this.t);
},
});

@ -5,9 +5,11 @@ import { Blaze } from 'meteor/blaze';
import { Session } from 'meteor/session';
import { Template } from 'meteor/templating';
import { TAPi18n } from 'meteor/tap:i18n';
import { RocketChat } from 'meteor/rocketchat:lib';
import { Messages, Subscriptions, Users } from 'meteor/rocketchat:models';
import { hasAllPermission, hasAtLeastOnePermission } from 'meteor/rocketchat:authorization';
import { EmojiPicker, emoji } from 'meteor/rocketchat:emoji';
import { RoomManager } from 'meteor/rocketchat:ui-utils';
import { t } from 'meteor/rocketchat:utils';
import { t, getUserPreference, slashCommands } from 'meteor/rocketchat:utils';
import _ from 'underscore';
const usersFromRoomMessages = new Mongo.Collection(null);
@ -18,7 +20,7 @@ const reloadUsersFromRoomMessages = (userId, rid) => {
usersFromRoomMessages.remove({});
const uniqueMessageUsersControl = {};
RocketChat.models.Messages.find({
Messages.find({
rid,
'u.username': { $ne: user.username },
t: { $exists: false },
@ -93,7 +95,7 @@ const fetchUsersFromServer = (filterText, records, cb, rid) => {
};
const fetchRoomsFromServer = (filterText, records, cb, rid) => {
if (!RocketChat.authz.hasAllPermission('view-outside-room')) {
if (!hasAllPermission('view-outside-room')) {
return cb && cb([]);
}
@ -128,7 +130,7 @@ const addEmojiToRecents = (emoji) => {
const view = Blaze.getView(pickerEl);
if (view) {
Template._withTemplateInstanceFunc(view.templateInstance, () => {
RocketChat.EmojiPicker.addRecent(emoji.replace(/:/g, ''));
EmojiPicker.addRecent(emoji.replace(/:/g, ''));
});
}
}
@ -161,16 +163,16 @@ const seeColor = new RegExp('_t(?:o|$)(?:n|$)(?:e|$)(?:[1-5]|$)(?:\:|$)$');
const getEmojis = function(collection, filter) {
const key = `:${ filter }`;
if (!RocketChat.getUserPreference(Meteor.userId(), 'useEmojis')) {
if (!getUserPreference(Meteor.userId(), 'useEmojis')) {
return [];
}
if (!RocketChat.emoji.packages.emojione || RocketChat.emoji.packages.emojione.asciiList[key]) {
if (!emoji.packages.emojione || emoji.packages.emojione.asciiList[key]) {
return [];
}
const regExp = new RegExp(RegExp.escape(filter), 'i');
const recents = RocketChat.EmojiPicker.getRecent().map((item) => `:${ item }:`);
const recents = EmojiPicker.getRecent().map((item) => `:${ item }:`);
return Object.keys(collection).map((_id) => {
const data = collection[key];
return { _id, data };
@ -214,8 +216,8 @@ Template.messagePopupConfig.helpers({
// If needed, add to list the online users
if (items.length < 5 && filterText !== '') {
const usernamesAlreadyFetched = items.map(({ username }) => username);
if (!RocketChat.authz.hasAllPermission('view-outside-room')) {
const usernamesFromDMs = RocketChat.models.Subscriptions
if (!hasAllPermission('view-outside-room')) {
const usernamesFromDMs = Subscriptions
.find(
{
t: 'd',
@ -236,7 +238,7 @@ Template.messagePopupConfig.helpers({
}
)
.map(({ name }) => name);
const newItems = RocketChat.models.Users
const newItems = Users
.find(
{
username: {
@ -344,7 +346,7 @@ Template.messagePopupConfig.helpers({
const self = this;
const config = {
title: t('Channels'),
collection: RocketChat.models.Subscriptions,
collection: Subscriptions,
trigger: '#',
suffix: ' ',
textFilterDelay: 500,
@ -383,7 +385,7 @@ Template.messagePopupConfig.helpers({
const self = this;
const config = {
title: t('Commands'),
collection: RocketChat.slashCommands.commands,
collection: slashCommands.commands,
trigger: '/',
suffix: ' ',
triggerAnywhere: false,
@ -409,21 +411,21 @@ Template.messagePopupConfig.helpers({
return true;
}
return RocketChat.authz.hasAtLeastOnePermission(command.permission, Session.get('openedRoom'));
return hasAtLeastOnePermission(command.permission, Session.get('openedRoom'));
}).sort((a, b) => a._id > b._id).slice(0, 11);
},
};
return config;
},
emojiEnabled() {
return RocketChat.emoji != null;
return emoji != null;
},
popupEmojiConfig() {
if (RocketChat.emoji != null) {
if (emoji != null) {
const self = this;
return {
title: t('Emoji'),
collection: RocketChat.emoji.list,
collection: emoji.list,
template: 'messagePopupEmoji',
trigger: ':',
prefix: '',
@ -438,11 +440,11 @@ Template.messagePopupConfig.helpers({
}
},
popupReactionEmojiConfig() {
if (RocketChat.emoji != null) {
if (emoji != null) {
const self = this;
return {
title: t('Emoji'),
collection: RocketChat.emoji.list,
collection: emoji.list,
template: 'messagePopupEmoji',
trigger: '\\+:',
prefix: '+',

@ -2,7 +2,8 @@ import { Meteor } from 'meteor/meteor';
import { ReactiveVar } from 'meteor/reactive-var';
import { Session } from 'meteor/session';
import { Template } from 'meteor/templating';
import { RocketChat } from 'meteor/rocketchat:lib';
import { slashCommands } from 'meteor/rocketchat:utils';
import { hasAtLeastOnePermission } from 'meteor/rocketchat:authorization';
import { toolbarSearch } from 'meteor/rocketchat:ui-sidenav';
import _ from 'underscore';
@ -123,12 +124,12 @@ Template.messagePopupSlashCommandPreview.onCreated(function() {
const matches = inputValueAtCursor.match(template.selectorRegex);
const cmd = matches[1].replace('/', '').trim().toLowerCase();
const command = RocketChat.slashCommands.commands[cmd];
const command = slashCommands.commands[cmd];
// Ensure the command they're typing actually exists
// And it provides a command preview
// And if it provides a permission to check, they have permission to run the command
if (!command || !command.providesPreview || (command.permission && !RocketChat.authz.hasAtLeastOnePermission(command.permission, Session.get('openedRoom')))) {
if (!command || !command.providesPreview || (command.permission && !hasAtLeastOnePermission(command.permission, Session.get('openedRoom')))) {
template.open.set(false);
return;
}

@ -4,27 +4,29 @@ import { ReactiveVar } from 'meteor/reactive-var';
import { Tracker } from 'meteor/tracker';
import mime from 'mime-type/with-db';
import { VRecDialog } from 'meteor/rocketchat:ui-vrecord';
import { RocketChat } from 'meteor/rocketchat:lib';
import { modal, fileUpload } from 'meteor/rocketchat:ui';
import { messageBox, modal } from 'meteor/rocketchat:ui-utils';
import { fileUpload } from 'meteor/rocketchat:ui';
import { settings } from 'meteor/rocketchat:settings';
import { t } from 'meteor/rocketchat:utils';
import { geolocation } from '../messageBox';
RocketChat.messageBox.actions.add('Create_new', 'Video_message', {
messageBox.actions.add('Create_new', 'Video_message', {
id: 'video-message',
icon: 'video',
condition: () => (navigator.mediaDevices || navigator.getUserMedia || navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia || navigator.msGetUserMedia) &&
window.MediaRecorder &&
RocketChat.settings.get('FileUpload_Enabled') &&
RocketChat.settings.get('Message_VideoRecorderEnabled') &&
(!RocketChat.settings.get('FileUpload_MediaTypeWhiteList') ||
RocketChat.settings.get('FileUpload_MediaTypeWhiteList').match(/video\/webm|video\/\*/i)),
settings.get('FileUpload_Enabled') &&
settings.get('Message_VideoRecorderEnabled') &&
(!settings.get('FileUpload_MediaTypeWhiteList') ||
settings.get('FileUpload_MediaTypeWhiteList').match(/video\/webm|video\/\*/i)),
action: ({ messageBox }) => (VRecDialog.opened ? VRecDialog.close() : VRecDialog.open(messageBox)),
});
RocketChat.messageBox.actions.add('Add_files_from', 'Computer', {
messageBox.actions.add('Add_files_from', 'Computer', {
id: 'file-upload',
icon: 'computer',
condition: () => RocketChat.settings.get('FileUpload_Enabled'),
condition: () => settings.get('FileUpload_Enabled'),
action({ event }) {
event.preventDefault();
const $input = $(document.createElement('input'));
@ -61,14 +63,14 @@ RocketChat.messageBox.actions.add('Add_files_from', 'Computer', {
},
});
RocketChat.messageBox.actions.add('Share', 'My_location', {
messageBox.actions.add('Share', 'My_location', {
id: 'share-location',
icon: 'map-pin',
condition: () => RocketChat.Geolocation.get() !== false,
condition: () => geolocation.get() !== false,
action({ rid }) {
const position = RocketChat.Geolocation.get();
const position = geolocation.get();
const { latitude, longitude } = position.coords;
const text = `<div class="upload-preview"><div class="upload-preview-file" style="background-size: cover; box-shadow: 0 0 0px 1px #dfdfdf; border-radius: 2px; height: 250px; width:100%; max-width: 500px; background-image:url(https://maps.googleapis.com/maps/api/staticmap?zoom=14&size=500x250&markers=color:gray%7Clabel:%7C${ latitude },${ longitude }&key=${ RocketChat.settings.get('MapView_GMapsAPIKey') })" ></div></div>`;
const text = `<div class="upload-preview"><div class="upload-preview-file" style="background-size: cover; box-shadow: 0 0 0px 1px #dfdfdf; border-radius: 2px; height: 250px; width:100%; max-width: 500px; background-image:url(https://maps.googleapis.com/maps/api/staticmap?zoom=14&size=500x250&markers=color:gray%7Clabel:%7C${ latitude },${ longitude }&key=${ settings.get('MapView_GMapsAPIKey') })" ></div></div>`;
modal.open({
title: t('Share_Location_Title'),

@ -17,7 +17,6 @@ Package.onUse(function(api) {
'templating',
'tracker',
'rocketchat:utils',
'rocketchat:ui',
'rocketchat:ui-utils',
'rocketchat:emoji',
'rocketchat:katex',
@ -28,6 +27,11 @@ Package.onUse(function(api) {
'rocketchat:ui-sidenav',
'rocketchat:file-upload',
'rocketchat:autotranslate',
'rocketchat:authorization',
'rocketchat:models',
'rocketchat:settings',
'rocketchat:callbacks',
'rocketchat:markdown',
]);
api.addAssets('../../node_modules/pdfjs-dist/build/pdf.worker.js', 'client');
api.mainModule('client/index.js', 'client');

@ -10,7 +10,8 @@ Package.onUse(function(api) {
'ecmascript',
'rocketchat:file',
'rocketchat:file-upload',
'rocketchat:lib',
'rocketchat:settings',
'rocketchat:models',
'webapp',
]);
api.mainModule('server/index.js', 'server');

@ -1,6 +1,7 @@
import { Meteor } from 'meteor/meteor';
import { TAPi18n } from 'meteor/tap:i18n';
import { RocketChat } from 'meteor/rocketchat:lib';
import { settings } from 'meteor/rocketchat:settings';
import { Subscriptions, Rooms, Users, Uploads, Messages, UserDataFiles, ExportOperations } from 'meteor/rocketchat:models';
import { FileUpload } from 'meteor/rocketchat:file-upload';
import { SyncedCron } from 'meteor/littledata:synced-cron';
import fs from 'fs';
@ -9,15 +10,15 @@ import archiver from 'archiver';
import * as Mailer from 'meteor/rocketchat:mailer';
let zipFolder = '/tmp/zipFiles';
if (RocketChat.settings.get('UserData_FileSystemZipPath') != null) {
if (RocketChat.settings.get('UserData_FileSystemZipPath').trim() !== '') {
zipFolder = RocketChat.settings.get('UserData_FileSystemZipPath');
if (settings.get('UserData_FileSystemZipPath') != null) {
if (settings.get('UserData_FileSystemZipPath').trim() !== '') {
zipFolder = settings.get('UserData_FileSystemZipPath');
}
}
let processingFrequency = 15;
if (RocketChat.settings.get('UserData_ProcessingFrequency') > 0) {
processingFrequency = RocketChat.settings.get('UserData_ProcessingFrequency');
if (settings.get('UserData_ProcessingFrequency') > 0) {
processingFrequency = settings.get('UserData_ProcessingFrequency');
}
const startFile = function(fileName, content) {
@ -38,16 +39,16 @@ const loadUserSubscriptions = function(exportOperation) {
exportOperation.roomList = [];
const exportUserId = exportOperation.userId;
const cursor = RocketChat.models.Subscriptions.findByUserId(exportUserId);
const cursor = Subscriptions.findByUserId(exportUserId);
cursor.forEach((subscription) => {
const roomId = subscription.rid;
const roomData = RocketChat.models.Rooms.findOneById(roomId);
const roomData = Rooms.findOneById(roomId);
let roomName = (roomData && roomData.name) ? roomData.name : roomId;
let userId = null;
if (subscription.t === 'd') {
userId = roomId.replace(exportUserId, '');
const userData = RocketChat.models.Users.findOneById(userId);
const userData = Users.findOneById(userId);
if (userData) {
roomName = userData.name;
@ -108,7 +109,7 @@ const getAttachmentData = function(attachment) {
const match = /^\/([^\/]+)\/([^\/]+)\/(.*)/.exec(url);
if (match && match[2]) {
const file = RocketChat.models.Uploads.findOneById(match[2]);
const file = Uploads.findOneById(match[2]);
if (file) {
attachmentData.fileId = file._id;
@ -173,7 +174,7 @@ const copyFile = function(exportOperation, attachmentData) {
return;
}
const file = RocketChat.models.Uploads.findOneById(attachmentData.fileId);
const file = Uploads.findOneById(attachmentData.fileId);
if (file) {
if (FileUpload.copy(file, attachmentData.targetFile)) {
@ -197,13 +198,13 @@ const continueExportingRoom = function(exportOperation, exportOpRoomData) {
}
let limit = 100;
if (RocketChat.settings.get('UserData_MessageLimitPerRequest') > 0) {
limit = RocketChat.settings.get('UserData_MessageLimitPerRequest');
if (settings.get('UserData_MessageLimitPerRequest') > 0) {
limit = settings.get('UserData_MessageLimitPerRequest');
}
const skip = exportOpRoomData.exportedCount;
const cursor = RocketChat.models.Messages.findByRoomId(exportOpRoomData.roomId, { limit, skip });
const cursor = Messages.findByRoomId(exportOpRoomData.roomId, { limit, skip });
const count = cursor.count();
cursor.forEach((msg) => {
@ -288,17 +289,17 @@ const isDownloadFinished = function(exportOperation) {
};
const sendEmail = function(userId) {
const lastFile = RocketChat.models.UserDataFiles.findLastFileByUser(userId);
const lastFile = UserDataFiles.findLastFileByUser(userId);
if (!lastFile) {
return;
}
const userData = RocketChat.models.Users.findOneById(userId);
const userData = Users.findOneById(userId);
if (!userData || !userData.emails || !userData.emails[0] || !userData.emails[0].address) {
return;
}
const emailAddress = `${ userData.name } <${ userData.emails[0].address }>`;
const fromAddress = RocketChat.settings.get('From_Email');
const fromAddress = settings.get('From_Email');
const subject = TAPi18n.__('UserDataDownload_EmailSubject');
const download_link = lastFile.url;
@ -355,7 +356,7 @@ const uploadZipFile = function(exportOperation, callback) {
const { size } = stat;
const { userId } = exportOperation;
const user = RocketChat.models.Users.findOneById(userId);
const user = Users.findOneById(userId);
const userDisplayName = user ? user.name : userId;
const utcDate = new Date().toISOString().split('T')[0];
@ -448,7 +449,7 @@ const continueExportOperation = function(exportOperation) {
if (exportOperation.status === 'uploading') {
uploadZipFile(exportOperation, () => {
exportOperation.status = 'completed';
RocketChat.models.ExportOperations.updateOperation(exportOperation);
ExportOperations.updateOperation(exportOperation);
});
return;
}
@ -458,14 +459,14 @@ const continueExportOperation = function(exportOperation) {
};
function processDataDownloads() {
const cursor = RocketChat.models.ExportOperations.findAllPending({ limit: 1 });
const cursor = ExportOperations.findAllPending({ limit: 1 });
cursor.forEach((exportOperation) => {
if (exportOperation.status === 'completed') {
return;
}
continueExportOperation(exportOperation);
RocketChat.models.ExportOperations.updateOperation(exportOperation);
ExportOperations.updateOperation(exportOperation);
if (exportOperation.status === 'completed') {
sendEmail(exportOperation.userId);

@ -1,6 +1,6 @@
import { RocketChat } from 'meteor/rocketchat:lib';
import { settings } from 'meteor/rocketchat:settings';
RocketChat.settings.addGroup('UserDataDownload', function() {
settings.addGroup('UserDataDownload', function() {
this.add('UserData_EnableDownload', true, {
type: 'boolean',

@ -1,7 +1,7 @@
import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';
import { TAPi18n } from 'meteor/tap:i18n';
import { alerts } from 'meteor/rocketchat:ui';
import { alerts } from 'meteor/rocketchat:ui-utils';
Meteor.startup(function() {
Tracker.autorun(() => {

@ -9,8 +9,11 @@ Package.onUse(function(api) {
api.use([
'mongo',
'ecmascript',
'rocketchat:lib',
'rocketchat:ui-utils',
'rocketchat:logger',
'rocketchat:models',
'rocketchat:settings',
'rocketchat:utils',
'rocketchat:cloud',
'littledata:synced-cron',
]);

@ -1,6 +1,6 @@
import { RocketChat } from 'meteor/rocketchat:lib';
import { settings } from 'meteor/rocketchat:settings';
RocketChat.settings.addGroup('General', function() {
settings.addGroup('General', function() {
this.section('Update', function() {
this.add('Update_LatestAvailableVersion', '0.0.0', {
type: 'string',

@ -1,6 +1,8 @@
import { Meteor } from 'meteor/meteor';
import { TAPi18n } from 'meteor/tap:i18n';
import { RocketChat } from 'meteor/rocketchat:lib';
import { settings } from 'meteor/rocketchat:settings';
import { Info } from 'meteor/rocketchat:utils';
import { Roles, Users } from 'meteor/rocketchat:models';
import semver from 'semver';
import logger from '../logger';
import getNewUpdates from './getNewUpdates';
@ -17,13 +19,13 @@ export default () => {
security: false,
};
const lastCheckedVersion = RocketChat.settings.get('Update_LatestAvailableVersion');
const lastCheckedVersion = settings.get('Update_LatestAvailableVersion');
versions.forEach((version) => {
if (semver.lte(version.version, lastCheckedVersion)) {
return;
}
if (semver.lte(version.version, RocketChat.Info.version)) {
if (semver.lte(version.version, Info.version)) {
return;
}
@ -36,8 +38,8 @@ export default () => {
});
if (update.exists) {
RocketChat.settings.updateById('Update_LatestAvailableVersion', update.lastestVersion.version);
RocketChat.models.Roles.findUsersInRole('admin').forEach((adminUser) => {
settings.updateById('Update_LatestAvailableVersion', update.lastestVersion.version);
Roles.findUsersInRole('admin').forEach((adminUser) => {
try {
Meteor.runAsUser(adminUser._id, () => Meteor.call('createDirectMessage', 'rocket.cat'));
@ -51,7 +53,7 @@ export default () => {
console.error(e);
}
RocketChat.models.Users.addBannerById(adminUser._id, {
Users.addBannerById(adminUser._id, {
id: 'versionUpdate',
priority: 10,
title: 'Update_your_RocketChat',
@ -63,12 +65,12 @@ export default () => {
}
if (alerts && alerts.length) {
RocketChat.models.Roles.findUsersInRole('admin').forEach((adminUser) => {
Roles.findUsersInRole('admin').forEach((adminUser) => {
try {
Meteor.runAsUser(adminUser._id, () => Meteor.call('createDirectMessage', 'rocket.cat'));
alerts.forEach((alert) => {
if (RocketChat.models.Users.bannerExistsById(adminUser._id, `alert-${ alert.id }`)) {
if (Users.bannerExistsById(adminUser._id, `alert-${ alert.id }`)) {
return;
}
@ -84,7 +86,7 @@ export default () => {
}
alerts.forEach((alert) => {
RocketChat.models.Users.addBannerById(adminUser._id, {
Users.addBannerById(adminUser._id, {
id: `alert-${ alert.id }`,
priority: 10,
title: alert.title,

@ -1,19 +1,21 @@
import os from 'os';
import { HTTP } from 'meteor/http';
import { RocketChat } from 'meteor/rocketchat:lib';
import { Settings } from 'meteor/rocketchat:models';
import { settings } from 'meteor/rocketchat:settings';
import { Info } from 'meteor/rocketchat:utils';
import { getWorkspaceAccessToken } from 'meteor/rocketchat:cloud';
import { MongoInternals } from 'meteor/mongo';
export default () => {
try {
const uniqueID = RocketChat.models.Settings.findOne('uniqueID');
const uniqueID = Settings.findOne('uniqueID');
const { _oplogHandle } = MongoInternals.defaultRemoteCollectionDriver().mongo;
const oplogEnabled = _oplogHandle && _oplogHandle.onOplogEntry && RocketChat.settings.get('Force_Disable_OpLog_For_Cache') !== true;
const oplogEnabled = _oplogHandle && _oplogHandle.onOplogEntry && settings.get('Force_Disable_OpLog_For_Cache') !== true;
const data = {
uniqueId: uniqueID.value,
installedAt: uniqueID.createdAt,
version: RocketChat.Info.version,
version: Info.version,
oplogEnabled,
osType: os.type(),
osPlatform: os.platform(),

@ -1,5 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { Users } from 'meteor/rocketchat:models';
Meteor.methods({
'banner/dismiss'({ id }) {
@ -7,6 +7,6 @@ Meteor.methods({
throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'banner/dismiss' });
}
RocketChat.models.Users.setBannerReadById(this.userId, id);
Users.setBannerReadById(this.userId, id);
},
});

Loading…
Cancel
Save