Remove dependency of RC namespace in rc-wordpress, chatpal-search and irc (#13492)

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

* Import missed functions in rc-irc

* 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/13377/head^2
Rodrigo Nascimento 7 years ago committed by GitHub
parent 4b30dce974
commit f2fe654632
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      packages/chatpal-search/server/provider/index.js
  2. 4
      packages/rocketchat-irc/package.js
  3. 18
      packages/rocketchat-irc/server/irc-bridge/index.js
  4. 4
      packages/rocketchat-irc/server/irc-bridge/localHandlers/onCreateRoom.js
  5. 6
      packages/rocketchat-irc/server/irc-bridge/localHandlers/onCreateUser.js
  6. 6
      packages/rocketchat-irc/server/irc-bridge/localHandlers/onLogin.js
  7. 8
      packages/rocketchat-irc/server/irc-bridge/localHandlers/onSaveMessage.js
  8. 6
      packages/rocketchat-irc/server/irc-bridge/peerHandlers/disconnected.js
  9. 13
      packages/rocketchat-irc/server/irc-bridge/peerHandlers/joinedChannel.js
  10. 9
      packages/rocketchat-irc/server/irc-bridge/peerHandlers/leftChannel.js
  11. 6
      packages/rocketchat-irc/server/irc-bridge/peerHandlers/nickChanged.js
  12. 17
      packages/rocketchat-irc/server/irc-bridge/peerHandlers/sentMessage.js
  13. 6
      packages/rocketchat-irc/server/irc-bridge/peerHandlers/userRegistered.js
  14. 4
      packages/rocketchat-irc/server/irc-settings.js
  15. 18
      packages/rocketchat-irc/server/irc.js
  16. 18
      packages/rocketchat-irc/server/methods/resetIrcConnection.js
  17. 30
      packages/rocketchat-wordpress/lib/common.js
  18. 2
      packages/rocketchat-wordpress/package.js
  19. 4
      packages/rocketchat-wordpress/server/startup.js

@ -2,7 +2,7 @@ import { Meteor } from 'meteor/meteor';
import { HTTP } from 'meteor/http';
import ChatpalLogger from '../utils/logger';
import { Random } from 'meteor/random';
import { RocketChat } from 'meteor/rocketchat:lib';
import { Rooms, Messages } from 'meteor/rocketchat:models';
/**
* Enables HTTP functions on Chatpal Backend
@ -280,11 +280,11 @@ export default class Index {
* @private
*/
_existsDataOlderThan(date) {
return RocketChat.models.Messages.model.find({ ts:{ $lt: new Date(date) }, t:{ $exists:false } }, { limit:1 }).fetch().length > 0;
return Messages.model.find({ ts:{ $lt: new Date(date) }, t:{ $exists:false } }, { limit:1 }).fetch().length > 0;
}
_doesRoomCountDiffer() {
return RocketChat.models.Rooms.find({ t:{ $ne:'d' } }).count() !== this._backend.count('room');
return Rooms.find({ t:{ $ne:'d' } }).count() !== this._backend.count('room');
}
_doesUserCountDiffer() {
@ -311,7 +311,7 @@ export default class Index {
* @private
*/
_indexRooms() {
const cursor = RocketChat.models.Rooms.find({ t:{ $ne:'d' } });
const cursor = Rooms.find({ t:{ $ne:'d' } });
ChatpalLogger.debug(`Start indexing ${ cursor.count() } rooms`);
@ -327,7 +327,7 @@ export default class Index {
const start = new Date(date - gap);
const end = new Date(date);
const cursor = RocketChat.models.Messages.model.find({ ts:{ $gt: start, $lt: end }, t:{ $exists:false } });
const cursor = Messages.model.find({ ts:{ $gt: start, $lt: end }, t:{ $exists:false } });
ChatpalLogger.debug(`Start indexing ${ cursor.count() } messages between ${ start.toString() } and ${ end.toString() }`);

@ -11,7 +11,9 @@ Package.onUse(function(api) {
'underscore',
'rocketchat:utils',
'rocketchat:lib',
'rocketchat:ui',
'rocketchat:callbacks',
'rocketchat:settings',
'rocketchat:models',
]);
api.mainModule('server/index.js', 'server');
});

@ -1,4 +1,4 @@
import { RocketChat } from 'meteor/rocketchat:lib';
import { callbacks } from 'meteor/rocketchat:callbacks';
import Queue from 'queue-fifo';
import * as servers from '../servers';
import * as peerCommandHandlers from './peerHandlers';
@ -117,18 +117,18 @@ class Bridge {
*/
setupLocalHandlers() {
// Auth
RocketChat.callbacks.add('afterValidateLogin', this.onMessageReceived.bind(this, 'local', 'onLogin'), RocketChat.callbacks.priority.LOW, 'irc-on-login');
RocketChat.callbacks.add('afterCreateUser', this.onMessageReceived.bind(this, 'local', 'onCreateUser'), RocketChat.callbacks.priority.LOW, 'irc-on-create-user');
callbacks.add('afterValidateLogin', this.onMessageReceived.bind(this, 'local', 'onLogin'), callbacks.priority.LOW, 'irc-on-login');
callbacks.add('afterCreateUser', this.onMessageReceived.bind(this, 'local', 'onCreateUser'), callbacks.priority.LOW, 'irc-on-create-user');
// Joining rooms or channels
RocketChat.callbacks.add('afterCreateChannel', this.onMessageReceived.bind(this, 'local', 'onCreateRoom'), RocketChat.callbacks.priority.LOW, 'irc-on-create-channel');
RocketChat.callbacks.add('afterCreateRoom', this.onMessageReceived.bind(this, 'local', 'onCreateRoom'), RocketChat.callbacks.priority.LOW, 'irc-on-create-room');
RocketChat.callbacks.add('afterJoinRoom', this.onMessageReceived.bind(this, 'local', 'onJoinRoom'), RocketChat.callbacks.priority.LOW, 'irc-on-join-room');
callbacks.add('afterCreateChannel', this.onMessageReceived.bind(this, 'local', 'onCreateRoom'), callbacks.priority.LOW, 'irc-on-create-channel');
callbacks.add('afterCreateRoom', this.onMessageReceived.bind(this, 'local', 'onCreateRoom'), callbacks.priority.LOW, 'irc-on-create-room');
callbacks.add('afterJoinRoom', this.onMessageReceived.bind(this, 'local', 'onJoinRoom'), callbacks.priority.LOW, 'irc-on-join-room');
// Leaving rooms or channels
RocketChat.callbacks.add('afterLeaveRoom', this.onMessageReceived.bind(this, 'local', 'onLeaveRoom'), RocketChat.callbacks.priority.LOW, 'irc-on-leave-room');
callbacks.add('afterLeaveRoom', this.onMessageReceived.bind(this, 'local', 'onLeaveRoom'), callbacks.priority.LOW, 'irc-on-leave-room');
// Chatting
RocketChat.callbacks.add('afterSaveMessage', this.onMessageReceived.bind(this, 'local', 'onSaveMessage'), RocketChat.callbacks.priority.LOW, 'irc-on-save-message');
callbacks.add('afterSaveMessage', this.onMessageReceived.bind(this, 'local', 'onSaveMessage'), callbacks.priority.LOW, 'irc-on-save-message');
// Leaving
RocketChat.callbacks.add('afterLogoutCleanUp', this.onMessageReceived.bind(this, 'local', 'onLogout'), RocketChat.callbacks.priority.LOW, 'irc-on-logout');
callbacks.add('afterLogoutCleanUp', this.onMessageReceived.bind(this, 'local', 'onLogout'), callbacks.priority.LOW, 'irc-on-logout');
}
sendCommand(command, parameters) {

@ -1,7 +1,7 @@
import { RocketChat } from 'meteor/rocketchat:lib';
import { Users } from 'meteor/rocketchat:models';
export default function handleOnCreateRoom(user, room) {
const users = RocketChat.models.Users.findByRoomId(room._id);
const users = Users.findByRoomId(room._id);
users.forEach((user) => {
if (user.profile.irc.fromIRC) {

@ -1,5 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { Users, Rooms } from 'meteor/rocketchat:models';
export default function handleOnCreateUser(newUser) {
if (!newUser) {
@ -23,13 +23,13 @@ export default function handleOnCreateUser(newUser) {
},
});
const user = RocketChat.models.Users.findOne({
const user = Users.findOne({
_id: newUser._id,
});
this.sendCommand('registerUser', user);
const rooms = RocketChat.models.Rooms.findBySubscriptionUserId(user._id).fetch();
const rooms = Rooms.findBySubscriptionUserId(user._id).fetch();
rooms.forEach((room) => this.sendCommand('joinedChannel', { room, user }));
}

@ -1,5 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { Users, Rooms } from 'meteor/rocketchat:models';
export default function handleOnLogin(login) {
if (login.user === null) {
@ -23,13 +23,13 @@ export default function handleOnLogin(login) {
},
});
const user = RocketChat.models.Users.findOne({
const user = Users.findOne({
_id: login.user._id,
});
this.sendCommand('registerUser', user);
const rooms = RocketChat.models.Rooms.findBySubscriptionUserId(user._id).fetch();
const rooms = Rooms.findBySubscriptionUserId(user._id).fetch();
rooms.forEach((room) => this.sendCommand('joinedChannel', { room, user }));
}

@ -1,13 +1,13 @@
import { RocketChat } from 'meteor/rocketchat:lib';
import { Subscriptions, Users } from 'meteor/rocketchat:models';
export default function handleOnSaveMessage(message, to) {
let toIdentification = '';
// Direct message
if (to.t === 'd') {
const subscriptions = RocketChat.models.Subscriptions.findByRoomId(to._id);
const subscriptions = Subscriptions.findByRoomId(to._id);
subscriptions.forEach((subscription) => {
if (subscription.u.username !== to.username) {
const userData = RocketChat.models.Users.findOne({ username: subscription.u.username });
const userData = Users.findOne({ username: subscription.u.username });
if (userData) {
if (userData.profile && userData.profile.irc && userData.profile.irc.nick) {
toIdentification = userData.profile.irc.nick;
@ -28,7 +28,7 @@ export default function handleOnSaveMessage(message, to) {
toIdentification = `#${ to.name }`;
}
const user = RocketChat.models.Users.findOne({ _id: message.u._id });
const user = Users.findOne({ _id: message.u._id });
this.sendCommand('sentMessage', { to: toIdentification, user, message: message.msg });
}

@ -1,8 +1,8 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { Users, Rooms } from 'meteor/rocketchat:models';
export default function handleQUIT(args) {
const user = RocketChat.models.Users.findOne({
const user = Users.findOne({
'profile.irc.nick': args.nick,
});
@ -12,5 +12,5 @@ export default function handleQUIT(args) {
},
});
RocketChat.models.Rooms.removeUsernameFromAll(user.username);
Rooms.removeUsernameFromAll(user.username);
}

@ -1,7 +1,8 @@
import { RocketChat } from 'meteor/rocketchat:lib';
import { Users, Rooms } from 'meteor/rocketchat:models';
import { createRoom, addUserToRoom } from 'meteor/rocketchat:lib';
export default function handleJoinedChannel(args) {
const user = RocketChat.models.Users.findOne({
const user = Users.findOne({
'profile.irc.nick': args.nick,
});
@ -9,15 +10,15 @@ export default function handleJoinedChannel(args) {
throw new Error(`Could not find a user with nick ${ args.nick }`);
}
let room = RocketChat.models.Rooms.findOneByName(args.roomName);
let room = Rooms.findOneByName(args.roomName);
if (!room) {
const createdRoom = RocketChat.createRoom('c', args.roomName, user.username, []);
room = RocketChat.models.Rooms.findOne({ _id: createdRoom.rid });
const createdRoom = createRoom('c', args.roomName, user.username, []);
room = Rooms.findOne({ _id: createdRoom.rid });
this.log(`${ user.username } created room ${ args.roomName }`);
} else {
RocketChat.addUserToRoom(room._id, user);
addUserToRoom(room._id, user);
this.log(`${ user.username } joined room ${ room.name }`);
}

@ -1,7 +1,8 @@
import { RocketChat } from 'meteor/rocketchat:lib';
import { Users, Rooms } from 'meteor/rocketchat:models';
import { removeUserFromRoom } from 'meteor/rocketchat:lib';
export default function handleLeftChannel(args) {
const user = RocketChat.models.Users.findOne({
const user = Users.findOne({
'profile.irc.nick': args.nick,
});
@ -9,12 +10,12 @@ export default function handleLeftChannel(args) {
throw new Error(`Could not find a user with nick ${ args.nick }`);
}
const room = RocketChat.models.Rooms.findOneByName(args.roomName);
const room = Rooms.findOneByName(args.roomName);
if (!room) {
throw new Error(`Could not find a room with name ${ args.roomName }`);
}
this.log(`${ user.username } left room ${ room.name }`);
RocketChat.removeUserFromRoom(room._id, user);
removeUserFromRoom(room._id, user);
}

@ -1,7 +1,7 @@
import { RocketChat } from 'meteor/rocketchat:lib';
import { Users } from 'meteor/rocketchat:models';
export default function handleNickChanged(args) {
const user = RocketChat.models.Users.findOne({
const user = Users.findOne({
'profile.irc.nick': args.nick,
});
@ -12,7 +12,7 @@ export default function handleNickChanged(args) {
this.log(`${ user.username } changed nick: ${ args.nick } -> ${ args.newNick }`);
// Update on the database
RocketChat.models.Users.update({ _id: user._id }, {
Users.update({ _id: user._id }, {
$set: {
name: args.newNick,
'profile.irc.nick': args.newNick,

@ -1,4 +1,5 @@
import { RocketChat } from 'meteor/rocketchat:lib';
import { Users, Rooms, Subscriptions } from 'meteor/rocketchat:models';
import { sendMessage } from 'meteor/rocketchat:lib';
/*
*
* Get direct chat room helper
@ -8,7 +9,7 @@ import { RocketChat } from 'meteor/rocketchat:lib';
const getDirectRoom = (source, target) => {
const rid = [source._id, target._id].sort().join('');
RocketChat.models.Rooms.upsert({ _id: rid }, {
Rooms.upsert({ _id: rid }, {
$setOnInsert: {
t: 'd',
msgs: 0,
@ -16,7 +17,7 @@ const getDirectRoom = (source, target) => {
},
});
RocketChat.models.Subscriptions.upsert({ rid, 'u._id': target._id }, {
Subscriptions.upsert({ rid, 'u._id': target._id }, {
$setOnInsert: {
name: source.username,
t: 'd',
@ -30,7 +31,7 @@ const getDirectRoom = (source, target) => {
},
});
RocketChat.models.Subscriptions.upsert({ rid, 'u._id': source._id }, {
Subscriptions.upsert({ rid, 'u._id': source._id }, {
$setOnInsert: {
name: target.username,
t: 'd',
@ -51,7 +52,7 @@ const getDirectRoom = (source, target) => {
};
export default function handleSentMessage(args) {
const user = RocketChat.models.Users.findOne({
const user = Users.findOne({
'profile.irc.nick': args.nick,
});
@ -62,9 +63,9 @@ export default function handleSentMessage(args) {
let room;
if (args.roomName) {
room = RocketChat.models.Rooms.findOneByName(args.roomName);
room = Rooms.findOneByName(args.roomName);
} else {
const recipientUser = RocketChat.models.Users.findOne({
const recipientUser = Users.findOne({
'profile.irc.nick': args.recipientNick,
});
@ -76,5 +77,5 @@ export default function handleSentMessage(args) {
ts: new Date(),
};
RocketChat.sendMessage(user, message, room);
sendMessage(user, message, room);
}

@ -1,9 +1,9 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { Users } from 'meteor/rocketchat:models';
export default async function handleUserRegistered(args) {
// Check if there is an user with the given username
let user = RocketChat.models.Users.findOne({
let user = Users.findOne({
'profile.irc.username': args.username,
});
@ -28,7 +28,7 @@ export default async function handleUserRegistered(args) {
},
};
user = RocketChat.models.Users.create(userToInsert);
user = Users.create(userToInsert);
} else {
// ...otherwise, log the user in and update the information
this.log(`Logging in ${ args.username } with nick: ${ args.nick }`);

@ -1,8 +1,8 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { settings } from 'meteor/rocketchat:settings';
Meteor.startup(function() {
RocketChat.settings.addGroup('IRC_Federation', function() {
settings.addGroup('IRC_Federation', function() {
this.add('IRC_Enabled', false, {
type: 'boolean',
i18nLabel: 'Enabled',

@ -1,20 +1,20 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { settings } from 'meteor/rocketchat:settings';
import Bridge from './irc-bridge';
if (!!RocketChat.settings.get('IRC_Enabled') === true) {
if (!!settings.get('IRC_Enabled') === true) {
// Normalize the config values
const config = {
server: {
protocol: RocketChat.settings.get('IRC_Protocol'),
host: RocketChat.settings.get('IRC_Host'),
port: RocketChat.settings.get('IRC_Port'),
name: RocketChat.settings.get('IRC_Name'),
description: RocketChat.settings.get('IRC_Description'),
protocol: settings.get('IRC_Protocol'),
host: settings.get('IRC_Host'),
port: settings.get('IRC_Port'),
name: settings.get('IRC_Name'),
description: settings.get('IRC_Description'),
},
passwords: {
local: RocketChat.settings.get('IRC_Local_Password'),
peer: RocketChat.settings.get('IRC_Peer_Password'),
local: settings.get('IRC_Local_Password'),
peer: settings.get('IRC_Peer_Password'),
},
};

@ -1,11 +1,11 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { settings } from 'meteor/rocketchat:settings';
import { t } from 'meteor/rocketchat:utils';
import Bridge from '../irc-bridge';
Meteor.methods({
resetIrcConnection() {
const ircEnabled = (!!RocketChat.settings.get('IRC_Enabled')) === true;
const ircEnabled = (!!settings.get('IRC_Enabled')) === true;
if (Meteor.ircBridge) {
Meteor.ircBridge.stop();
@ -29,15 +29,15 @@ Meteor.methods({
// Normalize the config values
const config = {
server: {
protocol: RocketChat.settings.get('IRC_Protocol'),
host: RocketChat.settings.get('IRC_Host'),
port: RocketChat.settings.get('IRC_Port'),
name: RocketChat.settings.get('IRC_Name'),
description: RocketChat.settings.get('IRC_Description'),
protocol: settings.get('IRC_Protocol'),
host: settings.get('IRC_Host'),
port: settings.get('IRC_Port'),
name: settings.get('IRC_Name'),
description: settings.get('IRC_Description'),
},
passwords: {
local: RocketChat.settings.get('IRC_Local_Password'),
peer: RocketChat.settings.get('IRC_Peer_Password'),
local: settings.get('IRC_Local_Password'),
peer: settings.get('IRC_Peer_Password'),
},
};

@ -1,6 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';
import { RocketChat } from 'meteor/rocketchat:lib';
import { settings } from 'meteor/rocketchat:settings';
import { ServiceConfiguration } from 'meteor/service-configuration';
import { CustomOAuth } from 'meteor/rocketchat:custom-oauth';
import _ from 'underscore';
@ -18,7 +18,7 @@ const config = {
const WordPress = new CustomOAuth('wordpress', config);
const fillSettings = _.debounce(Meteor.bindEnvironment(() => {
config.serverURL = RocketChat.settings.get('API_Wordpress_URL');
config.serverURL = settings.get('API_Wordpress_URL');
if (!config.serverURL) {
if (config.serverURL === undefined) {
return fillSettings();
@ -32,27 +32,27 @@ const fillSettings = _.debounce(Meteor.bindEnvironment(() => {
delete config.tokenPath;
delete config.scope;
const serverType = RocketChat.settings.get('Accounts_OAuth_Wordpress_server_type');
const serverType = settings.get('Accounts_OAuth_Wordpress_server_type');
switch (serverType) {
case 'custom':
if (RocketChat.settings.get('Accounts_OAuth_Wordpress_identity_path')) {
config.identityPath = RocketChat.settings.get('Accounts_OAuth_Wordpress_identity_path');
if (settings.get('Accounts_OAuth_Wordpress_identity_path')) {
config.identityPath = settings.get('Accounts_OAuth_Wordpress_identity_path');
}
if (RocketChat.settings.get('Accounts_OAuth_Wordpress_identity_token_sent_via')) {
config.identityTokenSentVia = RocketChat.settings.get('Accounts_OAuth_Wordpress_identity_token_sent_via');
if (settings.get('Accounts_OAuth_Wordpress_identity_token_sent_via')) {
config.identityTokenSentVia = settings.get('Accounts_OAuth_Wordpress_identity_token_sent_via');
}
if (RocketChat.settings.get('Accounts_OAuth_Wordpress_token_path')) {
config.tokenPath = RocketChat.settings.get('Accounts_OAuth_Wordpress_token_path');
if (settings.get('Accounts_OAuth_Wordpress_token_path')) {
config.tokenPath = settings.get('Accounts_OAuth_Wordpress_token_path');
}
if (RocketChat.settings.get('Accounts_OAuth_Wordpress_authorize_path')) {
config.authorizePath = RocketChat.settings.get('Accounts_OAuth_Wordpress_authorize_path');
if (settings.get('Accounts_OAuth_Wordpress_authorize_path')) {
config.authorizePath = settings.get('Accounts_OAuth_Wordpress_authorize_path');
}
if (RocketChat.settings.get('Accounts_OAuth_Wordpress_scope')) {
config.scope = RocketChat.settings.get('Accounts_OAuth_Wordpress_scope');
if (settings.get('Accounts_OAuth_Wordpress_scope')) {
config.scope = settings.get('Accounts_OAuth_Wordpress_scope');
}
break;
case 'wordpress-com':
@ -69,7 +69,7 @@ const fillSettings = _.debounce(Meteor.bindEnvironment(() => {
const result = WordPress.configure(config);
if (Meteor.isServer) {
const enabled = RocketChat.settings.get('Accounts_OAuth_Wordpress');
const enabled = settings.get('Accounts_OAuth_Wordpress');
if (enabled) {
ServiceConfiguration.configurations.upsert({
service: 'wordpress',
@ -88,7 +88,7 @@ const fillSettings = _.debounce(Meteor.bindEnvironment(() => {
if (Meteor.isServer) {
Meteor.startup(function() {
return RocketChat.settings.get(/(API\_Wordpress\_URL)?(Accounts\_OAuth\_Wordpress\_)?/, () => fillSettings());
return settings.get(/(API\_Wordpress\_URL)?(Accounts\_OAuth\_Wordpress\_)?/, () => fillSettings());
});
} else {
Meteor.startup(function() {

@ -7,7 +7,7 @@ Package.describe({
Package.onUse(function(api) {
api.use([
'ecmascript',
'rocketchat:lib',
'rocketchat:settings',
'rocketchat:custom-oauth',
'templating',
]);

@ -1,6 +1,6 @@
import { RocketChat } from 'meteor/rocketchat:lib';
import { settings } from 'meteor/rocketchat:settings';
RocketChat.settings.addGroup('OAuth', function() {
settings.addGroup('OAuth', function() {
return this.section('WordPress', function() {
const enableQuery = {

Loading…
Cancel
Save