Skip to content

Commit

Permalink
Remove dependency of RC namespace in rc-slash-kick, leave, me, msg, m…
Browse files Browse the repository at this point in the history
…ute, open, topic and unarchiveroom (#13357)

* 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-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
  • Loading branch information
MarcosSpessatto authored and rodrigok committed Feb 14, 2019
1 parent b7766b9 commit fae59fe
Show file tree
Hide file tree
Showing 22 changed files with 89 additions and 66 deletions.
4 changes: 4 additions & 0 deletions packages/rocketchat-models/server/models/Messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export class Messages extends Base {
return this.createWithTypeRoomIdMessageAndUser('room-archived', roomId, '', user);
}

createRoomUnarchivedByRoomIdAndUser(roomId, user) {
return this.createWithTypeRoomIdMessageAndUser('room-unarchived', roomId, '', user);
}

unsetReactions(messageId) {
return this.update({ _id: messageId }, { $unset: { reactions: 1 } });
}
Expand Down
4 changes: 2 additions & 2 deletions packages/rocketchat-slashcommands-kick/client/client.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RocketChat } from 'meteor/rocketchat:lib';
import { slashCommands } from 'meteor/rocketchat:utils';

RocketChat.slashCommands.add('kick', function(command, params) {
slashCommands.add('kick', function(command, params) {
const username = params.trim();
if (username === '') {
return;
Expand Down
4 changes: 3 additions & 1 deletion packages/rocketchat-slashcommands-kick/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ Package.onUse(function(api) {
api.use([
'ecmascript',
'check',
'rocketchat:lib',
'rocketchat:utils',
'rocketchat:notifications',
'rocketchat:models',
'templating',
]);
api.mainModule('client/index.js', 'client');
Expand Down
14 changes: 8 additions & 6 deletions packages/rocketchat-slashcommands-kick/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { Meteor } from 'meteor/meteor';
import { Match } from 'meteor/check';
import { Random } from 'meteor/random';
import { TAPi18n } from 'meteor/tap:i18n';
import { RocketChat } from 'meteor/rocketchat:lib';
import { Notifications } from 'meteor/rocketchat:notifications';
import { Users, Subscriptions } from 'meteor/rocketchat:models';
import { slashCommands } from 'meteor/rocketchat:utils';

const Kick = function(command, params, { rid }) {
if (command !== 'kick' || !Match.test(params, String)) {
Expand All @@ -16,10 +18,10 @@ const Kick = function(command, params, { rid }) {
}
const userId = Meteor.userId();
const user = Meteor.users.findOne(userId);
const kickedUser = RocketChat.models.Users.findOneByUsername(username);
const kickedUser = Users.findOneByUsername(username);

if (kickedUser == null) {
return RocketChat.Notifications.notifyUser(userId, 'message', {
return Notifications.notifyUser(userId, 'message', {
_id: Random.id(),
rid,
ts: new Date,
Expand All @@ -30,9 +32,9 @@ const Kick = function(command, params, { rid }) {
});
}

const subscription = RocketChat.models.Subscriptions.findOneByRoomIdAndUserId(rid, user._id, { fields: { _id: 1 } });
const subscription = Subscriptions.findOneByRoomIdAndUserId(rid, user._id, { fields: { _id: 1 } });
if (!subscription) {
return RocketChat.Notifications.notifyUser(userId, 'message', {
return Notifications.notifyUser(userId, 'message', {
_id: Random.id(),
rid,
ts: new Date,
Expand All @@ -45,7 +47,7 @@ const Kick = function(command, params, { rid }) {
Meteor.call('removeUserFromRoom', { rid, username });
};

RocketChat.slashCommands.add('kick', Kick, {
slashCommands.add('kick', Kick, {
description: 'Remove_someone_from_room',
params: '@username',
permission: 'remove-user',
Expand Down
3 changes: 2 additions & 1 deletion packages/rocketchat-slashcommands-leave/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Package.describe({
Package.onUse(function(api) {
api.use([
'ecmascript',
'rocketchat:lib',
'rocketchat:utils',
'rocketchat:notifications',
]);
api.mainModule('server/index.js', 'server');
});
9 changes: 5 additions & 4 deletions packages/rocketchat-slashcommands-leave/server/leave.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Meteor } from 'meteor/meteor';
import { Random } from 'meteor/random';
import { TAPi18n } from 'meteor/tap:i18n';
import { RocketChat } from 'meteor/rocketchat:lib';
import { Notifications } from 'meteor/rocketchat:notifications';
import { slashCommands } from 'meteor/rocketchat:utils';

/*
* Leave is a named function that will replace /leave commands
Expand All @@ -15,7 +16,7 @@ function Leave(command, params, item) {
try {
Meteor.call('leaveRoom', item.rid);
} catch ({ error }) {
RocketChat.Notifications.notifyUser(Meteor.userId(), 'message', {
Notifications.notifyUser(Meteor.userId(), 'message', {
_id: Random.id(),
rid: item.rid,
ts: new Date,
Expand All @@ -24,5 +25,5 @@ function Leave(command, params, item) {
}
}

RocketChat.slashCommands.add('leave', Leave, { description: 'Leave_the_current_channel' });
RocketChat.slashCommands.add('part', Leave, { description: 'Leave_the_current_channel' });
slashCommands.add('leave', Leave, { description: 'Leave_the_current_channel' });
slashCommands.add('part', Leave, { description: 'Leave_the_current_channel' });
2 changes: 1 addition & 1 deletion packages/rocketchat-slashcommands-me/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Package.describe({
Package.onUse(function(api) {
api.use([
'ecmascript',
'rocketchat:lib',
'rocketchat:utils',
]);
api.mainModule('server/index.js', 'server');
});
4 changes: 2 additions & 2 deletions packages/rocketchat-slashcommands-me/server/me.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { slashCommands } from 'meteor/rocketchat:utils';
import s from 'underscore.string';

/*
* Me is a named function that will replace /me commands
* @param {Object} message - The message object
*/
RocketChat.slashCommands.add('me', function Me(command, params, item) {
slashCommands.add('me', function Me(command, params, item) {
if (command !== 'me') {
return;
}
Expand Down
4 changes: 3 additions & 1 deletion packages/rocketchat-slashcommands-msg/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ Package.onUse(function(api) {
api.use([
'ecmascript',
'check',
'rocketchat:lib',
'rocketchat:utils',
'rocketchat:models',
'rocketchat:notifications',
'templating',
]);
api.mainModule('server/index.js', 'server');
Expand Down
12 changes: 7 additions & 5 deletions packages/rocketchat-slashcommands-msg/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { Meteor } from 'meteor/meteor';
import { Match } from 'meteor/check';
import { Random } from 'meteor/random';
import { TAPi18n } from 'meteor/tap:i18n';
import { RocketChat } from 'meteor/rocketchat:lib';
import { slashCommands } from 'meteor/rocketchat:utils';
import { Notifications } from 'meteor/rocketchat:notifications';
import { Users } from 'meteor/rocketchat:models';

/*
* Msg is a named function that will replace /msg commands
Expand All @@ -16,7 +18,7 @@ function Msg(command, params, item) {
const separator = trimmedParams.indexOf(' ');
const user = Meteor.users.findOne(Meteor.userId());
if (separator === -1) {
return RocketChat.Notifications.notifyUser(Meteor.userId(), 'message', {
return Notifications.notifyUser(Meteor.userId(), 'message', {
_id: Random.id(),
rid: item.rid,
ts: new Date,
Expand All @@ -26,9 +28,9 @@ function Msg(command, params, item) {
const message = trimmedParams.slice(separator + 1);
const targetUsernameOrig = trimmedParams.slice(0, separator);
const targetUsername = targetUsernameOrig.replace('@', '');
const targetUser = RocketChat.models.Users.findOneByUsername(targetUsername);
const targetUser = Users.findOneByUsername(targetUsername);
if (targetUser == null) {
RocketChat.Notifications.notifyUser(Meteor.userId(), 'message', {
Notifications.notifyUser(Meteor.userId(), 'message', {
_id: Random.id(),
rid: item.rid,
ts: new Date,
Expand All @@ -48,7 +50,7 @@ function Msg(command, params, item) {
Meteor.call('sendMessage', msgObject);
}

RocketChat.slashCommands.add('msg', Msg, {
slashCommands.add('msg', Msg, {
description: 'Direct_message_someone',
params: '@username <message>',
});
4 changes: 3 additions & 1 deletion packages/rocketchat-slashcommands-mute/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ Package.onUse(function(api) {
api.use([
'ecmascript',
'check',
'rocketchat:lib',
'rocketchat:utils',
'rocketchat:notifications',
'rocketchat:models',
]);
api.mainModule('server/index.js', 'server');
});
14 changes: 8 additions & 6 deletions packages/rocketchat-slashcommands-mute/server/mute.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import { Meteor } from 'meteor/meteor';
import { Match } from 'meteor/check';
import { Random } from 'meteor/random';
import { TAPi18n } from 'meteor/tap:i18n';
import { RocketChat } from 'meteor/rocketchat:lib';
import { slashCommands } from 'meteor/rocketchat:utils';
import { Users, Subscriptions } from 'meteor/rocketchat:models';
import { Notifications } from 'meteor/rocketchat:notifications';

/*
* Mute is a named function that will replace /mute commands
*/

RocketChat.slashCommands.add('mute', function Mute(command, params, item) {
slashCommands.add('mute', function Mute(command, params, item) {
if (command !== 'mute' || !Match.test(params, String)) {
return;
}
Expand All @@ -18,9 +20,9 @@ RocketChat.slashCommands.add('mute', function Mute(command, params, item) {
}
const userId = Meteor.userId();
const user = Meteor.users.findOne(userId);
const mutedUser = RocketChat.models.Users.findOneByUsername(username);
const mutedUser = Users.findOneByUsername(username);
if (mutedUser == null) {
RocketChat.Notifications.notifyUser(userId, 'message', {
Notifications.notifyUser(userId, 'message', {
_id: Random.id(),
rid: item.rid,
ts: new Date,
Expand All @@ -32,9 +34,9 @@ RocketChat.slashCommands.add('mute', function Mute(command, params, item) {
return;
}

const subscription = RocketChat.models.Subscriptions.findOneByRoomIdAndUserId(item.rid, mutedUser._id, { fields: { _id: 1 } });
const subscription = Subscriptions.findOneByRoomIdAndUserId(item.rid, mutedUser._id, { fields: { _id: 1 } });
if (!subscription) {
RocketChat.Notifications.notifyUser(userId, 'message', {
Notifications.notifyUser(userId, 'message', {
_id: Random.id(),
rid: item.rid,
ts: new Date,
Expand Down
14 changes: 8 additions & 6 deletions packages/rocketchat-slashcommands-mute/server/unmute.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import { Meteor } from 'meteor/meteor';
import { Match } from 'meteor/check';
import { Random } from 'meteor/random';
import { TAPi18n } from 'meteor/tap:i18n';
import { RocketChat } from 'meteor/rocketchat:lib';
import { slashCommands } from 'meteor/rocketchat:utils';
import { Users, Subscriptions } from 'meteor/rocketchat:models';
import { Notifications } from 'meteor/rocketchat:notifications';

/*
* Unmute is a named function that will replace /unmute commands
*/

RocketChat.slashCommands.add('unmute', function Unmute(command, params, item) {
slashCommands.add('unmute', function Unmute(command, params, item) {

if (command !== 'unmute' || !Match.test(params, String)) {
return;
Expand All @@ -18,9 +20,9 @@ RocketChat.slashCommands.add('unmute', function Unmute(command, params, item) {
return;
}
const user = Meteor.users.findOne(Meteor.userId());
const unmutedUser = RocketChat.models.Users.findOneByUsername(username);
const unmutedUser = Users.findOneByUsername(username);
if (unmutedUser == null) {
return RocketChat.Notifications.notifyUser(Meteor.userId(), 'message', {
return Notifications.notifyUser(Meteor.userId(), 'message', {
_id: Random.id(),
rid: item.rid,
ts: new Date,
Expand All @@ -31,9 +33,9 @@ RocketChat.slashCommands.add('unmute', function Unmute(command, params, item) {
});
}

const subscription = RocketChat.models.Subscriptions.findOneByRoomIdAndUserId(item.rid, unmutedUser._id, { fields: { _id: 1 } });
const subscription = Subscriptions.findOneByRoomIdAndUserId(item.rid, unmutedUser._id, { fields: { _id: 1 } });
if (!subscription) {
return RocketChat.Notifications.notifyUser(Meteor.userId(), 'message', {
return Notifications.notifyUser(Meteor.userId(), 'message', {
_id: Random.id(),
rid: item.rid,
ts: new Date,
Expand Down
12 changes: 6 additions & 6 deletions packages/rocketchat-slashcommands-open/client/client.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Meteor } from 'meteor/meteor';
import { Match } from 'meteor/check';
import { FlowRouter } from 'meteor/kadira:flow-router';
import { RocketChat } from 'meteor/rocketchat:lib';
import { ChatSubscription } from 'meteor/rocketchat:ui';
import { slashCommands, roomTypes } from 'meteor/rocketchat:utils';
import { ChatSubscription, Subscriptions } from 'meteor/rocketchat:models';

function Open(command, params /* , item*/) {
const dict = {
Expand Down Expand Up @@ -31,7 +31,7 @@ function Open(command, params /* , item*/) {
const subscription = ChatSubscription.findOne(query);

if (subscription) {
RocketChat.roomTypes.openRouteLink(subscription.t, subscription, FlowRouter.current().queryParams);
roomTypes.openRouteLink(subscription.t, subscription, FlowRouter.current().queryParams);
}

if (type && type.indexOf('d') === -1) {
Expand All @@ -41,13 +41,13 @@ function Open(command, params /* , item*/) {
if (err) {
return;
}
const subscription = RocketChat.models.Subscriptions.findOne(query);
RocketChat.roomTypes.openRouteLink(subscription.t, subscription, FlowRouter.current().queryParams);
const subscription = Subscriptions.findOne(query);
roomTypes.openRouteLink(subscription.t, subscription, FlowRouter.current().queryParams);
});

}

RocketChat.slashCommands.add('open', Open, {
slashCommands.add('open', Open, {
description: 'Opens_a_channel_group_or_direct_message',
params: 'room_name',
clientOnly: true,
Expand Down
3 changes: 2 additions & 1 deletion packages/rocketchat-slashcommands-open/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Package.onUse(function(api) {
api.use([
'ecmascript',
'check',
'rocketchat:lib',
'rocketchat:utils',
'rocketchat:models',
'kadira:flow-router',
'templating',
]);
Expand Down
12 changes: 7 additions & 5 deletions packages/rocketchat-slashcommands-topic/lib/topic.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat, handleError } from 'meteor/rocketchat:lib';
import { ChatRoom } from 'meteor/rocketchat:ui';
import { handleError, slashCommands } from 'meteor/rocketchat:utils';
import { ChatRoom } from 'meteor/rocketchat:models';
import { callbacks } from 'meteor/rocketchat:callbacks';
import { hasPermission } from 'meteor/rocketchat:authorization';
/*
* Join is a named function that will replace /topic commands
* @param {Object} message - The message object
*/

function Topic(command, params, item) {
if (command === 'topic') {
if ((Meteor.isClient && RocketChat.authz.hasPermission('edit-room', item.rid)) || (Meteor.isServer && RocketChat.authz.hasPermission(Meteor.userId(), 'edit-room', item.rid))) {
if ((Meteor.isClient && hasPermission('edit-room', item.rid)) || (Meteor.isServer && hasPermission(Meteor.userId(), 'edit-room', item.rid))) {
Meteor.call('saveRoomSettings', item.rid, 'roomTopic', params, (err) => {
if (err) {
if (Meteor.isClient) {
Expand All @@ -19,14 +21,14 @@ function Topic(command, params, item) {
}

if (Meteor.isClient) {
RocketChat.callbacks.run('roomTopicChanged', ChatRoom.findOne(item.rid));
callbacks.run('roomTopicChanged', ChatRoom.findOne(item.rid));
}
});
}
}
}

RocketChat.slashCommands.add('topic', Topic, {
slashCommands.add('topic', Topic, {
description: 'Slash_Topic_Description',
params: 'Slash_Topic_Params',
});
4 changes: 3 additions & 1 deletion packages/rocketchat-slashcommands-topic/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ Package.describe({

Package.onUse(function(api) {
api.use([
'rocketchat:lib',
'rocketchat:utils',
'rocketchat:models',
'rocketchat:callbacks',
'ecmascript',
'rocketchat:authorization',
]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RocketChat } from 'meteor/rocketchat:lib';
import { slashCommands } from 'meteor/rocketchat:utils';

RocketChat.slashCommands.add('unarchive', null, {
slashCommands.add('unarchive', null, {
description: 'Unarchive',
params: '#channel',
});
4 changes: 3 additions & 1 deletion packages/rocketchat-slashcommands-unarchiveroom/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ Package.onUse(function(api) {
api.use([
'ecmascript',
'check',
'rocketchat:lib',
'rocketchat:utils',
'rocketchat:models',
'rocketchat:notifications',
'templating',
]);
api.mainModule('client/index.js', 'client');
Expand Down
Loading

0 comments on commit fae59fe

Please sign in to comment.