From 88e9cfd59400478d484b9cf30f21d07440a15962 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Tue, 6 Jun 2017 17:27:36 -0700 Subject: [PATCH 01/78] Fix mobile avatars (#7177) --- server/startup/avatar.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/startup/avatar.js b/server/startup/avatar.js index 0fa118f685e1..6c1bcab47b67 100644 --- a/server/startup/avatar.js +++ b/server/startup/avatar.js @@ -18,6 +18,8 @@ Meteor.startup(function() { let username = decodeURIComponent(match[1]); let file; + username = username.replace(/\.jpg$/, ''); + if (username[0] !== '@') { if (Meteor.settings && Meteor.settings.public && Meteor.settings.public.sandstorm) { const user = RocketChat.models.Users.findOneByUsername(username); From 178febe882a5d0e6a843203dfa3f3360b0004197 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Wed, 7 Jun 2017 17:24:48 -0300 Subject: [PATCH 02/78] Fix i18n issue with compound language name closes #7129 --- packages/rocketchat-ui-account/client/accountPreferences.js | 4 ++-- server/methods/loadLocale.js | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/rocketchat-ui-account/client/accountPreferences.js b/packages/rocketchat-ui-account/client/accountPreferences.js index bfd096e5f0df..d86d2cef6ada 100644 --- a/packages/rocketchat-ui-account/client/accountPreferences.js +++ b/packages/rocketchat-ui-account/client/accountPreferences.js @@ -26,9 +26,9 @@ Template.accountPreferences.helpers({ const user = Meteor.user(); let result = undefined; if (user.language) { - result = user.language.split('-').shift().toLowerCase() === key; + result = user.language === key; } else if (defaultUserLanguage()) { - result = defaultUserLanguage().split('-').shift().toLowerCase() === key; + result = defaultUserLanguage() === key; } return result; }, diff --git a/server/methods/loadLocale.js b/server/methods/loadLocale.js index 22f878668d64..2aea941599a7 100644 --- a/server/methods/loadLocale.js +++ b/server/methods/loadLocale.js @@ -5,7 +5,11 @@ Meteor.methods({ try { return Assets.getText(`moment-locales/${ locale.toLowerCase() }.js`); } catch (error) { - return console.log(error); + try { + return Assets.getText(`moment-locales/${ locale.split('-').shift().toLowerCase() }.js`); + } catch (error) { + return console.log(error); + } } } }); From e85109ac75cb48e8847e7c48cc3a376733d15a7b Mon Sep 17 00:00:00 2001 From: Aaron Ogle Date: Fri, 2 Jun 2017 19:45:49 -0500 Subject: [PATCH 03/78] Fix migration version --- server/startup/migrations/v097.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/startup/migrations/v097.js b/server/startup/migrations/v097.js index a6554a37575f..4f3795b512a1 100644 --- a/server/startup/migrations/v097.js +++ b/server/startup/migrations/v097.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; RocketChat.Migrations.add({ - version: 96, + version: 97, up() { const query = { $or: [{ From 5bcdcfd42d43745257465a03020764c6f9628914 Mon Sep 17 00:00:00 2001 From: John Szaszvari Date: Sun, 4 Jun 2017 00:55:40 +1000 Subject: [PATCH 04/78] Removing the kadira package install on build kadira is dead / shut down now --- example-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example-build.sh b/example-build.sh index c7ce49820342..06ac62461246 100755 --- a/example-build.sh +++ b/example-build.sh @@ -5,7 +5,7 @@ IFS=$'\n\t' # Build export NODE_ENV=production -meteor add rocketchat:internal-hubot meteorhacks:kadira +meteor add rocketchat:internal-hubot meteor build --server https://demo.rocket.chat --directory /var/www/rocket.chat # Run From a9a830b5565668d59aeb6274a4094314c00c87b0 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Thu, 8 Jun 2017 12:43:25 -0300 Subject: [PATCH 05/78] Fixes emoji titles translations and a hardcoded string --- .../rocketchat-2fa/client/accountSecurity.html | 2 +- .../client/lib/emojiCustom.js | 2 +- .../rocketchat-emoji-emojione/emojiPicker.js | 16 ++++++++-------- packages/rocketchat-emoji/emojiPicker.js | 3 ++- packages/rocketchat-emoji/rocketchat.js | 2 +- packages/rocketchat-i18n/i18n/en.i18n.json | 1 + 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/packages/rocketchat-2fa/client/accountSecurity.html b/packages/rocketchat-2fa/client/accountSecurity.html index 9ed51e09d061..ad8d6a1f231a 100644 --- a/packages/rocketchat-2fa/client/accountSecurity.html +++ b/packages/rocketchat-2fa/client/accountSecurity.html @@ -14,7 +14,7 @@

{{_ "Two-factor_authentication"}}

- WARNING: Once you enable this, you will not be able to login on the native mobile apps (Rocket.Chat+) using your password until they implement the 2FA. + {{_ "Two-factor_authentication_native_mobile_app_warning"}}
{{#if isEnabled}} diff --git a/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js b/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js index ca4f9f6bccd8..50bc7d342fff 100644 --- a/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js +++ b/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js @@ -1,6 +1,6 @@ /* globals getEmojiUrlFromName:true, updateEmojiCustom:true, deleteEmojiCustom:true, isSetNotNull */ RocketChat.emoji.packages.emojiCustom = { - emojiCategories: { rocket: TAPi18n.__('Custom') }, + emojiCategories: { rocket: 'Custom' }, toneList: {}, list: [], diff --git a/packages/rocketchat-emoji-emojione/emojiPicker.js b/packages/rocketchat-emoji-emojione/emojiPicker.js index 6a7a2dab3c32..f3f5b27df048 100644 --- a/packages/rocketchat-emoji-emojione/emojiPicker.js +++ b/packages/rocketchat-emoji-emojione/emojiPicker.js @@ -4,14 +4,14 @@ * Mapping category hashes into human readable and translated names */ emojiCategories = { - people: TAPi18n.__('Smileys_and_People'), - nature: TAPi18n.__('Animals_and_Nature'), - food: TAPi18n.__('Food_and_Drink'), - activity: TAPi18n.__('Activity'), - travel: TAPi18n.__('Travel_and_Places'), - objects: TAPi18n.__('Objects'), - symbols: TAPi18n.__('Symbols'), - flags: TAPi18n.__('Flags') + people: 'Smileys_and_People', + nature: 'Animals_and_Nature', + food: 'Food_and_Drink', + activity: 'Activity', + travel: 'Travel_and_Places', + objects: 'Objects', + symbols: 'Symbols', + flags: 'Flags' }; toneList = { diff --git a/packages/rocketchat-emoji/emojiPicker.js b/packages/rocketchat-emoji/emojiPicker.js index 5b618d3f52ea..2c344d627760 100644 --- a/packages/rocketchat-emoji/emojiPicker.js +++ b/packages/rocketchat-emoji/emojiPicker.js @@ -9,7 +9,8 @@ function categoryName(category) { for (const emojiPackage in RocketChat.emoji.packages) { if (RocketChat.emoji.packages.hasOwnProperty(emojiPackage)) { if (RocketChat.emoji.packages[emojiPackage].emojiCategories.hasOwnProperty(category)) { - return RocketChat.emoji.packages[emojiPackage].emojiCategories[category]; + const categoryTag = RocketChat.emoji.packages[emojiPackage].emojiCategories[category]; + return TAPi18n.__(categoryTag); } } } diff --git a/packages/rocketchat-emoji/rocketchat.js b/packages/rocketchat-emoji/rocketchat.js index 878ae629f053..33a4e0d2cb81 100644 --- a/packages/rocketchat-emoji/rocketchat.js +++ b/packages/rocketchat-emoji/rocketchat.js @@ -1,7 +1,7 @@ RocketChat.emoji = { packages: { base: { - emojiCategories: { recent: TAPi18n.__('Frequently_Used') }, + emojiCategories: { recent: 'Frequently_Used' }, emojisByCategory: { recent: [] }, diff --git a/packages/rocketchat-i18n/i18n/en.i18n.json b/packages/rocketchat-i18n/i18n/en.i18n.json index 1b2888536b9a..3144d1b8e171 100644 --- a/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/packages/rocketchat-i18n/i18n/en.i18n.json @@ -1523,6 +1523,7 @@ "Two-factor_authentication_disabled": "Two-factor authentication disabled", "Two-factor_authentication_enabled": "Two-factor authentication enabled", "Two-factor_authentication_is_currently_disabled": "Two-factor authentication is currently disabled", + "Two-factor_authentication_native_mobile_app_warning" : "WARNING: Once you enable this, you will not be able to login on the native mobile apps (Rocket.Chat+) using your password until they implement the 2FA.", "Thursday": "Thursday", "Time_in_seconds": "Time in seconds", "Title": "Title", From f885e2cda09d75a0a506886f939b0c6f6d21b7ed Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Thu, 8 Jun 2017 12:58:58 -0300 Subject: [PATCH 06/78] fix wrong commit --- .../rocketchat-2fa/client/accountSecurity.html | 2 +- .../client/lib/emojiCustom.js | 2 +- .../rocketchat-emoji-emojione/emojiPicker.js | 16 ++++++++-------- packages/rocketchat-emoji/emojiPicker.js | 3 +-- packages/rocketchat-emoji/rocketchat.js | 2 +- packages/rocketchat-i18n/i18n/en.i18n.json | 1 - 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/packages/rocketchat-2fa/client/accountSecurity.html b/packages/rocketchat-2fa/client/accountSecurity.html index ad8d6a1f231a..9ed51e09d061 100644 --- a/packages/rocketchat-2fa/client/accountSecurity.html +++ b/packages/rocketchat-2fa/client/accountSecurity.html @@ -14,7 +14,7 @@

{{_ "Two-factor_authentication"}}

- {{_ "Two-factor_authentication_native_mobile_app_warning"}} + WARNING: Once you enable this, you will not be able to login on the native mobile apps (Rocket.Chat+) using your password until they implement the 2FA.
{{#if isEnabled}} diff --git a/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js b/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js index 50bc7d342fff..ca4f9f6bccd8 100644 --- a/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js +++ b/packages/rocketchat-emoji-custom/client/lib/emojiCustom.js @@ -1,6 +1,6 @@ /* globals getEmojiUrlFromName:true, updateEmojiCustom:true, deleteEmojiCustom:true, isSetNotNull */ RocketChat.emoji.packages.emojiCustom = { - emojiCategories: { rocket: 'Custom' }, + emojiCategories: { rocket: TAPi18n.__('Custom') }, toneList: {}, list: [], diff --git a/packages/rocketchat-emoji-emojione/emojiPicker.js b/packages/rocketchat-emoji-emojione/emojiPicker.js index f3f5b27df048..6a7a2dab3c32 100644 --- a/packages/rocketchat-emoji-emojione/emojiPicker.js +++ b/packages/rocketchat-emoji-emojione/emojiPicker.js @@ -4,14 +4,14 @@ * Mapping category hashes into human readable and translated names */ emojiCategories = { - people: 'Smileys_and_People', - nature: 'Animals_and_Nature', - food: 'Food_and_Drink', - activity: 'Activity', - travel: 'Travel_and_Places', - objects: 'Objects', - symbols: 'Symbols', - flags: 'Flags' + people: TAPi18n.__('Smileys_and_People'), + nature: TAPi18n.__('Animals_and_Nature'), + food: TAPi18n.__('Food_and_Drink'), + activity: TAPi18n.__('Activity'), + travel: TAPi18n.__('Travel_and_Places'), + objects: TAPi18n.__('Objects'), + symbols: TAPi18n.__('Symbols'), + flags: TAPi18n.__('Flags') }; toneList = { diff --git a/packages/rocketchat-emoji/emojiPicker.js b/packages/rocketchat-emoji/emojiPicker.js index 2c344d627760..5b618d3f52ea 100644 --- a/packages/rocketchat-emoji/emojiPicker.js +++ b/packages/rocketchat-emoji/emojiPicker.js @@ -9,8 +9,7 @@ function categoryName(category) { for (const emojiPackage in RocketChat.emoji.packages) { if (RocketChat.emoji.packages.hasOwnProperty(emojiPackage)) { if (RocketChat.emoji.packages[emojiPackage].emojiCategories.hasOwnProperty(category)) { - const categoryTag = RocketChat.emoji.packages[emojiPackage].emojiCategories[category]; - return TAPi18n.__(categoryTag); + return RocketChat.emoji.packages[emojiPackage].emojiCategories[category]; } } } diff --git a/packages/rocketchat-emoji/rocketchat.js b/packages/rocketchat-emoji/rocketchat.js index 33a4e0d2cb81..878ae629f053 100644 --- a/packages/rocketchat-emoji/rocketchat.js +++ b/packages/rocketchat-emoji/rocketchat.js @@ -1,7 +1,7 @@ RocketChat.emoji = { packages: { base: { - emojiCategories: { recent: 'Frequently_Used' }, + emojiCategories: { recent: TAPi18n.__('Frequently_Used') }, emojisByCategory: { recent: [] }, diff --git a/packages/rocketchat-i18n/i18n/en.i18n.json b/packages/rocketchat-i18n/i18n/en.i18n.json index 3144d1b8e171..1b2888536b9a 100644 --- a/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/packages/rocketchat-i18n/i18n/en.i18n.json @@ -1523,7 +1523,6 @@ "Two-factor_authentication_disabled": "Two-factor authentication disabled", "Two-factor_authentication_enabled": "Two-factor authentication enabled", "Two-factor_authentication_is_currently_disabled": "Two-factor authentication is currently disabled", - "Two-factor_authentication_native_mobile_app_warning" : "WARNING: Once you enable this, you will not be able to login on the native mobile apps (Rocket.Chat+) using your password until they implement the 2FA.", "Thursday": "Thursday", "Time_in_seconds": "Time in seconds", "Title": "Title", From b66e1bc8d21f271adc501f973a994b6a4ee1a820 Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Thu, 8 Jun 2017 11:45:45 -0500 Subject: [PATCH 07/78] Fix the admin oauthApps view not working due to converting to js from coffee (#7196) --- .../admin/client/views/oauthApps.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApps.js b/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApps.js index 00b72fa4fe3e..ddc3ce6c1539 100644 --- a/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApps.js +++ b/packages/rocketchat-oauth2-server-config/admin/client/views/oauthApps.js @@ -1,7 +1,9 @@ /* globals ChatOAuthApps */ import moment from 'moment'; -Template.oauthApps.onCreated(() => this.subscribe('oauthApps')); +Template.oauthApps.onCreated(function() { + this.subscribe('oauthApps'); +}); Template.oauthApps.helpers({ hasPermission() { From 63baef9dd92865b0f05df770b022551d02dbd0c9 Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Fri, 9 Jun 2017 22:34:10 -0500 Subject: [PATCH 08/78] Improve the error message for when the username provided isn't valid user when creating an integration --- packages/rocketchat-integrations/server/lib/validation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rocketchat-integrations/server/lib/validation.js b/packages/rocketchat-integrations/server/lib/validation.js index d25a42c45e18..a8947bdb6019 100644 --- a/packages/rocketchat-integrations/server/lib/validation.js +++ b/packages/rocketchat-integrations/server/lib/validation.js @@ -149,7 +149,7 @@ RocketChat.integrations.validateOutgoing = function _validateOutgoing(integratio const user = RocketChat.models.Users.findOne({ username: integration.username }); if (!user) { - throw new Meteor.Error('error-invalid-user', 'Invalid user', { function: 'validateOutgoing' }); + throw new Meteor.Error('error-invalid-user', 'Invalid user (did you delete the `rocket.cat` user?)', { function: 'validateOutgoing' }); } integration.type = 'webhook-outgoing'; From b791a65e6f760f61471c3ce7a56743262710af90 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Mon, 12 Jun 2017 12:17:03 -0300 Subject: [PATCH 09/78] Revert merge from develop --- .docker/Dockerfile | 2 +- .sandstorm/sandstorm-pkgdef.capnp | 2 +- .travis/snap.sh | 2 +- HISTORY.md | 100 ++++++++++++++++++++++++ package.json | 2 +- packages/rocketchat-lib/rocketchat.info | 2 +- 6 files changed, 105 insertions(+), 5 deletions(-) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index beaccef6157c..a49784025077 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -1,6 +1,6 @@ FROM rocketchat/base:4 -ENV RC_VERSION 0.57.0-develop +ENV RC_VERSION 0.57.0-rc.1 MAINTAINER buildmaster@rocket.chat diff --git a/.sandstorm/sandstorm-pkgdef.capnp b/.sandstorm/sandstorm-pkgdef.capnp index c794307a7de6..789b0480ba1a 100644 --- a/.sandstorm/sandstorm-pkgdef.capnp +++ b/.sandstorm/sandstorm-pkgdef.capnp @@ -21,7 +21,7 @@ const pkgdef :Spk.PackageDefinition = ( appVersion = 62, # Increment this for every release. - appMarketingVersion = (defaultText = "0.57.0-develop"), + appMarketingVersion = (defaultText = "0.57.0-rc.1"), # Human-readable representation of appVersion. Should match the way you # identify versions of your app in documentation and marketing. diff --git a/.travis/snap.sh b/.travis/snap.sh index 8b602fa558c0..cd916adadd54 100755 --- a/.travis/snap.sh +++ b/.travis/snap.sh @@ -17,7 +17,7 @@ elif [[ $TRAVIS_TAG ]]; then RC_VERSION=$TRAVIS_TAG else CHANNEL=edge - RC_VERSION=0.57.0-develop + RC_VERSION=0.57.0-rc.1 fi echo "Preparing to trigger a snap release for $CHANNEL channel" diff --git a/HISTORY.md b/HISTORY.md index 4cb22ca5c634..915ae21d5aa2 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,103 @@ + +# 0.57.0-rc.1 (2017-06-02) + + +### Bug Fixes + +- [#7157](https://github.com/RocketChat/Rocket.Chat/pull/7157) Fix all reactions having the same username + + +
+Others + +- [#7154](https://github.com/RocketChat/Rocket.Chat/pull/7154) Remove missing CoffeeScript dependencies +
+ + + + +# 0.57.0-rc.0 (2017-06-01) + + +### New Features + +- [#7085](https://github.com/RocketChat/Rocket.Chat/pull/7085) API method and REST Endpoint for getting a single message by id +- [#6919](https://github.com/RocketChat/Rocket.Chat/pull/6919) Feature/delete any message permission +- [#6938](https://github.com/RocketChat/Rocket.Chat/pull/6938) Improve CI/Docker build/release +- [#7059](https://github.com/RocketChat/Rocket.Chat/pull/7059) Increase unread message count on [@here](https://github.com/here) mention +- [#6921](https://github.com/RocketChat/Rocket.Chat/pull/6921) LDAP: Use variables in User_Data_FieldMap for name mapping +- [#6857](https://github.com/RocketChat/Rocket.Chat/pull/6857) Make channel/group delete call answer to roomName +- [#7080](https://github.com/RocketChat/Rocket.Chat/pull/7080) Migration to add tags to email header and footer +- [#6788](https://github.com/RocketChat/Rocket.Chat/pull/6788) New avatar storage types +- [#6690](https://github.com/RocketChat/Rocket.Chat/pull/6690) Show full name in mentions if use full name setting enabled +- [#6953](https://github.com/RocketChat/Rocket.Chat/pull/6953) Show info about multiple instances at admin page +- [#6605](https://github.com/RocketChat/Rocket.Chat/pull/6605) Start running unit tests + + +### Bug Fixes + +- [#7025](https://github.com/RocketChat/Rocket.Chat/pull/7025) Add and to header and footer +- [#7084](https://github.com/RocketChat/Rocket.Chat/pull/7084) Add option to ignore TLS in SMTP server settings +- [#7072](https://github.com/RocketChat/Rocket.Chat/pull/7072) Add support for carriage return in markdown code blocks +- [#6910](https://github.com/RocketChat/Rocket.Chat/pull/6910) Allow image insert from slack through slackbridge +- [#6904](https://github.com/RocketChat/Rocket.Chat/pull/6904) Bugs in `isUserFromParams` helper +- [#6840](https://github.com/RocketChat/Rocket.Chat/pull/6840) Check that username is not in the room when being muted / unmuted +- [#7103](https://github.com/RocketChat/Rocket.Chat/pull/7103) clipboard (permalink, copy, pin, star buttons) +- [#7030](https://github.com/RocketChat/Rocket.Chat/pull/7030) do only store password if LDAP_Login_Fallback is on +- [#7105](https://github.com/RocketChat/Rocket.Chat/pull/7105) edit button on firefox +- [#6935](https://github.com/RocketChat/Rocket.Chat/pull/6935) Error when trying to show preview of undefined filetype +- [#7045](https://github.com/RocketChat/Rocket.Chat/pull/7045) Fix avatar upload via users.setAvatar REST endpoint +- [#6950](https://github.com/RocketChat/Rocket.Chat/pull/6950) Fix badge counter on iOS push notifications +- [#7121](https://github.com/RocketChat/Rocket.Chat/pull/7121) fix bug in preview image +- [#6972](https://github.com/RocketChat/Rocket.Chat/pull/6972) Fix error handling for non-valid avatar URL +- [#6974](https://github.com/RocketChat/Rocket.Chat/pull/6974) Fix login with Meteor saving an object as email address +- [#7104](https://github.com/RocketChat/Rocket.Chat/pull/7104) Fix missing CSS files on production builds +- [#6986](https://github.com/RocketChat/Rocket.Chat/pull/6986) Fix the other tests failing due chimp update +- [#7049](https://github.com/RocketChat/Rocket.Chat/pull/7049) Improve Tests +- [#6968](https://github.com/RocketChat/Rocket.Chat/pull/6968) make channels.create API check for create-c +- [#7044](https://github.com/RocketChat/Rocket.Chat/pull/7044) New screen sharing Chrome extension checking method +- [#6999](https://github.com/RocketChat/Rocket.Chat/pull/6999) overlapping text for users-typing-message +- [#7014](https://github.com/RocketChat/Rocket.Chat/pull/7014) Parse HTML on admin setting's descriptions +- [#6997](https://github.com/RocketChat/Rocket.Chat/pull/6997) Parse markdown links last +- [#7033](https://github.com/RocketChat/Rocket.Chat/pull/7033) Prevent Ctrl key on message field from reloading messages list +- [#6912](https://github.com/RocketChat/Rocket.Chat/pull/6912) Remove room from roomPick setting +- [#6961](https://github.com/RocketChat/Rocket.Chat/pull/6961) SAML: Only set KeyDescriptor when non empty +- [#7023](https://github.com/RocketChat/Rocket.Chat/pull/7023) Sidenav roomlist +- [#6913](https://github.com/RocketChat/Rocket.Chat/pull/6913) Slackbridge text replacements +- [#6903](https://github.com/RocketChat/Rocket.Chat/pull/6903) Updating Incoming Integration Post As Field Not Allowed +- [#6947](https://github.com/RocketChat/Rocket.Chat/pull/6947) Use AWS Signature Version 4 signed URLs for uploads +- [#7012](https://github.com/RocketChat/Rocket.Chat/pull/7012) video message recording dialog is shown in an incorrect position + + +
+Others + +- [#7094](https://github.com/RocketChat/Rocket.Chat/pull/7094) [FIX]Fix the failing tests +- [#7092](https://github.com/RocketChat/Rocket.Chat/pull/7092) [FIX]Fixed typo hmtl -> html +- [#7145](https://github.com/RocketChat/Rocket.Chat/pull/7145) Convert file unsubscribe.coffee to js +- [#7146](https://github.com/RocketChat/Rocket.Chat/pull/7146) Convert hipchat importer to js +- [#7022](https://github.com/RocketChat/Rocket.Chat/pull/7022) Convert irc package to js +- [#7096](https://github.com/RocketChat/Rocket.Chat/pull/7096) Convert Livechat from Coffeescript to JavaScript +- [#6936](https://github.com/RocketChat/Rocket.Chat/pull/6936) Convert meteor-autocomplete package to js +- [#7017](https://github.com/RocketChat/Rocket.Chat/pull/7017) Convert oauth2-server-config package to js +- [#6795](https://github.com/RocketChat/Rocket.Chat/pull/6795) Convert Ui Account Package to Js +- [#6911](https://github.com/RocketChat/Rocket.Chat/pull/6911) Convert ui-admin package to js +- [#6775](https://github.com/RocketChat/Rocket.Chat/pull/6775) Convert WebRTC Package to Js +- [#7018](https://github.com/RocketChat/Rocket.Chat/pull/7018) converted rocketchat-importer +- [#6836](https://github.com/RocketChat/Rocket.Chat/pull/6836) converted rocketchat-ui coffee to js part 2 +- [#6976](https://github.com/RocketChat/Rocket.Chat/pull/6976) fix the crashing tests +- [#7055](https://github.com/RocketChat/Rocket.Chat/pull/7055) Ldap: User_Data_FieldMap description +- [#7114](https://github.com/RocketChat/Rocket.Chat/pull/7114) LingoHub based on develop +- [#7005](https://github.com/RocketChat/Rocket.Chat/pull/7005) LingoHub based on develop +- [#6978](https://github.com/RocketChat/Rocket.Chat/pull/6978) LingoHub based on develop +- [#7062](https://github.com/RocketChat/Rocket.Chat/pull/7062) Remove Useless Jasmine Tests +- [#6914](https://github.com/RocketChat/Rocket.Chat/pull/6914) Rocketchat ui message +- [#7006](https://github.com/RocketChat/Rocket.Chat/pull/7006) Rocketchat ui3 +- [#6987](https://github.com/RocketChat/Rocket.Chat/pull/6987) rocketchat-importer-slack coffee to js +- [#6735](https://github.com/RocketChat/Rocket.Chat/pull/6735) rocketchat-lib[4] coffee to js +
+ + # NEXT diff --git a/package.json b/package.json index 0f2186e96baf..dc9e3129c322 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "Rocket.Chat", "description": "The Ultimate Open Source WebChat Platform", - "version": "0.57.0-develop", + "version": "0.57.0-rc.1", "author": { "name": "Rocket.Chat", "url": "https://rocket.chat/" diff --git a/packages/rocketchat-lib/rocketchat.info b/packages/rocketchat-lib/rocketchat.info index fbad42938baf..292fd29a9879 100644 --- a/packages/rocketchat-lib/rocketchat.info +++ b/packages/rocketchat-lib/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "0.57.0-develop" + "version": "0.57.0-rc.1" } From 1c87c92c17dbb84ab02e94a92cc1658ae7149cbb Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Fri, 9 Jun 2017 17:20:37 -0300 Subject: [PATCH 10/78] Merge pull request #7209 from RocketChat/fix-requirePasswordChange-not-applying-when-false [FIX] "requirePasswordChange" property not being saved when set to false --- packages/rocketchat-lib/server/functions/saveUser.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rocketchat-lib/server/functions/saveUser.js b/packages/rocketchat-lib/server/functions/saveUser.js index 540479df0afb..fade4261aaff 100644 --- a/packages/rocketchat-lib/server/functions/saveUser.js +++ b/packages/rocketchat-lib/server/functions/saveUser.js @@ -73,7 +73,7 @@ RocketChat.saveUser = function(userId, userData) { } }; - if (userData.requirePasswordChange) { + if (typeof userData.requirePasswordChange !== 'undefined') { updateUser.$set.requirePasswordChange = userData.requirePasswordChange; } @@ -160,7 +160,7 @@ RocketChat.saveUser = function(userId, userData) { updateUser.$set.roles = userData.roles; } - if (userData.requirePasswordChange) { + if (typeof userData.requirePasswordChange !== 'undefined') { updateUser.$set.requirePasswordChange = userData.requirePasswordChange; } From c5ffd450b0e953dc8a3b42bf8e5b985e9697265f Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Fri, 9 Jun 2017 17:18:52 -0500 Subject: [PATCH 11/78] Fix the Zapier oAuth return url to the new one (#7215) --- .../oauth/server/default-services.js | 2 +- server/startup/migrations/v098.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 server/startup/migrations/v098.js diff --git a/packages/rocketchat-oauth2-server-config/oauth/server/default-services.js b/packages/rocketchat-oauth2-server-config/oauth/server/default-services.js index 2a5ab569110e..329acb3c19a1 100644 --- a/packages/rocketchat-oauth2-server-config/oauth/server/default-services.js +++ b/packages/rocketchat-oauth2-server-config/oauth/server/default-services.js @@ -5,7 +5,7 @@ if (!RocketChat.models.OAuthApps.findOne('zapier')) { active: true, clientId: 'zapier', clientSecret: 'RTK6TlndaCIolhQhZ7_KHIGOKj41RnlaOq_o-7JKwLr', - redirectUri: 'https://zapier.com/dashboard/auth/oauth/return/App32270API/', + redirectUri: 'https://zapier.com/dashboard/auth/oauth/return/RocketChatDevAPI/', _createdAt: new Date, _createdBy: { _id: 'system', diff --git a/server/startup/migrations/v098.js b/server/startup/migrations/v098.js new file mode 100644 index 000000000000..b5c0d1ed02b2 --- /dev/null +++ b/server/startup/migrations/v098.js @@ -0,0 +1,10 @@ +RocketChat.Migrations.add({ + version: 98, + up() { + RocketChat.models.OAuthApps.update({ _id: 'zapier' }, { + $set: { + redirectUri: 'https://zapier.com/dashboard/auth/oauth/return/RocketChatDevAPI/' + } + }); + } +}); From c5723da83f6651b98359ffa6172e3eca02afd013 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Fri, 9 Jun 2017 13:40:04 -0300 Subject: [PATCH 12/78] Merge pull request #7208 from RocketChat/fix-oembed-previews-not-showing [FIX] Fix oembed previews not being shown --- packages/rocketchat-ui-message/client/message.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/rocketchat-ui-message/client/message.js b/packages/rocketchat-ui-message/client/message.js index bf7675a7f515..6925a48df807 100644 --- a/packages/rocketchat-ui-message/client/message.js +++ b/packages/rocketchat-ui-message/client/message.js @@ -193,10 +193,13 @@ Template.message.helpers({ } }, hasOembed() { - if (!(this.urls && this.urls.length > 0 && Template.oembedBaseWidget != null && RocketChat.settings.get('API_Embed'))) { + // there is no URLs, there is no template to show the oembed (oembed package removed) or oembed is not enable + if (!(this.urls && this.urls.length > 0) || !Template.oembedBaseWidget || !RocketChat.settings.get('API_Embed')) { return false; } - if (!(RocketChat.settings.get('API_EmbedDisabledFor')||'').split(',').map(username => username.trim()).includes(this.u && this.u.username)) { + + // check if oembed is disabled for message's sender + if ((RocketChat.settings.get('API_EmbedDisabledFor')||'').split(',').map(username => username.trim()).includes(this.u && this.u.username)) { return false; } return true; From 452b97083bdf6b4586e92c1e9243178f6bf4c192 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Thu, 8 Jun 2017 18:40:37 -0300 Subject: [PATCH 13/78] Fix editing others messages (#7200) --- packages/rocketchat-ui/client/lib/chatMessages.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rocketchat-ui/client/lib/chatMessages.js b/packages/rocketchat-ui/client/lib/chatMessages.js index 1fe0802f7fe5..1d8d2482b155 100644 --- a/packages/rocketchat-ui/client/lib/chatMessages.js +++ b/packages/rocketchat-ui/client/lib/chatMessages.js @@ -104,7 +104,7 @@ this.ChatMessages = class ChatMessages { const editAllowed = RocketChat.settings.get('Message_AllowEditing'); const editOwn = message && message.u && message.u._id === Meteor.userId(); - if (!hasPermission && !editAllowed || !editOwn) { return; } + if (!hasPermission && (!editAllowed || !editOwn)) { return; } if (element.classList.contains('system')) { return; } const blockEditInMinutes = RocketChat.settings.get('Message_AllowEditing_BlockEditInMinutes'); From 8ea4a8beb27e4ba2e33dfb4698da1e02cdcb5822 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Mon, 12 Jun 2017 13:47:48 -0300 Subject: [PATCH 14/78] Bump version to 0.57.0-rc.2 --- .docker/Dockerfile | 2 +- .sandstorm/sandstorm-pkgdef.capnp | 2 +- .travis/snap.sh | 2 +- HISTORY.md | 14 ++++++++++++++ package.json | 2 +- packages/rocketchat-lib/rocketchat.info | 2 +- 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index a49784025077..c469d26d0d4a 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -1,6 +1,6 @@ FROM rocketchat/base:4 -ENV RC_VERSION 0.57.0-rc.1 +ENV RC_VERSION 0.57.0-rc.2 MAINTAINER buildmaster@rocket.chat diff --git a/.sandstorm/sandstorm-pkgdef.capnp b/.sandstorm/sandstorm-pkgdef.capnp index 789b0480ba1a..4bd7fe8f6a2c 100644 --- a/.sandstorm/sandstorm-pkgdef.capnp +++ b/.sandstorm/sandstorm-pkgdef.capnp @@ -21,7 +21,7 @@ const pkgdef :Spk.PackageDefinition = ( appVersion = 62, # Increment this for every release. - appMarketingVersion = (defaultText = "0.57.0-rc.1"), + appMarketingVersion = (defaultText = "0.57.0-rc.2"), # Human-readable representation of appVersion. Should match the way you # identify versions of your app in documentation and marketing. diff --git a/.travis/snap.sh b/.travis/snap.sh index cd916adadd54..fc3e66e740f2 100755 --- a/.travis/snap.sh +++ b/.travis/snap.sh @@ -17,7 +17,7 @@ elif [[ $TRAVIS_TAG ]]; then RC_VERSION=$TRAVIS_TAG else CHANNEL=edge - RC_VERSION=0.57.0-rc.1 + RC_VERSION=0.57.0-rc.2 fi echo "Preparing to trigger a snap release for $CHANNEL channel" diff --git a/HISTORY.md b/HISTORY.md index 915ae21d5aa2..a4ed842d9274 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,17 @@ + +# 0.57.0-rc.2 (2017-06-12) + + +### Bug Fixes + +- [#7215](https://github.com/RocketChat/Rocket.Chat/pull/7215/) Fix the Zapier oAuth return url to the new one +- [#7209](https://github.com/RocketChat/Rocket.Chat/pull/7209) "requirePasswordChange" property not being saved when set to false +- [#7208](https://github.com/RocketChat/Rocket.Chat/pull/7208) Fix oembed previews not being shown +- [#7200](https://github.com/RocketChat/Rocket.Chat/pull/7200) Fix editing others messages +- [#7160](https://github.com/RocketChat/Rocket.Chat/pull/7160) Removing the kadira package install from example build script. + + + # 0.57.0-rc.1 (2017-06-02) diff --git a/package.json b/package.json index dc9e3129c322..1a6d775e2f12 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "Rocket.Chat", "description": "The Ultimate Open Source WebChat Platform", - "version": "0.57.0-rc.1", + "version": "0.57.0-rc.2", "author": { "name": "Rocket.Chat", "url": "https://rocket.chat/" diff --git a/packages/rocketchat-lib/rocketchat.info b/packages/rocketchat-lib/rocketchat.info index 292fd29a9879..a44b7c1f1bc5 100644 --- a/packages/rocketchat-lib/rocketchat.info +++ b/packages/rocketchat-lib/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "0.57.0-rc.1" + "version": "0.57.0-rc.2" } From 15582f8423af2895d7b489255d194c1c88cbcb01 Mon Sep 17 00:00:00 2001 From: Gabriel Delavald Date: Mon, 12 Jun 2017 15:49:05 -0300 Subject: [PATCH 15/78] Fixes scope error preventing file upload errors from being dismissed --- packages/rocketchat-ui/client/lib/fileUpload.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/rocketchat-ui/client/lib/fileUpload.js b/packages/rocketchat-ui/client/lib/fileUpload.js index 9c20385e3021..8eae86272eb9 100644 --- a/packages/rocketchat-ui/client/lib/fileUpload.js +++ b/packages/rocketchat-ui/client/lib/fileUpload.js @@ -45,6 +45,10 @@ function formatBytes(bytes, decimals) { return `${ parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) } ${ sizes[i] }`; } +function clearUploadError(id) { + const uploading = Session.get('uploading') || []; +} + fileUpload = function(filesToUpload) { const roomId = Session.get('openedRoom'); const files = [].concat(filesToUpload); @@ -135,7 +139,7 @@ fileUpload = function(filesToUpload) { html: true }, function(isConfirm) { consume(); - if (isConfirm !== true) { + if (!isConfirm) { return; } @@ -175,10 +179,10 @@ fileUpload = function(filesToUpload) { uploading = []; } - const item = _.findWhere(uploading, { id: this.id }); + const item = _.findWhere(uploading, { id: upload.id }); if (_.isObject(item)) { - item.error = error.error; + item.error = error.message; item.percentage = 0; } else { uploading.push({ From ec85fbb29f785783142d0cf473422dd1fa28c717 Mon Sep 17 00:00:00 2001 From: Gabriel Delavald Date: Mon, 12 Jun 2017 15:55:08 -0300 Subject: [PATCH 16/78] Removing unnecessary changes --- packages/rocketchat-ui/client/lib/fileUpload.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/rocketchat-ui/client/lib/fileUpload.js b/packages/rocketchat-ui/client/lib/fileUpload.js index 8eae86272eb9..7a2d97de4ff7 100644 --- a/packages/rocketchat-ui/client/lib/fileUpload.js +++ b/packages/rocketchat-ui/client/lib/fileUpload.js @@ -45,10 +45,6 @@ function formatBytes(bytes, decimals) { return `${ parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) } ${ sizes[i] }`; } -function clearUploadError(id) { - const uploading = Session.get('uploading') || []; -} - fileUpload = function(filesToUpload) { const roomId = Session.get('openedRoom'); const files = [].concat(filesToUpload); From 624698e12fd374d3ddc6403b38879b49de81c772 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Mon, 12 Jun 2017 16:37:05 -0300 Subject: [PATCH 17/78] work in progress --- .../client/views/permissions.html | 2 +- .../client/views/permissions.js | 5 + .../server/startup.js | 4 +- packages/rocketchat-i18n/i18n/en.i18n.json | 241 ++++++++++++++++++ 4 files changed, 250 insertions(+), 2 deletions(-) diff --git a/packages/rocketchat-authorization/client/views/permissions.html b/packages/rocketchat-authorization/client/views/permissions.html index 3d53eb803e42..9199a2ae0c03 100644 --- a/packages/rocketchat-authorization/client/views/permissions.html +++ b/packages/rocketchat-authorization/client/views/permissions.html @@ -19,7 +19,7 @@ {{#each permission}} - {{_id}} + {{_ permissionName}} {{#each role}} diff --git a/packages/rocketchat-authorization/client/views/permissions.js b/packages/rocketchat-authorization/client/views/permissions.js index 90f115104148..dd17fb044028 100644 --- a/packages/rocketchat-authorization/client/views/permissions.js +++ b/packages/rocketchat-authorization/client/views/permissions.js @@ -6,6 +6,7 @@ Template.permissions.helpers({ }, permission() { + console.log(ChatPermissions.find({}, {}).fetch()); return ChatPermissions.find({}, { sort: { _id: 1 @@ -21,6 +22,10 @@ Template.permissions.helpers({ } }, + permissionName() { + return `permission_${ this._id }`; + }, + hasPermission() { return RocketChat.authz.hasAllPermission('access-permissions'); } diff --git a/packages/rocketchat-authorization/server/startup.js b/packages/rocketchat-authorization/server/startup.js index 3fe7771125de..7378c47c1066 100644 --- a/packages/rocketchat-authorization/server/startup.js +++ b/packages/rocketchat-authorization/server/startup.js @@ -64,9 +64,11 @@ Meteor.startup(function() { { _id: 'preview-c-room', roles : ['admin', 'user', 'anonymous'] } ]; + permissions.forEach(o => { o.i18nLabel = `permission_${ o._id }_description` ; }); + for (const permission of permissions) { if (!RocketChat.models.Permissions.findOneById(permission._id)) { - RocketChat.models.Permissions.upsert(permission._id, {$set: permission }); + RocketChat.models.Permissions.upsert(permission._id, {i18nLabel: permission.i18nLabel}, {$set: permission }); } } diff --git a/packages/rocketchat-i18n/i18n/en.i18n.json b/packages/rocketchat-i18n/i18n/en.i18n.json index 1b2888536b9a..24f6ab2e4e38 100644 --- a/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/packages/rocketchat-i18n/i18n/en.i18n.json @@ -1155,6 +1155,247 @@ "People": "People", "Permalink": "Permalink", "Permissions": "Permissions", + //empty lines are for ease of reviewing this pr. They will be removed before merging + + "permission_access-mailer":"Access Mailer Screen", + "permission_access-mailer_description":"Permission to send mass email to all users.", + + "permission_access-permissions":"Access Permissions Screen", + "permission_access-permissions_description":"Modify permissions for various roles.", + + "permission_add-oauth-service":"Add Oauth Service", + "permission_add-oauth-service_description":"Permission to add a new Oauth service", + + "permission_add-user":"Add User", + "permission_add-user_description":"Permission to add new users to the server via users screen", + + "permission_add-user-to-any-c-room":"Add User to Any Public Channel", + "permission_add-user-to-any-c-room_description":"Permission to add a user to any public channel", + + "permission_add-user-to-any-p-room":"Add User to Any Private Channel", + "permission_add-user-to-any-p-room_description":"Permission to add a user to any private channel", + + "permission_add-user-to-joined-room":"Add User to Any Joined Channel", + "permission_add-user-to-joined-room_description":"Permission to add a user to a currently joined channel", + + "permission_archive-room":"Archive Room", + "permission_archive-room_description":"Permission to archive a channel", + + "permission_assign-admin-role":"Assign Admin Role", + "permission_assign-admin-role_description":"Permission to assign the admin role to other users", + + "permission_auto-translate":"Auto Translate", + "permission_auto-translate_description":"Permission to use the auto translate tool", + + "permission_ban-user":"Ban User", + "permission_ban-user_description":"Permission to assign the admin role to other users", + + "permission_bulk-create-c":"Bulk Create Channels", + "permission_bulk-create-c_description":"Permission to create channels in bulk", + + "permission_bulk-register-user":"Bulk Create Channels", + "permission_bulk-register-user_description":"Permission to create channels in bulk", + + "permission_clean-channel-history":"Clean Channel History", + "permission_clean-channel-history_description":"Permission to Clear the history from channels", + + "permission_close-livechat-room":"Close Livechat Room", + "permission_close-livechat-room_description":"Permission to close the current LiveChat channel", + + "permission_close-others-livechat-room":"Close Livechat Room", + "permission_close-others-livechat-room_description":"Permission to close other LiveChat channels", + + "permission_create-c":"Create Public Channels", + "permission_create-c_description":"Permission to create public channels", + + "permission_create-d":"Create Direct Messages", + "permission_create-d_description":"Permission to start direct messages", + + "permission_create-p":"Create Private Channels", + "permission_create-p_description":"Permission to create private channels", + + "permission_create-user":"Create User", + "permission_create-user_description":"Permission to create users", + + "permission_delete-c":"Delete Public Channels", + "permission_delete-c_description":"Permission to delete public channels", + + "permission_delete-d":"Delete Direct Messages", + "permission_delete-d_description":"Permission to delete direct messages", + + "permission_delete-p":"Delete Private Channels", + "permission_delete-p_description":"Permission to delete private channels", + + "permission_delete-message":"Delete Message", + "permission_delete-message_description":"Permission to delete a message within a room", + + "permission_delete-user":"Delete User", + "permission_delete-user_description":"Permission to delete users", + + "permission_edit-message":"Edit Message", + "permission_edit-message_description":"Permission to edit a message within a room", + + "permission_edit-other-user-active-status":"Edit Other User Active Status", + "permission_edit-other-user-active-status_description":"Permission to enable or disable other accounts", + + "permission_edit-other-user-info":"Edit Other User Information", + "permission_edit-other-user-info_description":"Permission to change other user’s name, username or email address.", + + "permission_edit-other-user-password":"Edit Other User Password", + "permission_edit-other-user-password_description":"Permission to modify other user’s passwords. Requires edit-other-user-info permission.", + + "permission_edit-privileged-setting":"Edit privileged Setting", + "permission_edit-privileged-setting_description":"Permission to edit settings", + + "permission_edit-room":"Edit Room", + "permission_edit-room_description":"Permission to edit a room’s name, topic, type (private or public status) and status (active or archived)", + + "permission_force-delete-message":"Force Delete Message", + "permission_force-delete-message_description":"Permission to delete a message bypassing all restrictions", + + "permission_join-without-join-code":"Join Without Join Code", + "permission_join-without-join-code_description":"Permission to bypass the join code in channels with join code enabled", + + "permission_mail-messages":"Mail Messages", + "permission_mail-messages_description":"Permission to use the mail messages option", + + "permission_manage-assets":"Manage Assets", + "permission_manage-assets_description":"Permission to manage the server assets", + + "permission_manage-emoji":"Manage Emoji", + "permission_manage-emoji_description":"Permission to manage the server emojis", + + "permission_manage-integrations":"Manage Integrations", + "permission_manage-integrations_description":"Permission to manage the server integrations", + + "permission_manage-oauth-apps":"Manage Oauth Apps", + "permission_manage-oauth-apps_description":"Permission to manage the server Oauth apps", + + "permission_manage-own-integrations":"Manage Own Integrations", + "permission_manage-own-integrations_description":"Permition to users create and edit their own integration or webhooks", + + "permission_manage-sounds":"Manage Sounds", + "permission_manage-sounds_description":"Permission to manage the server sounds", + + "permission_mention-all":"Mention All", + "permission_mention-all_description":"Permission to use the @all mention", + + "permission_mute-user":"Mute User", + "permission_mute-user_description":"Permission to mute other users in the same channel", + + "permission_pin-message":"Pin Message", + "permission_pin-message_description":"Permission to pin a message in a channel", + + "permission_post-readonly":"Post ReadOnly", + "permission_post-readonly_description":"Permission to post a message in a read-only channel", + + "permission_preview-c-room":"Preview Public Channel", + "permission_preview-c-room_description":"Permission view the contents of a public channel before joining", + + "permission_remove-user":"Remove User", + "permission_remove-user_description":"Permission to remove a user from a room", + + "permission_run-import":"Run Import", + "permission_run-import_description":"Permission to run the importers", + + "permission_run-migration":"Run Migration", + "permission_run-migration_description":"Permission to run the migrations", + + "permission_save-others-livechat-room-info":"Save Others Livechat Room Info", + "permission_save-others-livechat-room-info_description":"Permission to save information from other livechat channels", + + "permission_set-moderator":"Set Moderator", + "permission_set-moderator_description":"Permission to set other users as moderator of a channel", + + "permission_set-owner":"Set Owner", + "permission_set-owner_description":"Permission to set other users as owner of a channel", + + "permission_set-react-when-readonly":"Set React When ReadOnly", + "permission_set-react-when-readonly_description":"Permission to set the ability to react to messages in a read only channel", + + "permission_set-readonly":"Set ReadOnly", + "permission_set-readonly_description":"Permission to set a channel to read only channel", + + "permission_snippet-message":"Snippet Message", + "permission_snippet-message_description":"Permission to create snippet message", + + "permission_unarchive-room":"Unarchive Room", + "permission_unarchive-room_description":"Permission to unarchive channels", + + "permission_user-generate-access-token":"User Generate Access Token", + "permission_user-generate-access-token_description":"Permission to users generate access tokens", + + "permission_view-c-room":"View Public Channel", + "permission_view-c-room_description":"Permission to view public channels", + + "permission_view-d-room":"View Direct Messages", + "permission_view-d-room_description":"Permission to view direct messages", + + "permission_view-full-other-user-info":"View Full Other User Info", + "permission_view-full-other-user-info_description":"Permission to view full profile of other users including account creation date, last login, etc.", + + "permission_view-history":"View History", + "permission_view-history_description":"Permission to view the channel history", + + "permission_view-join-code":"View Join Code", + "permission_view-join-code_description":"Permission to view the channel join code", + + "permission_view-joined-room":"View Joined Room", + "permission_view-joined-room_description":"Permission to view the currently joined channels", + + "permission_view-l-room":"View Livechat Room", + "permission_view-l-room_description":"Permission to view livechat channels", + + "permission_view-livechat-manager":"View Livechat Manager", + "permission_view-livechat-manager_description":"Permission to view other livechat managers", + + "permission_view-livechat-rooms":"View Livechat Rooms", + "permission_view-livechat-rooms_description":"Permission to view other livechat channels", + + "permission_view-logs":"View Logs", + "permission_view-logs_description":"Permission to view the server logs ", + + "permission_view-p-room":"View Private Room", + "permission_view-p-room_description":"Permission to view private channels", + + "permission_view-privileged-setting":"View Privileged Setting", + "permission_view-privileged-setting_description":"Permission to view settings", + + "permission_view-room-administration":"View Room Administration", + "permission_view-room-administration_description":"Permission to view public, private and direct message statistics. Does not include the ability to view conversations or archives", + + "permission_view-statistics":"View Private Room", + "permission_view-statistics_description":"Permission o view system statistics such as number of users logged in, number of rooms, operating system information", + + "permission_view-user-administration":"View User Administration", + "permission_view-user-administration_description":"Permission to partial, read-only list view of other user accounts currently logged into the system. No user account information is accessible with this permission", + + + + + + + + + + + + + + + + + + + + + + + + + + + "Pin_Message": "Pin Message", "Pinned_a_message": "Pinned a message:", "Pinned_Messages": "Pinned Messages", From 6772472a97d3d82eab06d40d0c85e574145a051d Mon Sep 17 00:00:00 2001 From: Gabriel Delavald Date: Mon, 12 Jun 2017 17:54:17 -0300 Subject: [PATCH 18/78] New error message when opening a direct chat with yourself --- packages/rocketchat-i18n/i18n/en.i18n.json | 1 + packages/rocketchat-ui/client/views/404/roomNotFound.html | 6 +++++- packages/rocketchat-ui/client/views/404/roomNotFound.js | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/rocketchat-i18n/i18n/en.i18n.json b/packages/rocketchat-i18n/i18n/en.i18n.json index 1b2888536b9a..62b4df3ac84b 100644 --- a/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/packages/rocketchat-i18n/i18n/en.i18n.json @@ -279,6 +279,7 @@ "Cancel": "Cancel", "Cancel_message_input": "Cancel", "Cannot_invite_users_to_direct_rooms": "Cannot invite users to direct rooms", + "Cannot_open_conversation_with_yourself": "Cannot open a conversation with yourself", "CAS_autoclose": "Autoclose login popup", "CAS_base_url": "SSO Base URL", "CAS_base_url_Description": "The base URL of your external SSO service e.g: https://sso.example.undef/sso/", diff --git a/packages/rocketchat-ui/client/views/404/roomNotFound.html b/packages/rocketchat-ui/client/views/404/roomNotFound.html index 9d653a0cce26..0fc3a73c8494 100644 --- a/packages/rocketchat-ui/client/views/404/roomNotFound.html +++ b/packages/rocketchat-ui/client/views/404/roomNotFound.html @@ -17,7 +17,11 @@

{{{_ 'No_group_with_name_%s_was_found' name}}} {{/if}} {{#if $eq type 'd'}} - {{{_ 'No_user_with_username_%s_was_found' name}}} + {{#if sameUser }} + {{{_ 'Cannot_open_conversation_with_yourself' }}} + {{else}} + {{{_ 'No_user_with_username_%s_was_found' name}}} + {{/if}} {{/if}} {{/with}}

diff --git a/packages/rocketchat-ui/client/views/404/roomNotFound.js b/packages/rocketchat-ui/client/views/404/roomNotFound.js index c09dc1f0190b..251389df7272 100644 --- a/packages/rocketchat-ui/client/views/404/roomNotFound.js +++ b/packages/rocketchat-ui/client/views/404/roomNotFound.js @@ -4,5 +4,9 @@ Template.roomNotFound.helpers({ }, name() { return Blaze._escape(this.name); + }, + sameUser() { + const user = Meteor.user(); + return user && user.username === this.name; } }); From 39243639e2445f6fb17aad3230911674d96fde3e Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Tue, 13 Jun 2017 11:40:29 -0300 Subject: [PATCH 19/78] Translate permissions names and add descriptions to them --- .../client/stylesheets/permissions.less | 4 ++++ .../rocketchat-authorization/client/views/permissions.html | 2 +- .../rocketchat-authorization/client/views/permissions.js | 5 ++++- packages/rocketchat-authorization/server/startup.js | 4 ++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/rocketchat-authorization/client/stylesheets/permissions.less b/packages/rocketchat-authorization/client/stylesheets/permissions.less index c970dbf8d1f2..f82ebed1bb64 100644 --- a/packages/rocketchat-authorization/client/stylesheets/permissions.less +++ b/packages/rocketchat-authorization/client/stylesheets/permissions.less @@ -28,6 +28,10 @@ left: 50%; transform: translateX(-50%); } + + .permission-name { + cursor: default; + } } .empty-role { diff --git a/packages/rocketchat-authorization/client/views/permissions.html b/packages/rocketchat-authorization/client/views/permissions.html index 9199a2ae0c03..683f6c091c33 100644 --- a/packages/rocketchat-authorization/client/views/permissions.html +++ b/packages/rocketchat-authorization/client/views/permissions.html @@ -19,7 +19,7 @@ {{#each permission}} - {{_ permissionName}} + {{_ permissionName}} {{#each role}} diff --git a/packages/rocketchat-authorization/client/views/permissions.js b/packages/rocketchat-authorization/client/views/permissions.js index dd17fb044028..e20f156b899f 100644 --- a/packages/rocketchat-authorization/client/views/permissions.js +++ b/packages/rocketchat-authorization/client/views/permissions.js @@ -6,7 +6,6 @@ Template.permissions.helpers({ }, permission() { - console.log(ChatPermissions.find({}, {}).fetch()); return ChatPermissions.find({}, { sort: { _id: 1 @@ -26,6 +25,10 @@ Template.permissions.helpers({ return `permission_${ this._id }`; }, + permissionDescription() { + return `permission_${ this._id }_description`; + }, + hasPermission() { return RocketChat.authz.hasAllPermission('access-permissions'); } diff --git a/packages/rocketchat-authorization/server/startup.js b/packages/rocketchat-authorization/server/startup.js index 7378c47c1066..d6f67a60b557 100644 --- a/packages/rocketchat-authorization/server/startup.js +++ b/packages/rocketchat-authorization/server/startup.js @@ -64,11 +64,11 @@ Meteor.startup(function() { { _id: 'preview-c-room', roles : ['admin', 'user', 'anonymous'] } ]; - permissions.forEach(o => { o.i18nLabel = `permission_${ o._id }_description` ; }); + //permissions.forEach(o => { o.i18nLabel = `permission_${ o._id }_description` ; }); for (const permission of permissions) { if (!RocketChat.models.Permissions.findOneById(permission._id)) { - RocketChat.models.Permissions.upsert(permission._id, {i18nLabel: permission.i18nLabel}, {$set: permission }); + RocketChat.models.Permissions.upsert(permission._id, {$set: permission }); } } From ba357419a4b258a3d788c61bae9162fe425c5ad6 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Tue, 13 Jun 2017 13:32:29 -0300 Subject: [PATCH 20/78] remove prefix from the i18n strings (not sorted) --- .../client/views/permissions.js | 4 +- packages/rocketchat-i18n/i18n/en.i18n.json | 312 ++++++++---------- 2 files changed, 146 insertions(+), 170 deletions(-) diff --git a/packages/rocketchat-authorization/client/views/permissions.js b/packages/rocketchat-authorization/client/views/permissions.js index e20f156b899f..6205927af5a1 100644 --- a/packages/rocketchat-authorization/client/views/permissions.js +++ b/packages/rocketchat-authorization/client/views/permissions.js @@ -22,11 +22,11 @@ Template.permissions.helpers({ }, permissionName() { - return `permission_${ this._id }`; + return `${ this._id }`; }, permissionDescription() { - return `permission_${ this._id }_description`; + return `${ this._id }_description`; }, hasPermission() { diff --git a/packages/rocketchat-i18n/i18n/en.i18n.json b/packages/rocketchat-i18n/i18n/en.i18n.json index 24f6ab2e4e38..982cff8d3d95 100644 --- a/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/packages/rocketchat-i18n/i18n/en.i18n.json @@ -1155,246 +1155,222 @@ "People": "People", "Permalink": "Permalink", "Permissions": "Permissions", - //empty lines are for ease of reviewing this pr. They will be removed before merging - "permission_access-mailer":"Access Mailer Screen", - "permission_access-mailer_description":"Permission to send mass email to all users.", + "access-mailer":"Access Mailer Screen", + "access-mailer_description":"Permission to send mass email to all users.", - "permission_access-permissions":"Access Permissions Screen", - "permission_access-permissions_description":"Modify permissions for various roles.", + "access-permissions":"Access Permissions Screen", + "access-permissions_description":"Modify permissions for various roles.", - "permission_add-oauth-service":"Add Oauth Service", - "permission_add-oauth-service_description":"Permission to add a new Oauth service", + "add-oauth-service":"Add Oauth Service", + "add-oauth-service_description":"Permission to add a new Oauth service", - "permission_add-user":"Add User", - "permission_add-user_description":"Permission to add new users to the server via users screen", + "add-user":"Add User", + "add-user_description":"Permission to add new users to the server via users screen", - "permission_add-user-to-any-c-room":"Add User to Any Public Channel", - "permission_add-user-to-any-c-room_description":"Permission to add a user to any public channel", + "add-user-to-any-c-room":"Add User to Any Public Channel", + "add-user-to-any-c-room_description":"Permission to add a user to any public channel", - "permission_add-user-to-any-p-room":"Add User to Any Private Channel", - "permission_add-user-to-any-p-room_description":"Permission to add a user to any private channel", + "add-user-to-any-p-room":"Add User to Any Private Channel", + "add-user-to-any-p-room_description":"Permission to add a user to any private channel", - "permission_add-user-to-joined-room":"Add User to Any Joined Channel", - "permission_add-user-to-joined-room_description":"Permission to add a user to a currently joined channel", + "add-user-to-joined-room":"Add User to Any Joined Channel", + "add-user-to-joined-room_description":"Permission to add a user to a currently joined channel", - "permission_archive-room":"Archive Room", - "permission_archive-room_description":"Permission to archive a channel", + "archive-room":"Archive Room", + "archive-room_description":"Permission to archive a channel", - "permission_assign-admin-role":"Assign Admin Role", - "permission_assign-admin-role_description":"Permission to assign the admin role to other users", + "assign-admin-role":"Assign Admin Role", + "assign-admin-role_description":"Permission to assign the admin role to other users", - "permission_auto-translate":"Auto Translate", - "permission_auto-translate_description":"Permission to use the auto translate tool", + "auto-translate":"Auto Translate", + "auto-translate_description":"Permission to use the auto translate tool", - "permission_ban-user":"Ban User", - "permission_ban-user_description":"Permission to assign the admin role to other users", + "ban-user":"Ban User", + "ban-user_description":"Permission to ban a user from a channel", - "permission_bulk-create-c":"Bulk Create Channels", - "permission_bulk-create-c_description":"Permission to create channels in bulk", + "bulk-create-c":"Bulk Create Channels", + "bulk-create-c_description":"Permission to create channels in bulk", - "permission_bulk-register-user":"Bulk Create Channels", - "permission_bulk-register-user_description":"Permission to create channels in bulk", + "bulk-register-user":"Bulk Create Channels", + "bulk-register-user_description":"Permission to create channels in bulk", - "permission_clean-channel-history":"Clean Channel History", - "permission_clean-channel-history_description":"Permission to Clear the history from channels", + "clean-channel-history":"Clean Channel History", + "clean-channel-history_description":"Permission to Clear the history from channels", - "permission_close-livechat-room":"Close Livechat Room", - "permission_close-livechat-room_description":"Permission to close the current LiveChat channel", + "close-livechat-room":"Close Livechat Room", + "close-livechat-room_description":"Permission to close the current LiveChat channel", - "permission_close-others-livechat-room":"Close Livechat Room", - "permission_close-others-livechat-room_description":"Permission to close other LiveChat channels", + "close-others-livechat-room":"Close Livechat Room", + "close-others-livechat-room_description":"Permission to close other LiveChat channels", - "permission_create-c":"Create Public Channels", - "permission_create-c_description":"Permission to create public channels", + "create-c":"Create Public Channels", + "create-c_description":"Permission to create public channels", - "permission_create-d":"Create Direct Messages", - "permission_create-d_description":"Permission to start direct messages", + "create-d":"Create Direct Messages", + "create-d_description":"Permission to start direct messages", - "permission_create-p":"Create Private Channels", - "permission_create-p_description":"Permission to create private channels", + "create-p":"Create Private Channels", + "create-p_description":"Permission to create private channels", - "permission_create-user":"Create User", - "permission_create-user_description":"Permission to create users", + "create-user":"Create User", + "create-user_description":"Permission to create users", - "permission_delete-c":"Delete Public Channels", - "permission_delete-c_description":"Permission to delete public channels", + "delete-c":"Delete Public Channels", + "delete-c_description":"Permission to delete public channels", - "permission_delete-d":"Delete Direct Messages", - "permission_delete-d_description":"Permission to delete direct messages", + "delete-d":"Delete Direct Messages", + "delete-d_description":"Permission to delete direct messages", - "permission_delete-p":"Delete Private Channels", - "permission_delete-p_description":"Permission to delete private channels", + "delete-p":"Delete Private Channels", + "delete-p_description":"Permission to delete private channels", - "permission_delete-message":"Delete Message", - "permission_delete-message_description":"Permission to delete a message within a room", + "delete-message":"Delete Message", + "delete-message_description":"Permission to delete a message within a room", - "permission_delete-user":"Delete User", - "permission_delete-user_description":"Permission to delete users", + "delete-user":"Delete User", + "delete-user_description":"Permission to delete users", - "permission_edit-message":"Edit Message", - "permission_edit-message_description":"Permission to edit a message within a room", + "edit-message":"Edit Message", + "edit-message_description":"Permission to edit a message within a room", - "permission_edit-other-user-active-status":"Edit Other User Active Status", - "permission_edit-other-user-active-status_description":"Permission to enable or disable other accounts", + "edit-other-user-active-status":"Edit Other User Active Status", + "edit-other-user-active-status_description":"Permission to enable or disable other accounts", - "permission_edit-other-user-info":"Edit Other User Information", - "permission_edit-other-user-info_description":"Permission to change other user’s name, username or email address.", + "edit-other-user-info":"Edit Other User Information", + "edit-other-user-info_description":"Permission to change other user’s name, username or email address.", - "permission_edit-other-user-password":"Edit Other User Password", - "permission_edit-other-user-password_description":"Permission to modify other user’s passwords. Requires edit-other-user-info permission.", + "edit-other-user-password":"Edit Other User Password", + "edit-other-user-password_description":"Permission to modify other user’s passwords. Requires edit-other-user-info permission.", - "permission_edit-privileged-setting":"Edit privileged Setting", - "permission_edit-privileged-setting_description":"Permission to edit settings", + "edit-privileged-setting":"Edit privileged Setting", + "edit-privileged-setting_description":"Permission to edit settings", - "permission_edit-room":"Edit Room", - "permission_edit-room_description":"Permission to edit a room’s name, topic, type (private or public status) and status (active or archived)", + "edit-room":"Edit Room", + "edit-room_description":"Permission to edit a room’s name, topic, type (private or public status) and status (active or archived)", - "permission_force-delete-message":"Force Delete Message", - "permission_force-delete-message_description":"Permission to delete a message bypassing all restrictions", + "force-delete-message":"Force Delete Message", + "force-delete-message_description":"Permission to delete a message bypassing all restrictions", - "permission_join-without-join-code":"Join Without Join Code", - "permission_join-without-join-code_description":"Permission to bypass the join code in channels with join code enabled", + "join-without-join-code":"Join Without Join Code", + "join-without-join-code_description":"Permission to bypass the join code in channels with join code enabled", - "permission_mail-messages":"Mail Messages", - "permission_mail-messages_description":"Permission to use the mail messages option", + "mail-messages":"Mail Messages", + "mail-messages_description":"Permission to use the mail messages option", - "permission_manage-assets":"Manage Assets", - "permission_manage-assets_description":"Permission to manage the server assets", + "manage-assets":"Manage Assets", + "manage-assets_description":"Permission to manage the server assets", - "permission_manage-emoji":"Manage Emoji", - "permission_manage-emoji_description":"Permission to manage the server emojis", + "manage-emoji":"Manage Emoji", + "manage-emoji_description":"Permission to manage the server emojis", - "permission_manage-integrations":"Manage Integrations", - "permission_manage-integrations_description":"Permission to manage the server integrations", + "manage-integrations":"Manage Integrations", + "manage-integrations_description":"Permission to manage the server integrations", - "permission_manage-oauth-apps":"Manage Oauth Apps", - "permission_manage-oauth-apps_description":"Permission to manage the server Oauth apps", + "manage-oauth-apps":"Manage Oauth Apps", + "manage-oauth-apps_description":"Permission to manage the server Oauth apps", - "permission_manage-own-integrations":"Manage Own Integrations", - "permission_manage-own-integrations_description":"Permition to users create and edit their own integration or webhooks", + "manage-own-integrations":"Manage Own Integrations", + "manage-own-integrations_description":"Permition to users create and edit their own integration or webhooks", - "permission_manage-sounds":"Manage Sounds", - "permission_manage-sounds_description":"Permission to manage the server sounds", + "manage-sounds":"Manage Sounds", + "manage-sounds_description":"Permission to manage the server sounds", - "permission_mention-all":"Mention All", - "permission_mention-all_description":"Permission to use the @all mention", + "mention-all":"Mention All", + "mention-all_description":"Permission to use the @all mention", - "permission_mute-user":"Mute User", - "permission_mute-user_description":"Permission to mute other users in the same channel", + "mute-user":"Mute User", + "mute-user_description":"Permission to mute other users in the same channel", - "permission_pin-message":"Pin Message", - "permission_pin-message_description":"Permission to pin a message in a channel", + "pin-message":"Pin Message", + "pin-message_description":"Permission to pin a message in a channel", - "permission_post-readonly":"Post ReadOnly", - "permission_post-readonly_description":"Permission to post a message in a read-only channel", + "post-readonly":"Post ReadOnly", + "post-readonly_description":"Permission to post a message in a read-only channel", - "permission_preview-c-room":"Preview Public Channel", - "permission_preview-c-room_description":"Permission view the contents of a public channel before joining", + "preview-c-room":"Preview Public Channel", + "preview-c-room_description":"Permission view the contents of a public channel before joining", - "permission_remove-user":"Remove User", - "permission_remove-user_description":"Permission to remove a user from a room", - - "permission_run-import":"Run Import", - "permission_run-import_description":"Permission to run the importers", - - "permission_run-migration":"Run Migration", - "permission_run-migration_description":"Permission to run the migrations", - - "permission_save-others-livechat-room-info":"Save Others Livechat Room Info", - "permission_save-others-livechat-room-info_description":"Permission to save information from other livechat channels", - - "permission_set-moderator":"Set Moderator", - "permission_set-moderator_description":"Permission to set other users as moderator of a channel", - - "permission_set-owner":"Set Owner", - "permission_set-owner_description":"Permission to set other users as owner of a channel", - - "permission_set-react-when-readonly":"Set React When ReadOnly", - "permission_set-react-when-readonly_description":"Permission to set the ability to react to messages in a read only channel", - - "permission_set-readonly":"Set ReadOnly", - "permission_set-readonly_description":"Permission to set a channel to read only channel", - - "permission_snippet-message":"Snippet Message", - "permission_snippet-message_description":"Permission to create snippet message", - - "permission_unarchive-room":"Unarchive Room", - "permission_unarchive-room_description":"Permission to unarchive channels", - - "permission_user-generate-access-token":"User Generate Access Token", - "permission_user-generate-access-token_description":"Permission to users generate access tokens", - - "permission_view-c-room":"View Public Channel", - "permission_view-c-room_description":"Permission to view public channels", - - "permission_view-d-room":"View Direct Messages", - "permission_view-d-room_description":"Permission to view direct messages", - - "permission_view-full-other-user-info":"View Full Other User Info", - "permission_view-full-other-user-info_description":"Permission to view full profile of other users including account creation date, last login, etc.", - - "permission_view-history":"View History", - "permission_view-history_description":"Permission to view the channel history", - - "permission_view-join-code":"View Join Code", - "permission_view-join-code_description":"Permission to view the channel join code", - - "permission_view-joined-room":"View Joined Room", - "permission_view-joined-room_description":"Permission to view the currently joined channels", - - "permission_view-l-room":"View Livechat Room", - "permission_view-l-room_description":"Permission to view livechat channels", - - "permission_view-livechat-manager":"View Livechat Manager", - "permission_view-livechat-manager_description":"Permission to view other livechat managers", - - "permission_view-livechat-rooms":"View Livechat Rooms", - "permission_view-livechat-rooms_description":"Permission to view other livechat channels", - - "permission_view-logs":"View Logs", - "permission_view-logs_description":"Permission to view the server logs ", - - "permission_view-p-room":"View Private Room", - "permission_view-p-room_description":"Permission to view private channels", - - "permission_view-privileged-setting":"View Privileged Setting", - "permission_view-privileged-setting_description":"Permission to view settings", - - "permission_view-room-administration":"View Room Administration", - "permission_view-room-administration_description":"Permission to view public, private and direct message statistics. Does not include the ability to view conversations or archives", - - "permission_view-statistics":"View Private Room", - "permission_view-statistics_description":"Permission o view system statistics such as number of users logged in, number of rooms, operating system information", - - "permission_view-user-administration":"View User Administration", - "permission_view-user-administration_description":"Permission to partial, read-only list view of other user accounts currently logged into the system. No user account information is accessible with this permission", + "remove-user":"Remove User", + "remove-user_description":"Permission to remove a user from a room", + "run-import":"Run Import", + "run-import_description":"Permission to run the importers", + "run-migration":"Run Migration", + "run-migration_description":"Permission to run the migrations", + "save-others-livechat-room-info":"Save Others Livechat Room Info", + "save-others-livechat-room-info_description":"Permission to save information from other livechat channels", + "set-moderator":"Set Moderator", + "set-moderator_description":"Permission to set other users as moderator of a channel", + "set-owner":"Set Owner", + "set-owner_description":"Permission to set other users as owner of a channel", + "set-react-when-readonly":"Set React When ReadOnly", + "set-react-when-readonly_description":"Permission to set the ability to react to messages in a read only channel", + "set-readonly":"Set ReadOnly", + "set-readonly_description":"Permission to set a channel to read only channel", + "snippet-message":"Snippet Message", + "snippet-message_description":"Permission to create snippet message", + "unarchive-room":"Unarchive Room", + "unarchive-room_description":"Permission to unarchive channels", + "user-generate-access-token":"User Generate Access Token", + "user-generate-access-token_description":"Permission to users generate access tokens", + "view-c-room":"View Public Channel", + "view-c-room_description":"Permission to view public channels", + "view-d-room":"View Direct Messages", + "view-d-room_description":"Permission to view direct messages", + "view-full-other-user-info":"View Full Other User Info", + "view-full-other-user-info_description":"Permission to view full profile of other users including account creation date, last login, etc.", + "view-history":"View History", + "view-history_description":"Permission to view the channel history", + "view-join-code":"View Join Code", + "view-join-code_description":"Permission to view the channel join code", + "view-joined-room":"View Joined Room", + "view-joined-room_description":"Permission to view the currently joined channels", + "view-l-room":"View Livechat Rooms", + "view-l-room_description":"Permission to view livechat channels", + "view-livechat-manager":"View Livechat Manager", + "view-livechat-manager_description":"Permission to view other livechat managers", + "view-livechat-rooms":"View Livechat Rooms", + "view-livechat-rooms_description":"Permission to view other livechat channels", + "view-logs":"View Logs", + "view-logs_description":"Permission to view the server logs ", + "view-p-room":"View Private Room", + "view-p-room_description":"Permission to view private channels", + "view-privileged-setting":"View Privileged Setting", + "view-privileged-setting_description":"Permission to view settings", + "view-other-user-channels":"View Other User Channels", + "view-other-user-channels_description":"Permission to view channels owned by other users", + "view-room-administration":"View Room Administration", + "view-room-administration_description":"Permission to view public, private and direct message statistics. Does not include the ability to view conversations or archives", + "view-statistics":"View Private Room", + "view-statistics_description":"Permission o view system statistics such as number of users logged in, number of rooms, operating system information", + "view-user-administration":"View User Administration", + "view-user-administration_description":"Permission to partial, read-only list view of other user accounts currently logged into the system. No user account information is accessible with this permission", "Pin_Message": "Pin Message", "Pinned_a_message": "Pinned a message:", From b10d9968819fe663d23f03d8af5389187047dfa6 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Tue, 13 Jun 2017 13:39:04 -0300 Subject: [PATCH 21/78] clean up code --- packages/rocketchat-authorization/server/startup.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/rocketchat-authorization/server/startup.js b/packages/rocketchat-authorization/server/startup.js index d6f67a60b557..3fe7771125de 100644 --- a/packages/rocketchat-authorization/server/startup.js +++ b/packages/rocketchat-authorization/server/startup.js @@ -64,8 +64,6 @@ Meteor.startup(function() { { _id: 'preview-c-room', roles : ['admin', 'user', 'anonymous'] } ]; - //permissions.forEach(o => { o.i18nLabel = `permission_${ o._id }_description` ; }); - for (const permission of permissions) { if (!RocketChat.models.Permissions.findOneById(permission._id)) { RocketChat.models.Permissions.upsert(permission._id, {$set: permission }); From ff4aa355abf07617cd5c80dd2e2c7c95767a4d6b Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Wed, 14 Jun 2017 10:43:03 -0500 Subject: [PATCH 22/78] [FIX] Turn Off Debug for CacheCollections Reduce the amount of `console.log`'s that we do. --- packages/rocketchat-lib/client/lib/cachedCollection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rocketchat-lib/client/lib/cachedCollection.js b/packages/rocketchat-lib/client/lib/cachedCollection.js index 6a9d9db88e05..beb3d4995fe2 100644 --- a/packages/rocketchat-lib/client/lib/cachedCollection.js +++ b/packages/rocketchat-lib/client/lib/cachedCollection.js @@ -97,7 +97,7 @@ class CachedCollection { userRelated = true, useSync = true, useCache = true, - debug = true, + debug = false, version = 6, maxCacheTime = 60*60*24*30 }) { From 79efe8388553a271c23551ae08a4ef96b82f5277 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Fri, 16 Jun 2017 12:11:22 -0300 Subject: [PATCH 23/78] Fix default rooms --- packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js b/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js index dd2ca493ca4e..9c8d75fd9f0d 100644 --- a/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js +++ b/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js @@ -19,7 +19,7 @@ Template.adminRoomInfo.helpers({ return room && room.t; }, channelSettings() { - return RocketChat.ChannelSettings.getOptions(null, 'admin-room'); + return RocketChat.ChannelSettings.getOptions(Session.get('adminRoomsSelected'), 'admin-room'); }, roomTypeDescription() { const room = AdminChatRoom.findOne(this.rid, { fields: { t: 1 } }); From b467ec28f5b1ede66416c530f91174d1d06370fb Mon Sep 17 00:00:00 2001 From: Gabriel Delavald Date: Fri, 16 Jun 2017 15:47:21 -0300 Subject: [PATCH 24/78] Adds settings to limit chain of quotes --- packages/rocketchat-lib/server/startup/settings.js | 5 +++++ packages/rocketchat-oembed/server/jumpToMessage.js | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/packages/rocketchat-lib/server/startup/settings.js b/packages/rocketchat-lib/server/startup/settings.js index 1671d5185bee..9f6d4cec72ff 100644 --- a/packages/rocketchat-lib/server/startup/settings.js +++ b/packages/rocketchat-lib/server/startup/settings.js @@ -806,6 +806,10 @@ RocketChat.settings.addGroup('Message', function() { 'public': true, i18nDescription: 'Message_TimeAndDateFormat_Description' }); + this.add('Message_QuoteChainLimit', 2, { + type: 'int', + 'public': true + }); this.add('Message_HideType_uj', false, { type: 'boolean', 'public': true @@ -822,6 +826,7 @@ RocketChat.settings.addGroup('Message', function() { type: 'boolean', 'public': true }); + return this.add('Message_HideType_mute_unmute', false, { type: 'boolean', 'public': true diff --git a/packages/rocketchat-oembed/server/jumpToMessage.js b/packages/rocketchat-oembed/server/jumpToMessage.js index 2cb673cb3a9b..2f9c44a28961 100644 --- a/packages/rocketchat-oembed/server/jumpToMessage.js +++ b/packages/rocketchat-oembed/server/jumpToMessage.js @@ -13,6 +13,17 @@ RocketChat.callbacks.add('beforeSaveMessage', (msg) => { if (_.isString(queryString.msg)) { // Jump-to query param const jumpToMessage = RocketChat.models.Messages.findOneById(queryString.msg); if (jumpToMessage) { + let chainQuotes = jumpToMessage; + let index = 1; + while (chainQuotes && 'attachments' in chainQuotes) { + if(index >= RocketChat.settings.get('Message_QuoteChainLimit')) { + delete(chainQuotes.attachments); + break; + } + chainQuotes = chainQuotes.attachments[0]; + index++; + } + msg.attachments = msg.attachments || []; msg.attachments.push({ 'text' : jumpToMessage.msg, From 59478697c01f2446ccfe5ebc5ff07e244ea85097 Mon Sep 17 00:00:00 2001 From: Gabriel Delavald Date: Fri, 16 Jun 2017 16:20:07 -0300 Subject: [PATCH 25/78] Adds text for Message_QuoteChainLimit setting --- packages/rocketchat-i18n/i18n/en.i18n.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/rocketchat-i18n/i18n/en.i18n.json b/packages/rocketchat-i18n/i18n/en.i18n.json index 1b2888536b9a..8a99a635c133 100644 --- a/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/packages/rocketchat-i18n/i18n/en.i18n.json @@ -1006,6 +1006,7 @@ "Message_MaxAll": "Maximum channel size for ALL message", "Message_MaxAllowedSize": "Maximum Allowed Message Size", "Message_pinning": "Message pinning", + "Message_QuoteChainLimit": "Maximum Number of Chained Quotes", "Message_removed": "Message removed", "Message_SetNameToAliasEnabled": "Set a user name to alias in message", "Message_SetNameToAliasEnabled_Description": "Only if not already set alias. The old messages alias not changed if user has changed the name.", From 1730c28686255aa8dea19aa2ac89922fd9379b45 Mon Sep 17 00:00:00 2001 From: Gabriel Delavald Date: Fri, 16 Jun 2017 16:32:27 -0300 Subject: [PATCH 26/78] fixing codacy lint review --- packages/rocketchat-oembed/server/jumpToMessage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rocketchat-oembed/server/jumpToMessage.js b/packages/rocketchat-oembed/server/jumpToMessage.js index 2f9c44a28961..b891d412094d 100644 --- a/packages/rocketchat-oembed/server/jumpToMessage.js +++ b/packages/rocketchat-oembed/server/jumpToMessage.js @@ -16,7 +16,7 @@ RocketChat.callbacks.add('beforeSaveMessage', (msg) => { let chainQuotes = jumpToMessage; let index = 1; while (chainQuotes && 'attachments' in chainQuotes) { - if(index >= RocketChat.settings.get('Message_QuoteChainLimit')) { + if (index >= RocketChat.settings.get('Message_QuoteChainLimit')) { delete(chainQuotes.attachments); break; } From 9f878542b26bf529dc8377bfaac284d355991362 Mon Sep 17 00:00:00 2001 From: Danilo Miranda Date: Sun, 18 Jun 2017 13:22:37 -0300 Subject: [PATCH 27/78] Implement the /help slashcommand --- .meteor/packages | 1 + .meteor/versions | 1 + packages/rocketchat-i18n/i18n/en.i18n.json | 6 +++ packages/rocketchat-i18n/i18n/pt.i18n.json | 6 +++ .../rocketchat-slashcommands-help/client.js | 3 ++ .../rocketchat-slashcommands-help/package.js | 20 ++++++++ .../rocketchat-slashcommands-help/server.js | 49 +++++++++++++++++++ 7 files changed, 86 insertions(+) create mode 100644 packages/rocketchat-slashcommands-help/client.js create mode 100644 packages/rocketchat-slashcommands-help/package.js create mode 100644 packages/rocketchat-slashcommands-help/server.js diff --git a/.meteor/packages b/.meteor/packages index 3f68c4b3e137..5bedbfb892c3 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -98,6 +98,7 @@ rocketchat:slackbridge rocketchat:slashcommands-archive rocketchat:slashcommands-asciiarts rocketchat:slashcommands-create +rocketchat:slashcommands-help rocketchat:slashcommands-invite rocketchat:slashcommands-invite-all rocketchat:slashcommands-join diff --git a/.meteor/versions b/.meteor/versions index 95e7532c543a..97fc40d26426 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -188,6 +188,7 @@ rocketchat:slackbridge@0.0.1 rocketchat:slashcommands-archive@0.0.1 rocketchat:slashcommands-asciiarts@0.0.1 rocketchat:slashcommands-create@0.0.1 +rocketchat:slashcommands-help@0.0.1 rocketchat:slashcommands-invite@0.0.1 rocketchat:slashcommands-invite-all@0.0.1 rocketchat:slashcommands-join@0.0.1 diff --git a/packages/rocketchat-i18n/i18n/en.i18n.json b/packages/rocketchat-i18n/i18n/en.i18n.json index 1b2888536b9a..c8f0a22f747d 100644 --- a/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/packages/rocketchat-i18n/i18n/en.i18n.json @@ -807,6 +807,12 @@ "Join_default_channels": "Join default channels", "Join_the_Community": "Join the Community", "Join_the_given_channel": "Join the given channel", + "Show_the_keyboard_shortcut_list": "Show the keyboard shortcut list", + "Open_channel_user_search": "`%s` - Open Channel / User search", + "Edit_previous_message": "`%s` - Edit previous message", + "Move_beginning_message": "`%s` - Move to the beginning of the message", + "Move_end_message": "`%s` - Move to the end of the message", + "New_line_message_compose_input": "`%s` - New line in message compose input", "Join_video_call": "Join video call", "Joined": "Joined", "Jump": "Jump", diff --git a/packages/rocketchat-i18n/i18n/pt.i18n.json b/packages/rocketchat-i18n/i18n/pt.i18n.json index bcec56545ecb..9fddeb353ec7 100644 --- a/packages/rocketchat-i18n/i18n/pt.i18n.json +++ b/packages/rocketchat-i18n/i18n/pt.i18n.json @@ -631,6 +631,12 @@ "Join_default_channels": "Entrar em canais predefinidos", "Join_the_Community": "Junte-se à Comunidade", "Join_the_given_channel": "Entrar no canal informado", + "Show_the_keyboard_shortcut_list": "Exibe a lisgta de atalhos do teclado", + "Open_channel_user_search": "`%s` - Abrir Canal / Busca de Usuário", + "Edit_previous_message": "`%s` - Editar mensagem anterior", + "Move_beginning_message": "`%s` - Ir para o início da mensagem", + "Move_end_message": "`%s` - Ir para o fim da mensagem", + "New_line_message_compose_input": "`%s` - Adicionar nova linha a mensagem", "Join_video_call": "Entrar na chamada de vídeo", "Joined": "Entrou", "Jump": "Saltar", diff --git a/packages/rocketchat-slashcommands-help/client.js b/packages/rocketchat-slashcommands-help/client.js new file mode 100644 index 000000000000..5f26f43b21b1 --- /dev/null +++ b/packages/rocketchat-slashcommands-help/client.js @@ -0,0 +1,3 @@ +RocketChat.slashCommands.add('help', undefined, { + description: 'Show_the_keyboard_shortcut_list' +}); diff --git a/packages/rocketchat-slashcommands-help/package.js b/packages/rocketchat-slashcommands-help/package.js new file mode 100644 index 000000000000..f8cdabea9deb --- /dev/null +++ b/packages/rocketchat-slashcommands-help/package.js @@ -0,0 +1,20 @@ +Package.describe({ + name: 'rocketchat:slashcommands-help', + version: '0.0.1', + summary: 'Command handler for the /help command', + git: '' +}); + +Package.onUse(function(api) { + + api.use([ + 'ecmascript', + 'check', + 'rocketchat:lib' + ]); + + api.use('templating', 'client'); + + api.addFiles('client.js', 'client'); + api.addFiles('server.js', 'server'); +}); diff --git a/packages/rocketchat-slashcommands-help/server.js b/packages/rocketchat-slashcommands-help/server.js new file mode 100644 index 000000000000..293fea8d0aaa --- /dev/null +++ b/packages/rocketchat-slashcommands-help/server.js @@ -0,0 +1,49 @@ + +/* +* Help is a named function that will replace /join commands +* @param {Object} message - The message object +*/ + + +RocketChat.slashCommands.add('help', function Help(command, params, item) { + + if ( command !== 'help' ) { + return; + } + const user = Meteor.users.findOne(Meteor.userId()); + const keys = [{ + 'Open_channel_user_search': 'Command (or Ctrl) + p OR Command (or Ctrl) + k' + }, + { + 'Edit_previous_message': 'Up Arrow' + }, + { + 'Move_beginning_message': 'Command (or Alt) + Left Arrow' + }, + { + 'Move_beginning_message': 'Command (or Alt) + Up Arrow' + }, + { + 'Move_end_message': 'Command (or Alt) + Right Arrow' + }, + { + 'Move_end_message': 'Command (or Alt) + Down Arrow' + }, + { + 'New_line_message_compose_input': 'Shift + Enter' + } + ] + keys.map((key) => { + console.log(key[Object.keys(key)[0]]) + RocketChat.Notifications.notifyUser(Meteor.userId(), 'message', { + _id: Random.id(), + rid: item.rid, + ts: new Date, + msg: TAPi18n.__(Object.keys(key)[0], { + postProcess: 'sprintf', + sprintf: [key[Object.keys(key)[0]]] + }, user.language) + }); + }); + +}); From d52824b6f3a94826aff32fe470348ad27c4f6cfe Mon Sep 17 00:00:00 2001 From: Danilo Miranda Date: Mon, 19 Jun 2017 09:42:59 -0300 Subject: [PATCH 28/78] Correct some code style guides --- packages/rocketchat-slashcommands-help/server.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/rocketchat-slashcommands-help/server.js b/packages/rocketchat-slashcommands-help/server.js index 293fea8d0aaa..ff7e61af5d00 100644 --- a/packages/rocketchat-slashcommands-help/server.js +++ b/packages/rocketchat-slashcommands-help/server.js @@ -7,7 +7,7 @@ RocketChat.slashCommands.add('help', function Help(command, params, item) { - if ( command !== 'help' ) { + if (command !== 'help') { return; } const user = Meteor.users.findOne(Meteor.userId()); @@ -32,9 +32,8 @@ RocketChat.slashCommands.add('help', function Help(command, params, item) { { 'New_line_message_compose_input': 'Shift + Enter' } - ] + ]; keys.map((key) => { - console.log(key[Object.keys(key)[0]]) RocketChat.Notifications.notifyUser(Meteor.userId(), 'message', { _id: Random.id(), rid: item.rid, From b343f947028124737f623e4f683130f6049b6fff Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Mon, 19 Jun 2017 12:58:57 -0300 Subject: [PATCH 29/78] fix make-default --- .../client/lib/ChannelSettings.js | 7 ++++--- packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/rocketchat-channel-settings/client/lib/ChannelSettings.js b/packages/rocketchat-channel-settings/client/lib/ChannelSettings.js index 1b222ab39356..39545fce6e9e 100644 --- a/packages/rocketchat-channel-settings/client/lib/ChannelSettings.js +++ b/packages/rocketchat-channel-settings/client/lib/ChannelSettings.js @@ -21,12 +21,13 @@ RocketChat.ChannelSettings = new class { }); } - getOptions(currentData, group) { + getOptions(currentData = {}, group) { const allOptions = _.toArray(this.options.get()); const allowedOptions = _.compact(_.map(allOptions, function(option) { + const ret = {...option}; if (option.validation == null || option.validation()) { - option.data = Object.assign({}, typeof option.data === 'function' ? option.data() : option.data, currentData); - return option; + ret.data = Object.assign({}, typeof option.data === 'function' ? option.data() : option.data, currentData); + return ret; } })).filter(function(option) { return !group || !option.group || option.group.includes(group); diff --git a/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js b/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js index 9c8d75fd9f0d..260a1ed42c55 100644 --- a/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js +++ b/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js @@ -19,7 +19,7 @@ Template.adminRoomInfo.helpers({ return room && room.t; }, channelSettings() { - return RocketChat.ChannelSettings.getOptions(Session.get('adminRoomsSelected'), 'admin-room'); + return RocketChat.ChannelSettings.getOptions(undefined, 'admin-room'); }, roomTypeDescription() { const room = AdminChatRoom.findOne(this.rid, { fields: { t: 1 } }); From 23f09eb13930f8afa98c5ead4af022263b6e36d2 Mon Sep 17 00:00:00 2001 From: Gabriel Delavald Date: Tue, 20 Jun 2017 14:35:59 -0300 Subject: [PATCH 30/78] Refactor into recursive solution to purge all attachments from message --- .../rocketchat-oembed/server/jumpToMessage.js | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/rocketchat-oembed/server/jumpToMessage.js b/packages/rocketchat-oembed/server/jumpToMessage.js index b891d412094d..6f3768f054a5 100644 --- a/packages/rocketchat-oembed/server/jumpToMessage.js +++ b/packages/rocketchat-oembed/server/jumpToMessage.js @@ -2,6 +2,17 @@ const URL = Npm.require('url'); const QueryString = Npm.require('querystring'); +const recursiveRemove = + (message, deep = 0) => { + if(message) { + if('attachments' in message && deep < RocketChat.settings.get('Message_QuoteChainLimit')) { + message.attachments.map((msg) => recursiveRemove(msg, deep + 1)); + } else { + delete(message.attachments); + } + } + return message; + } RocketChat.callbacks.add('beforeSaveMessage', (msg) => { if (msg && msg.urls) { @@ -11,19 +22,8 @@ RocketChat.callbacks.add('beforeSaveMessage', (msg) => { if (urlObj.query) { const queryString = QueryString.parse(urlObj.query); if (_.isString(queryString.msg)) { // Jump-to query param - const jumpToMessage = RocketChat.models.Messages.findOneById(queryString.msg); + const jumpToMessage = recursiveRemove(RocketChat.models.Messages.findOneById(queryString.msg)); if (jumpToMessage) { - let chainQuotes = jumpToMessage; - let index = 1; - while (chainQuotes && 'attachments' in chainQuotes) { - if (index >= RocketChat.settings.get('Message_QuoteChainLimit')) { - delete(chainQuotes.attachments); - break; - } - chainQuotes = chainQuotes.attachments[0]; - index++; - } - msg.attachments = msg.attachments || []; msg.attachments.push({ 'text' : jumpToMessage.msg, From 8dced4345224ba636de2f07c58810c8932471344 Mon Sep 17 00:00:00 2001 From: Gabriel Delavald Date: Tue, 20 Jun 2017 14:45:11 -0300 Subject: [PATCH 31/78] codacy bot hates me --- .../rocketchat-oembed/server/jumpToMessage.js | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/packages/rocketchat-oembed/server/jumpToMessage.js b/packages/rocketchat-oembed/server/jumpToMessage.js index 6f3768f054a5..795974ffd6e7 100644 --- a/packages/rocketchat-oembed/server/jumpToMessage.js +++ b/packages/rocketchat-oembed/server/jumpToMessage.js @@ -2,17 +2,16 @@ const URL = Npm.require('url'); const QueryString = Npm.require('querystring'); -const recursiveRemove = - (message, deep = 0) => { - if(message) { - if('attachments' in message && deep < RocketChat.settings.get('Message_QuoteChainLimit')) { - message.attachments.map((msg) => recursiveRemove(msg, deep + 1)); - } else { - delete(message.attachments); - } - } - return message; - } +const recursiveRemove = (message, deep = 0) => { + if (message) { + if ('attachments' in message && deep < RocketChat.settings.get('Message_QuoteChainLimit')) { + message.attachments.map((msg) => recursiveRemove(msg, deep + 1)); + } else { + delete(message.attachments); + } + } + return message; +} RocketChat.callbacks.add('beforeSaveMessage', (msg) => { if (msg && msg.urls) { From 5d6aaf1e0a594e5d2985dc3cb0cde0820e8c94b3 Mon Sep 17 00:00:00 2001 From: Gabriel Delavald Date: Tue, 20 Jun 2017 15:31:05 -0300 Subject: [PATCH 32/78] CI hates me --- packages/rocketchat-oembed/server/jumpToMessage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rocketchat-oembed/server/jumpToMessage.js b/packages/rocketchat-oembed/server/jumpToMessage.js index 795974ffd6e7..1871512eea78 100644 --- a/packages/rocketchat-oembed/server/jumpToMessage.js +++ b/packages/rocketchat-oembed/server/jumpToMessage.js @@ -11,7 +11,7 @@ const recursiveRemove = (message, deep = 0) => { } } return message; -} +}; RocketChat.callbacks.add('beforeSaveMessage', (msg) => { if (msg && msg.urls) { From 32c48bb8eeb69a3b8528452c0c8d59dc8e3020a0 Mon Sep 17 00:00:00 2001 From: Gabriel Delavald Date: Tue, 20 Jun 2017 16:34:01 -0300 Subject: [PATCH 33/78] small fix --- packages/rocketchat-oembed/server/jumpToMessage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rocketchat-oembed/server/jumpToMessage.js b/packages/rocketchat-oembed/server/jumpToMessage.js index 1871512eea78..0167878c3b0c 100644 --- a/packages/rocketchat-oembed/server/jumpToMessage.js +++ b/packages/rocketchat-oembed/server/jumpToMessage.js @@ -2,7 +2,7 @@ const URL = Npm.require('url'); const QueryString = Npm.require('querystring'); -const recursiveRemove = (message, deep = 0) => { +const recursiveRemove = (message, deep = 1) => { if (message) { if ('attachments' in message && deep < RocketChat.settings.get('Message_QuoteChainLimit')) { message.attachments.map((msg) => recursiveRemove(msg, deep + 1)); From e7e07851161e3831b202b995132e8c409f67c00a Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Wed, 21 Jun 2017 18:10:31 -0300 Subject: [PATCH 34/78] [FIX] Proxy upload to correct instance Proxy the file upload parts to the instance who created the file when running with multiple instances to prevent errors when sticky sessions does not works. --- .../rocketchat-lib/server/models/Avatars.js | 6 ++ .../rocketchat-lib/server/models/Uploads.js | 6 ++ server/startup/avatar.js | 93 ++++++++++++++++++- 3 files changed, 104 insertions(+), 1 deletion(-) diff --git a/packages/rocketchat-lib/server/models/Avatars.js b/packages/rocketchat-lib/server/models/Avatars.js index 43c7b6be6af6..76d88df19f1e 100644 --- a/packages/rocketchat-lib/server/models/Avatars.js +++ b/packages/rocketchat-lib/server/models/Avatars.js @@ -1,7 +1,13 @@ +/* globals InstanceStatus */ + RocketChat.models.Avatars = new class extends RocketChat.models._Base { constructor() { super('avatars'); + this.model.before.insert((userId, doc) => { + doc.instanceId = InstanceStatus.id(); + }); + this.tryEnsureIndex({ name: 1 }); } diff --git a/packages/rocketchat-lib/server/models/Uploads.js b/packages/rocketchat-lib/server/models/Uploads.js index 3beaec043b8e..34d1dc6b9ea5 100644 --- a/packages/rocketchat-lib/server/models/Uploads.js +++ b/packages/rocketchat-lib/server/models/Uploads.js @@ -1,7 +1,13 @@ +/* globals InstanceStatus */ + RocketChat.models.Uploads = new class extends RocketChat.models._Base { constructor() { super('uploads'); + this.model.before.insert((userId, doc) => { + doc.instanceId = InstanceStatus.id(); + }); + this.tryEnsureIndex({ 'rid': 1 }); this.tryEnsureIndex({ 'uploadedAt': 1 }); } diff --git a/server/startup/avatar.js b/server/startup/avatar.js index 6c1bcab47b67..eceb9f0aa7bc 100644 --- a/server/startup/avatar.js +++ b/server/startup/avatar.js @@ -1,4 +1,95 @@ -/* globals FileUpload */ +/* globals FileUpload, UploadFS, InstanceStatus */ + +import http from 'http'; +import URL from 'url'; + +const logger = new Logger('UploadProxy'); + +WebApp.connectHandlers.stack.unshift({ + route: '', + handle: Meteor.bindEnvironment(function(req, res, next) { + // Quick check to see if request should be catch + if (req.url.indexOf(UploadFS.config.storesPath) === -1) { + return next(); + } + + logger.debug('Upload URL:', req.url); + + if (req.method !== 'POST') { + return next(); + } + + // Remove store path + const parsedUrl = URL.parse(req.url); + const path = parsedUrl.pathname.substr(UploadFS.config.storesPath.length + 1); + + // Get store + const regExp = new RegExp('^\/([^\/\?]+)\/([^\/\?]+)$'); + const match = regExp.exec(path); + + // Request is not valid + if (match === null) { + res.writeHead(400); + res.end(); + return; + } + + // Get store + const store = UploadFS.getStore(match[1]); + if (!store) { + res.writeHead(404); + res.end(); + return; + } + + // Get file + const fileId = match[2]; + const file = store.getCollection().findOne({_id: fileId}); + if (file === undefined) { + res.writeHead(404); + res.end(); + return; + } + + if (file.instanceId === InstanceStatus.id()) { + logger.debug('Correct instance'); + return next(); + } + + // Proxy to other instance + const instance = InstanceStatus.getCollection().findOne({_id: file.instanceId}); + + if (instance == null) { + res.writeHead(404); + res.end(); + return; + } + + if (instance.extraInformation.host === process.env.INSTANCE_IP && RocketChat.isDocker() === false) { + instance.extraInformation.host = 'localhost'; + } + + logger.debug('Wrong instance, proxing to:', `${ instance.extraInformation.host }:${ instance.extraInformation.port }`); + + const options = { + hostname: instance.extraInformation.host, + port: instance.extraInformation.port, + path: req.url, + method: 'POST' + }; + + const proxy = http.request(options, function(proxy_res) { + proxy_res.pipe(res, { + end: true + }); + }); + + req.pipe(proxy, { + end: true + }); + }) +}); + Meteor.startup(function() { WebApp.connectHandlers.use('/avatar/', Meteor.bindEnvironment(function(req, res/*, next*/) { const params = { From f96832cfc87c3eaa172aab986e689b4df80c53e3 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Thu, 22 Jun 2017 18:12:09 -0300 Subject: [PATCH 35/78] Move code to correct place --- packages/rocketchat-file-upload/package.js | 1 + .../server/lib/proxy.js | 91 ++++++++++++++++++ server/startup/avatar.js | 92 +------------------ 3 files changed, 93 insertions(+), 91 deletions(-) create mode 100644 packages/rocketchat-file-upload/server/lib/proxy.js diff --git a/packages/rocketchat-file-upload/package.js b/packages/rocketchat-file-upload/package.js index 85e698199a4a..91951ea1076b 100644 --- a/packages/rocketchat-file-upload/package.js +++ b/packages/rocketchat-file-upload/package.js @@ -31,6 +31,7 @@ Package.onUse(function(api) { api.addFiles('client/lib/fileUploadHandler.js', 'client'); api.addFiles('server/lib/FileUpload.js', 'server'); + api.addFiles('server/lib/proxy.js', 'server'); api.addFiles('server/lib/requests.js', 'server'); api.addFiles('server/config/_configUploadStorage.js', 'server'); diff --git a/packages/rocketchat-file-upload/server/lib/proxy.js b/packages/rocketchat-file-upload/server/lib/proxy.js new file mode 100644 index 000000000000..c5636478c757 --- /dev/null +++ b/packages/rocketchat-file-upload/server/lib/proxy.js @@ -0,0 +1,91 @@ +/* globals UploadFS, InstanceStatus */ + +import http from 'http'; +import URL from 'url'; + +const logger = new Logger('UploadProxy'); + +WebApp.connectHandlers.stack.unshift({ + route: '', + handle: Meteor.bindEnvironment(function(req, res, next) { + // Quick check to see if request should be catch + if (req.url.indexOf(UploadFS.config.storesPath) === -1) { + return next(); + } + + logger.debug('Upload URL:', req.url); + + if (req.method !== 'POST') { + return next(); + } + + // Remove store path + const parsedUrl = URL.parse(req.url); + const path = parsedUrl.pathname.substr(UploadFS.config.storesPath.length + 1); + + // Get store + const regExp = new RegExp('^\/([^\/\?]+)\/([^\/\?]+)$'); + const match = regExp.exec(path); + + // Request is not valid + if (match === null) { + res.writeHead(400); + res.end(); + return; + } + + // Get store + const store = UploadFS.getStore(match[1]); + if (!store) { + res.writeHead(404); + res.end(); + return; + } + + // Get file + const fileId = match[2]; + const file = store.getCollection().findOne({_id: fileId}); + if (file === undefined) { + res.writeHead(404); + res.end(); + return; + } + + if (file.instanceId === InstanceStatus.id()) { + logger.debug('Correct instance'); + return next(); + } + + // Proxy to other instance + const instance = InstanceStatus.getCollection().findOne({_id: file.instanceId}); + + if (instance == null) { + res.writeHead(404); + res.end(); + return; + } + + if (instance.extraInformation.host === process.env.INSTANCE_IP && RocketChat.isDocker() === false) { + instance.extraInformation.host = 'localhost'; + } + + logger.debug('Wrong instance, proxing to:', `${ instance.extraInformation.host }:${ instance.extraInformation.port }`); + + const options = { + hostname: instance.extraInformation.host, + port: instance.extraInformation.port, + path: req.url, + method: 'POST' + }; + + const proxy = http.request(options, function(proxy_res) { + proxy_res.pipe(res, { + end: true + }); + }); + + req.pipe(proxy, { + end: true + }); + }) +}); diff --git a/server/startup/avatar.js b/server/startup/avatar.js index eceb9f0aa7bc..24e29960fa43 100644 --- a/server/startup/avatar.js +++ b/server/startup/avatar.js @@ -1,94 +1,4 @@ -/* globals FileUpload, UploadFS, InstanceStatus */ - -import http from 'http'; -import URL from 'url'; - -const logger = new Logger('UploadProxy'); - -WebApp.connectHandlers.stack.unshift({ - route: '', - handle: Meteor.bindEnvironment(function(req, res, next) { - // Quick check to see if request should be catch - if (req.url.indexOf(UploadFS.config.storesPath) === -1) { - return next(); - } - - logger.debug('Upload URL:', req.url); - - if (req.method !== 'POST') { - return next(); - } - - // Remove store path - const parsedUrl = URL.parse(req.url); - const path = parsedUrl.pathname.substr(UploadFS.config.storesPath.length + 1); - - // Get store - const regExp = new RegExp('^\/([^\/\?]+)\/([^\/\?]+)$'); - const match = regExp.exec(path); - - // Request is not valid - if (match === null) { - res.writeHead(400); - res.end(); - return; - } - - // Get store - const store = UploadFS.getStore(match[1]); - if (!store) { - res.writeHead(404); - res.end(); - return; - } - - // Get file - const fileId = match[2]; - const file = store.getCollection().findOne({_id: fileId}); - if (file === undefined) { - res.writeHead(404); - res.end(); - return; - } - - if (file.instanceId === InstanceStatus.id()) { - logger.debug('Correct instance'); - return next(); - } - - // Proxy to other instance - const instance = InstanceStatus.getCollection().findOne({_id: file.instanceId}); - - if (instance == null) { - res.writeHead(404); - res.end(); - return; - } - - if (instance.extraInformation.host === process.env.INSTANCE_IP && RocketChat.isDocker() === false) { - instance.extraInformation.host = 'localhost'; - } - - logger.debug('Wrong instance, proxing to:', `${ instance.extraInformation.host }:${ instance.extraInformation.port }`); - - const options = { - hostname: instance.extraInformation.host, - port: instance.extraInformation.port, - path: req.url, - method: 'POST' - }; - - const proxy = http.request(options, function(proxy_res) { - proxy_res.pipe(res, { - end: true - }); - }); - - req.pipe(proxy, { - end: true - }); - }) -}); +/* globals FileUpload */ Meteor.startup(function() { WebApp.connectHandlers.use('/avatar/', Meteor.bindEnvironment(function(req, res/*, next*/) { From 4f67731ed566d5796ddfd9aabb16d124edd8846f Mon Sep 17 00:00:00 2001 From: Luigi Teschio Date: Fri, 23 Jun 2017 09:23:28 +0200 Subject: [PATCH 36/78] FIX #7316 --- server/publications/activeUsers.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server/publications/activeUsers.js b/server/publications/activeUsers.js index 9ca4d82d0859..26146e01a4a7 100644 --- a/server/publications/activeUsers.js +++ b/server/publications/activeUsers.js @@ -6,6 +6,7 @@ Meteor.publish('activeUsers', function() { return RocketChat.models.Users.findUsersNotOffline({ fields: { username: 1, + name: 1, status: 1, utcOffset: 1 } From f6bf32a9ac52dfd7bce40e02c03ace6e0f802ed5 Mon Sep 17 00:00:00 2001 From: Pedro Lacerda Date: Fri, 23 Jun 2017 09:19:21 -0300 Subject: [PATCH 37/78] Fixing translation of Away to Ausente instead of ausente in PT and PT-BR. --- packages/rocketchat-i18n/i18n/pt-BR.i18n.json | 4 ++-- packages/rocketchat-i18n/i18n/pt.i18n.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/rocketchat-i18n/i18n/pt-BR.i18n.json b/packages/rocketchat-i18n/i18n/pt-BR.i18n.json index f34f587d3c20..dd6d9b984607 100644 --- a/packages/rocketchat-i18n/i18n/pt-BR.i18n.json +++ b/packages/rocketchat-i18n/i18n/pt-BR.i18n.json @@ -202,7 +202,7 @@ "away_female": "ausente", "Away_female": "Ausente", "away_male": "ausente", - "Away_male": "ausente", + "Away_male": "Ausente", "Back": "Voltar", "Back_to_applications": "Voltar para aplicações", "Back_to_integrations": "Voltar para integrações", @@ -1309,4 +1309,4 @@ "your_message_optional": "sua mensagem (opcional)", "Your_password_is_wrong": "Sua senha está errada!", "Your_push_was_sent_to_s_devices": "Sua natificação foi enviada para %s dispositivos" -} \ No newline at end of file +} diff --git a/packages/rocketchat-i18n/i18n/pt.i18n.json b/packages/rocketchat-i18n/i18n/pt.i18n.json index bcec56545ecb..26da941d928b 100644 --- a/packages/rocketchat-i18n/i18n/pt.i18n.json +++ b/packages/rocketchat-i18n/i18n/pt.i18n.json @@ -221,7 +221,7 @@ "away_female": "ausente", "Away_female": "Ausente", "away_male": "ausente", - "Away_male": "ausente", + "Away_male": "Ausente", "Back": "Voltar", "Back_to_applications": "Voltar para aplicações", "Back_to_integrations": "Voltar para integrações", @@ -1347,4 +1347,4 @@ "your_message_optional": "sua mensagem (opcional)", "Your_password_is_wrong": "Sua senha está errada!", "Your_push_was_sent_to_s_devices": "Sua natificação foi enviada para %s dispositivos" -} \ No newline at end of file +} From f1e9f703bc2d8dadff39c2e1b9f41ef76373a388 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Fri, 23 Jun 2017 14:42:23 -0300 Subject: [PATCH 38/78] Merge pull request #7321 from RocketChat/fix-secret-url [FIX] Fix Secret Url --- packages/rocketchat-ui/client/views/app/secretURL.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rocketchat-ui/client/views/app/secretURL.js b/packages/rocketchat-ui/client/views/app/secretURL.js index 84d689d8caec..d17c786daf15 100644 --- a/packages/rocketchat-ui/client/views/app/secretURL.js +++ b/packages/rocketchat-ui/client/views/app/secretURL.js @@ -5,8 +5,8 @@ Template.secretURL.helpers({ return RocketChat.settings.get('Accounts_RegistrationForm') === 'Secret URL' && hashIsValid && hashIsValid.get(); }, ready() { - const {subscriptionsReady, hashReady} = Template.instance(); - return typeof subscriptionsReady === 'function' && subscriptionsReady() && hashReady && hashReady.get(); + const instance = Template.instance(); + return typeof instance.subscriptionsReady === 'function' && instance.subscriptionsReady() && instance.hashReady && instance.hashReady.get(); } }); From be26b37c81f3eaf41ac7b3bf8c60d231e6667ad2 Mon Sep 17 00:00:00 2001 From: Jan Marker Date: Sat, 24 Jun 2017 19:44:33 +0800 Subject: [PATCH 39/78] Add ref="noopener noreferrer" to Markdown links Links created by autolinker already have these attributes. However, links created via Markdown [title](link) or didn't have these. --- packages/rocketchat-markdown/markdown.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/rocketchat-markdown/markdown.js b/packages/rocketchat-markdown/markdown.js index 5f0269f99fac..0f04a7847fe8 100644 --- a/packages/rocketchat-markdown/markdown.js +++ b/packages/rocketchat-markdown/markdown.js @@ -53,19 +53,19 @@ class MarkdownClass { // Support ![alt text](http://image url) msg = msg.replace(new RegExp(`!\\[([^\\]]+)\\]\\(((?:${ schemes }):\\/\\/[^\\)]+)\\)`, 'gm'), function(match, title, url) { const target = url.indexOf(Meteor.absoluteUrl()) === 0 ? '' : '_blank'; - return `
`; + return `
`; }); // Support [Text](http://link) msg = msg.replace(new RegExp(`\\[([^\\]]+)\\]\\(((?:${ schemes }):\\/\\/[^\\)]+)\\)`, 'gm'), function(match, title, url) { const target = url.indexOf(Meteor.absoluteUrl()) === 0 ? '' : '_blank'; - return `${ _.escapeHTML(title) }`; + return `${ _.escapeHTML(title) }`; }); // Support msg = msg.replace(new RegExp(`(?:<|<)((?:${ schemes }):\\/\\/[^\\|]+)\\|(.+?)(?=>|>)(?:>|>)`, 'gm'), (match, url, title) => { const target = url.indexOf(Meteor.absoluteUrl()) === 0 ? '' : '_blank'; - return `${ _.escapeHTML(title) }`; + return `${ _.escapeHTML(title) }`; }); if (typeof window !== 'undefined' && window !== null ? window.rocketDebug : undefined) { console.log('Markdown', msg); } From 940ab0de8234972c47092117d091cfd098db01c9 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 7 Jun 2017 16:00:26 -0300 Subject: [PATCH 40/78] fix undefined description|title on image preview --- packages/rocketchat-ui/client/views/app/photoswipe.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rocketchat-ui/client/views/app/photoswipe.js b/packages/rocketchat-ui/client/views/app/photoswipe.js index 570d2b30f0ae..31f6a91c2230 100644 --- a/packages/rocketchat-ui/client/views/app/photoswipe.js +++ b/packages/rocketchat-ui/client/views/app/photoswipe.js @@ -2,7 +2,7 @@ import PhotoSwipe from 'photoswipe'; import PhotoSwipeUI_Default from 'photoswipe/dist/photoswipe-ui-default'; import 'photoswipe/dist/photoswipe.css'; -const escapeHTML = (html) => html.replace(/&/g, '&').replace(//g, '>'); +const escapeHTML = (html) => (html || '').replace(/&/g, '&').replace(//g, '>'); Meteor.startup(() => { const initGallery = (selector, items, options) => { const gallery = new PhotoSwipe(selector, PhotoSwipeUI_Default, items, options); From 3daf5207c8ca58f192381453bb61e5259d42780f Mon Sep 17 00:00:00 2001 From: Aaron Ogle Date: Mon, 26 Jun 2017 16:31:58 -0500 Subject: [PATCH 41/78] [Fix] Don't @ mention when doing reply in DM --- packages/rocketchat-lib/client/MessageAction.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/rocketchat-lib/client/MessageAction.js b/packages/rocketchat-lib/client/MessageAction.js index 5dd9021a8b60..bbab7c185901 100644 --- a/packages/rocketchat-lib/client/MessageAction.js +++ b/packages/rocketchat-lib/client/MessageAction.js @@ -103,7 +103,12 @@ Meteor.startup(function() { const message = this._arguments[1]; const input = instance.find('.input-message'); const url = RocketChat.MessageAction.getPermaLink(message._id); - const text = `[ ](${ url }) @${ message.u.username } `; + let text = `[ ](${ url }) `; + + if (Session.get('openedRoom').indexOf(Meteor.userId()) === -1) { + text += `@${ message.u.username }` + } + if (input.value) { input.value += input.value.endsWith(' ') ? '' : ' '; } From eaf6d6d7961bb754fcefabbb5faefc97b094e4e6 Mon Sep 17 00:00:00 2001 From: Aaron Ogle Date: Mon, 26 Jun 2017 16:54:11 -0500 Subject: [PATCH 42/78] add missing semi-colon --- packages/rocketchat-lib/client/MessageAction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rocketchat-lib/client/MessageAction.js b/packages/rocketchat-lib/client/MessageAction.js index bbab7c185901..39b8c3968152 100644 --- a/packages/rocketchat-lib/client/MessageAction.js +++ b/packages/rocketchat-lib/client/MessageAction.js @@ -106,7 +106,7 @@ Meteor.startup(function() { let text = `[ ](${ url }) `; if (Session.get('openedRoom').indexOf(Meteor.userId()) === -1) { - text += `@${ message.u.username }` + text += `@${ message.u.username }`; } if (input.value) { From 56db7349bc88c752e4707b21e6a773d08c47e04b Mon Sep 17 00:00:00 2001 From: Aaron Ogle Date: Tue, 27 Jun 2017 11:13:54 -0500 Subject: [PATCH 43/78] Add space after mention --- packages/rocketchat-lib/client/MessageAction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rocketchat-lib/client/MessageAction.js b/packages/rocketchat-lib/client/MessageAction.js index 39b8c3968152..c7bb8a6fc78d 100644 --- a/packages/rocketchat-lib/client/MessageAction.js +++ b/packages/rocketchat-lib/client/MessageAction.js @@ -106,7 +106,7 @@ Meteor.startup(function() { let text = `[ ](${ url }) `; if (Session.get('openedRoom').indexOf(Meteor.userId()) === -1) { - text += `@${ message.u.username }`; + text += `@${ message.u.username } `; } if (input.value) { From 50356345ded879cff6ad39e58b982e27567f7a2d Mon Sep 17 00:00:00 2001 From: Aaron Ogle Date: Tue, 27 Jun 2017 11:19:47 -0500 Subject: [PATCH 44/78] Switch to using query to get room type --- packages/rocketchat-lib/client/MessageAction.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/rocketchat-lib/client/MessageAction.js b/packages/rocketchat-lib/client/MessageAction.js index c7bb8a6fc78d..ae3f68edd982 100644 --- a/packages/rocketchat-lib/client/MessageAction.js +++ b/packages/rocketchat-lib/client/MessageAction.js @@ -103,9 +103,10 @@ Meteor.startup(function() { const message = this._arguments[1]; const input = instance.find('.input-message'); const url = RocketChat.MessageAction.getPermaLink(message._id); + const roomInfo = RocketChat.models.Rooms.findOne(message.rid, { fields: { t: 1 } }); let text = `[ ](${ url }) `; - if (Session.get('openedRoom').indexOf(Meteor.userId()) === -1) { + if (roomInfo.t !== 'd') { text += `@${ message.u.username } `; } From 492fce99dba8bfa2a09d213b8cfadda188afcf31 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Tue, 27 Jun 2017 13:25:16 -0300 Subject: [PATCH 45/78] Merge pull request #7320 from RocketChat/fix-jump-to-unread [FIX] Fix jump to unread button --- packages/rocketchat-ui/client/views/app/room.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rocketchat-ui/client/views/app/room.js b/packages/rocketchat-ui/client/views/app/room.js index 875b28bbfb7c..4cbaffd48873 100644 --- a/packages/rocketchat-ui/client/views/app/room.js +++ b/packages/rocketchat-ui/client/views/app/room.js @@ -364,7 +364,7 @@ Template.room.events({ 'click .unread-bar > button.jump-to'(e, t) { const { _id } = t.data; const room = RoomHistoryManager.getRoom(_id); - let message = room && readMessage.firstUnread.get(); + let message = room && room.firstUnread.get(); if (message) { return RoomHistoryManager.getSurroundingMessages(message, 50); } else { From e1a84a86c70de4ec6452c15d94b7598e997dd6d2 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Tue, 27 Jun 2017 13:49:44 -0300 Subject: [PATCH 46/78] Merge pull request #7311 from RocketChat/use-db-for-spotlight [NEW] Force use of MongoDB for spotlight queries --- packages/rocketchat-lib/server/models/Rooms.js | 6 ++++-- packages/rocketchat-lib/server/models/Users.js | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/rocketchat-lib/server/models/Rooms.js b/packages/rocketchat-lib/server/models/Rooms.js index 8af16f5e1a95..7cc89041c72b 100644 --- a/packages/rocketchat-lib/server/models/Rooms.js +++ b/packages/rocketchat-lib/server/models/Rooms.js @@ -238,7 +238,8 @@ class ModelRooms extends RocketChat.models._Base { } }; - return this.find(query, options); + // do not use cache + return this._db.find(query, options); } findByNameAndTypeNotContainingUsername(name, type, username, options) { @@ -250,7 +251,8 @@ class ModelRooms extends RocketChat.models._Base { } }; - return this.find(query, options); + // do not use cache + return this._db.find(query, options); } findByNameStartingAndTypes(name, types, options) { diff --git a/packages/rocketchat-lib/server/models/Users.js b/packages/rocketchat-lib/server/models/Users.js index 941416475c6e..ec3d6ad5036f 100644 --- a/packages/rocketchat-lib/server/models/Users.js +++ b/packages/rocketchat-lib/server/models/Users.js @@ -157,7 +157,8 @@ class ModelUsers extends RocketChat.models._Base { ] }; - return this.find(query, options); + // do not use cache + return this._db.find(query, options); } findUsersByNameOrUsername(nameOrUsername, options) { From b23eb6f13f76498ca4de6219568e8d19516079fa Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Tue, 27 Jun 2017 14:04:31 -0300 Subject: [PATCH 47/78] Merge pull request #7207 from RocketChat/fix-delete-message [FIX] Fix Block Delete Message After (n) Minutes --- client/methods/deleteMessage.js | 18 +++++++----------- .../rocketchat-lib/client/MessageAction.js | 5 ++++- .../server/methods/deleteMessage.js | 5 +++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/client/methods/deleteMessage.js b/client/methods/deleteMessage.js index 8a86f3affc25..1827726fb857 100644 --- a/client/methods/deleteMessage.js +++ b/client/methods/deleteMessage.js @@ -1,5 +1,4 @@ import moment from 'moment'; -import toastr from 'toastr'; Meteor.methods({ deleteMessage(message) { @@ -22,17 +21,14 @@ Meteor.methods({ return false; } const blockDeleteInMinutes = RocketChat.settings.get('Message_AllowDeleting_BlockDeleteInMinutes'); - if (!(forceDelete) || (_.isNumber(blockDeleteInMinutes) && blockDeleteInMinutes !== 0)) { - if (message.ts) { - const msgTs = moment(message.ts); - if (msgTs) { - const currentTsDiff = moment().diff(msgTs, 'minutes'); - if (currentTsDiff > blockDeleteInMinutes) { - toastr.error(t('error-message-deleting-blocked')); - return false; - } - } + if (!forceDelete && _.isNumber(blockDeleteInMinutes) && blockDeleteInMinutes !== 0) { + const msgTs = moment(message.ts); + const currentTsDiff = moment().diff(msgTs, 'minutes'); + if (currentTsDiff > blockDeleteInMinutes) { + return false; } + + } Tracker.nonreactive(function() { diff --git a/packages/rocketchat-lib/client/MessageAction.js b/packages/rocketchat-lib/client/MessageAction.js index 5dd9021a8b60..052198094723 100644 --- a/packages/rocketchat-lib/client/MessageAction.js +++ b/packages/rocketchat-lib/client/MessageAction.js @@ -188,7 +188,10 @@ Meteor.startup(function() { return; } const blockDeleteInMinutes = RocketChat.settings.get('Message_AllowDeleting_BlockDeleteInMinutes'); - if ((blockDeleteInMinutes != null) && blockDeleteInMinutes !== 0 && !(forceDelete)) { + if (forceDelete) { + return true; + } + if (blockDeleteInMinutes != null && blockDeleteInMinutes !== 0) { let msgTs; if (message.ts != null) { msgTs = moment(message.ts); diff --git a/packages/rocketchat-lib/server/methods/deleteMessage.js b/packages/rocketchat-lib/server/methods/deleteMessage.js index f6954129df15..829c77e45eae 100644 --- a/packages/rocketchat-lib/server/methods/deleteMessage.js +++ b/packages/rocketchat-lib/server/methods/deleteMessage.js @@ -14,7 +14,8 @@ Meteor.methods({ fields: { u: 1, rid: 1, - file: 1 + file: 1, + ts: 1 } }); if (originalMessage == null) { @@ -34,7 +35,7 @@ Meteor.methods({ }); } const blockDeleteInMinutes = RocketChat.settings.get('Message_AllowDeleting_BlockDeleteInMinutes'); - if ((blockDeleteInMinutes != null && blockDeleteInMinutes !== 0) || !(forceDelete)) { + if (blockDeleteInMinutes != null && blockDeleteInMinutes !== 0 && !forceDelete) { if (originalMessage.ts == null) { return; } From ced165208bd57df63fe629b5b938804704d66b6c Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Fri, 23 Jun 2017 12:42:44 -0300 Subject: [PATCH 48/78] Add support to run a specific migration --- server/startup/migrations/xrun.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/startup/migrations/xrun.js b/server/startup/migrations/xrun.js index 17a191b93c9b..156af688755e 100644 --- a/server/startup/migrations/xrun.js +++ b/server/startup/migrations/xrun.js @@ -1,5 +1,5 @@ if (RocketChat.Migrations.getVersion() !== 0) { - RocketChat.Migrations.migrateTo('latest'); + RocketChat.Migrations.migrateTo(process.env.MIGRATION_VERSION || 'latest'); } else { const control = RocketChat.Migrations._getControl(); control.version = _.last(RocketChat.Migrations._list).version; From e8baeae145a265c02853738080bec1bf579adcd2 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Fri, 23 Jun 2017 12:42:59 -0300 Subject: [PATCH 49/78] Improve avatar migration --- server/startup/migrations/v097.js | 84 ++++++++++++++++++------------- 1 file changed, 50 insertions(+), 34 deletions(-) diff --git a/server/startup/migrations/v097.js b/server/startup/migrations/v097.js index 4f3795b512a1..566a9bead349 100644 --- a/server/startup/migrations/v097.js +++ b/server/startup/migrations/v097.js @@ -1,9 +1,19 @@ import fs from 'fs'; import path from 'path'; +function log(...args) { + console.log('[AVATAR]', ...args); +} + +function logError(...args) { + console.error('[AVATAR]', ...args); +} + RocketChat.Migrations.add({ version: 97, up() { + log('Migrating avatars. This might take a while.'); + const query = { $or: [{ 's3.path': { @@ -75,6 +85,8 @@ RocketChat.Migrations.add({ 'linkedin' ]; + const avatarsPath = RocketChat.models.Settings.findOne({_id: 'Accounts_AvatarStorePath'}).value; + Meteor.setTimeout(function() { Meteor.runAsUser('rocket.cat', function() { const avatarsFileStore = FileUpload.getStore('Avatars'); @@ -83,10 +95,18 @@ RocketChat.Migrations.add({ name: 'avatars' }); - RocketChat.models.Users.find({avatarOrigin: {$in: avatarOrigins}}, {avatarOrigin: 1, username: 1}).forEach((user) => { + const users = RocketChat.models.Users.find({avatarOrigin: {$in: avatarOrigins}}, {avatarOrigin: 1, username: 1}); + + log('Total users to migrate avatars ->', users.count()); + + let current = 0; + + users.forEach((user) => { const id = `${ user.username }.jpg`; const gridFSAvatar = oldAvatarGridFS.getFileWithReadStream(id); + log('Migrating ', current++, 'of', users.count()); + if (gridFSAvatar) { const details = { userId: user._id, @@ -97,48 +117,44 @@ RocketChat.Migrations.add({ avatarsFileStore.insert(details, gridFSAvatar.readStream, (err) => { if (err) { - console.log({err}); + logError({err}); } else { oldAvatarGridFS.deleteFile(id); } }); - } else { - const avatarsPath = RocketChat.models.Settings.findOne({_id: 'Accounts_AvatarStorePath'}).value; - if (avatarsPath && avatarsPath.trim()) { - const filePath = path.join(avatarsPath, id); - try { - const stat = fs.statSync(filePath); - if (stat && stat.isFile()) { - const rs = fs.createReadStream(filePath); - const details = { - userId: user._id, - type: 'image/jpeg', - size: stat.size - }; - - avatarsFileStore.insert(details, rs, (err) => { - if (err) { - console.log({err}); - } else { - fs.unlinkSync(filePath); - } - }); - } - } catch (e) { - console.log('Error migrating old avatars', e); + } else if (avatarsPath && avatarsPath.trim()) { + const filePath = path.join(avatarsPath, id); + try { + const stat = fs.statSync(filePath); + if (stat && stat.isFile()) { + const rs = fs.createReadStream(filePath); + const details = { + userId: user._id, + type: 'image/jpeg', + size: stat.size + }; + + avatarsFileStore.insert(details, rs, (err) => { + if (err) { + logError({err}); + } else { + fs.unlinkSync(filePath); + } + }); } + } catch (e) { + log('Error migrating old avatars', e); } } }); - - RocketChat.models.Settings.remove({_id: 'Accounts_AvatarStoreType'}); - RocketChat.models.Settings.remove({_id: 'Accounts_AvatarStorePath'}); - - const avatarsFiles = new Mongo.Collection('avatars.files'); - const avatarsChunks = new Mongo.Collection('avatars.chunks'); - avatarsFiles.rawCollection().drop(); - avatarsChunks.rawCollection().drop(); }); }, 1000); + + const avatarsFiles = new Mongo.Collection('avatars.files'); + const avatarsChunks = new Mongo.Collection('avatars.chunks'); + avatarsFiles.rawCollection().drop(); + avatarsChunks.rawCollection().drop(); + RocketChat.models.Settings.remove({_id: 'Accounts_AvatarStoreType'}); + RocketChat.models.Settings.remove({_id: 'Accounts_AvatarStorePath'}); } }); From 7a4d855edf3bac68b6c44edc71a15c7172e67d06 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Mon, 26 Jun 2017 18:46:46 -0300 Subject: [PATCH 50/78] Fix migration from GridFS --- server/startup/migrations/v097.js | 56 ++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/server/startup/migrations/v097.js b/server/startup/migrations/v097.js index 566a9bead349..e02f913b7999 100644 --- a/server/startup/migrations/v097.js +++ b/server/startup/migrations/v097.js @@ -85,7 +85,8 @@ RocketChat.Migrations.add({ 'linkedin' ]; - const avatarsPath = RocketChat.models.Settings.findOne({_id: 'Accounts_AvatarStorePath'}).value; + const avatarsPath = RocketChat.models.Settings.findOne({_id: 'Accounts_AvatarStorePath'}); + const avatarStoreType = RocketChat.models.Settings.findOne({_id: 'Accounts_AvatarStoreType'}); Meteor.setTimeout(function() { Meteor.runAsUser('rocket.cat', function() { @@ -95,34 +96,50 @@ RocketChat.Migrations.add({ name: 'avatars' }); - const users = RocketChat.models.Users.find({avatarOrigin: {$in: avatarOrigins}}, {avatarOrigin: 1, username: 1}); + const users = RocketChat.models.Users.find({avatarOrigin: {$in: avatarOrigins}}, {avatarOrigin: 1, username: 1}).fetch()/*.slice(15, 20)*/; - log('Total users to migrate avatars ->', users.count()); + const usersTotal = users.length || users.count(); + + log('Total users to migrate avatars ->', usersTotal); let current = 0; - users.forEach((user) => { + Promise.all(users.map((user) => { const id = `${ user.username }.jpg`; + // console.log('id ->', id); + const gridFSAvatar = oldAvatarGridFS.getFileWithReadStream(id); - log('Migrating ', current++, 'of', users.count()); + log('Migrating', ++current, 'of', usersTotal); + + // console.log('gridFSAvatar ->', gridFSAvatar); if (gridFSAvatar) { const details = { userId: user._id, type: gridFSAvatar.contentType, - size: gridFSAvatar.length, - name: user.username + size: gridFSAvatar.length }; - avatarsFileStore.insert(details, gridFSAvatar.readStream, (err) => { - if (err) { - logError({err}); - } else { - oldAvatarGridFS.deleteFile(id); - } + // console.log('details ->', details); + return new Promise((resolve)=>{ + Meteor.defer(() => { + Meteor.runAsUser('rocket.cat', function() { + avatarsFileStore.insert(details, gridFSAvatar.readStream, (err) => { + if (err) { + logError({err}); + } else { + Meteor.setTimeout(() => { + oldAvatarGridFS.deleteFile(id); + }, 200); + } + resolve(); + }); + }); + }); }); - } else if (avatarsPath && avatarsPath.trim()) { + + } else if (avatarStoreType === 'FileSystem' && avatarsPath && avatarsPath.trim()) { const filePath = path.join(avatarsPath, id); try { const stat = fs.statSync(filePath); @@ -146,14 +163,15 @@ RocketChat.Migrations.add({ log('Error migrating old avatars', e); } } + })).then(()=>{ + const avatarsFiles = new Mongo.Collection('avatars.files'); + const avatarsChunks = new Mongo.Collection('avatars.chunks'); + avatarsFiles.rawCollection().drop(); + avatarsChunks.rawCollection().drop(); }); }); - }, 1000); - const avatarsFiles = new Mongo.Collection('avatars.files'); - const avatarsChunks = new Mongo.Collection('avatars.chunks'); - avatarsFiles.rawCollection().drop(); - avatarsChunks.rawCollection().drop(); + }, 1000); RocketChat.models.Settings.remove({_id: 'Accounts_AvatarStoreType'}); RocketChat.models.Settings.remove({_id: 'Accounts_AvatarStorePath'}); } From 46861ea3b2fc5e7f40b73fccf626854719c3ff28 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Tue, 27 Jun 2017 18:38:14 -0300 Subject: [PATCH 51/78] Run avatar migration in batches --- server/startup/migrations/v097.js | 154 ++++++++++++++++-------------- 1 file changed, 84 insertions(+), 70 deletions(-) diff --git a/server/startup/migrations/v097.js b/server/startup/migrations/v097.js index e02f913b7999..1ec5ae82c8ef 100644 --- a/server/startup/migrations/v097.js +++ b/server/startup/migrations/v097.js @@ -9,6 +9,35 @@ function logError(...args) { console.error('[AVATAR]', ...args); } +function insertAvatar({ details, avatarsFileStore, stream, callback = () => {} }) { + return new Promise((resolve) => { + Meteor.defer(() => { + Meteor.runAsUser('rocket.cat', () => { + avatarsFileStore.insert(details, stream, (err) => { + if (err) { + logError({err}); + resolve(); + } else { + Meteor.setTimeout(() => { + callback(); + }, 200); + } + resolve(); + }); + }); + }); + }); +} + +function batch(arr, limit, fn) { + if (!arr.length) { + return Promise.resolve(); + } + return Promise.all(arr.splice(0, limit).map((item) => { + return fn(item); + })).then(() => { return batch(arr, limit, fn); }); +} + RocketChat.Migrations.add({ version: 97, up() { @@ -85,92 +114,77 @@ RocketChat.Migrations.add({ 'linkedin' ]; - const avatarsPath = RocketChat.models.Settings.findOne({_id: 'Accounts_AvatarStorePath'}); - const avatarStoreType = RocketChat.models.Settings.findOne({_id: 'Accounts_AvatarStoreType'}); + const avatarsPath = RocketChat.models.Settings.findOne({_id: 'Accounts_AvatarStorePath'}).value; + const avatarStoreType = RocketChat.models.Settings.findOne({_id: 'Accounts_AvatarStoreType'}).value; Meteor.setTimeout(function() { - Meteor.runAsUser('rocket.cat', function() { - const avatarsFileStore = FileUpload.getStore('Avatars'); - - const oldAvatarGridFS = new RocketChatFile.GridFS({ - name: 'avatars' - }); + const avatarsFileStore = FileUpload.getStore('Avatars'); - const users = RocketChat.models.Users.find({avatarOrigin: {$in: avatarOrigins}}, {avatarOrigin: 1, username: 1}).fetch()/*.slice(15, 20)*/; + const oldAvatarGridFS = new RocketChatFile.GridFS({ + name: 'avatars' + }); - const usersTotal = users.length || users.count(); + const users = RocketChat.models.Users.find({avatarOrigin: {$in: avatarOrigins}}, {avatarOrigin: 1, username: 1}).fetch(); - log('Total users to migrate avatars ->', usersTotal); + const usersTotal = users.length; - let current = 0; + log('Total users to migrate avatars ->', usersTotal); - Promise.all(users.map((user) => { - const id = `${ user.username }.jpg`; - // console.log('id ->', id); + let current = 0; - const gridFSAvatar = oldAvatarGridFS.getFileWithReadStream(id); + batch(users, 300, (user) => { + const id = `${ user.username }.jpg`; - log('Migrating', ++current, 'of', usersTotal); + const gridFSAvatar = oldAvatarGridFS.getFileWithReadStream(id); - // console.log('gridFSAvatar ->', gridFSAvatar); + log('Migrating', ++current, 'of', usersTotal); - if (gridFSAvatar) { - const details = { - userId: user._id, - type: gridFSAvatar.contentType, - size: gridFSAvatar.length - }; + if (gridFSAvatar) { + const details = { + userId: user._id, + type: gridFSAvatar.contentType, + size: gridFSAvatar.length + }; - // console.log('details ->', details); - return new Promise((resolve)=>{ - Meteor.defer(() => { - Meteor.runAsUser('rocket.cat', function() { - avatarsFileStore.insert(details, gridFSAvatar.readStream, (err) => { - if (err) { - logError({err}); - } else { - Meteor.setTimeout(() => { - oldAvatarGridFS.deleteFile(id); - }, 200); - } - resolve(); - }); - }); - }); - }); - - } else if (avatarStoreType === 'FileSystem' && avatarsPath && avatarsPath.trim()) { + return insertAvatar({ + details, + avatarsFileStore, + stream: gridFSAvatar.readStream, + callback() { + oldAvatarGridFS.deleteFile(id); + } + }); + } + if (avatarStoreType === 'FileSystem' && avatarsPath && avatarsPath.trim()) { + try { const filePath = path.join(avatarsPath, id); - try { - const stat = fs.statSync(filePath); - if (stat && stat.isFile()) { - const rs = fs.createReadStream(filePath); - const details = { - userId: user._id, - type: 'image/jpeg', - size: stat.size - }; - - avatarsFileStore.insert(details, rs, (err) => { - if (err) { - logError({err}); - } else { - fs.unlinkSync(filePath); - } - }); - } - } catch (e) { - log('Error migrating old avatars', e); + const stat = fs.statSync(filePath); + if (stat && stat.isFile()) { + const details = { + userId: user._id, + type: 'image/jpeg', + size: stat.size + }; + return insertAvatar({ + details, + avatarsFileStore, + stream: fs.createReadStream(filePath), + callback() { + fs.unlinkSync(filePath); + } + }); } + } catch (e) { + logError('Error migrating old avatar', e); + return Promise.resolve(); } - })).then(()=>{ - const avatarsFiles = new Mongo.Collection('avatars.files'); - const avatarsChunks = new Mongo.Collection('avatars.chunks'); - avatarsFiles.rawCollection().drop(); - avatarsChunks.rawCollection().drop(); - }); + } + }).then(() => { + const avatarsFiles = new Mongo.Collection('avatars.files'); + const avatarsChunks = new Mongo.Collection('avatars.chunks'); + avatarsFiles.rawCollection().drop(); + avatarsChunks.rawCollection().drop(); }); - }, 1000); RocketChat.models.Settings.remove({_id: 'Accounts_AvatarStoreType'}); RocketChat.models.Settings.remove({_id: 'Accounts_AvatarStorePath'}); From 7ea918d122e4373dc9657041a2aee7ba6f3ef069 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Tue, 27 Jun 2017 19:07:15 -0300 Subject: [PATCH 52/78] Use regular require() for postcss plugins --- packages/rocketchat-postcss/plugin/minify-css.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/packages/rocketchat-postcss/plugin/minify-css.js b/packages/rocketchat-postcss/plugin/minify-css.js index e102bfe1d96a..eccab34c0b6b 100644 --- a/packages/rocketchat-postcss/plugin/minify-css.js +++ b/packages/rocketchat-postcss/plugin/minify-css.js @@ -17,7 +17,7 @@ const getPostCSSPlugins = () => { const plugins = []; if (postCSSConfig.plugins) { Object.keys(postCSSConfig.plugins).forEach((pluginName) => { - const postCSSPlugin = Npm.require(pluginName); + const postCSSPlugin = require(pluginName); if (postCSSPlugin && postCSSPlugin.name === 'creator' && postCSSPlugin().postcssPlugin) { plugins.push(postCSSPlugin(postCSSConfig.plugins ? postCSSConfig.plugins[pluginName] : {})); } @@ -27,14 +27,6 @@ const getPostCSSPlugins = () => { return plugins; }; -const getPostCSSParser = () => { - if (postCSSConfig.parser) { - return Npm.require(postCSSConfig.parser); - } - - return false; -}; - const getExcludedPackages = () => { if (postCSSConfig.excludedPackages && postCSSConfig.excludedPackages instanceof Array) { return postCSSConfig.excludedPackages; @@ -72,8 +64,7 @@ const mergeCss = css => { postCSS(isFileForPostCSS ? getPostCSSPlugins() : []) .process(file.getContentsAsString(), { - from: process.cwd() + file._source.url.replace('_', '-'), - parser: getPostCSSParser() + from: process.cwd() + file._source.url.replace('_', '-') }) .then(result => { result.warnings().forEach(warn => { From 3f8cd5ee68ac94991961ca64d7a19b0ce4b8236b Mon Sep 17 00:00:00 2001 From: Alex Payne Date: Tue, 27 Jun 2017 16:19:56 -0700 Subject: [PATCH 53/78] Remove warning about 2FA support being unavailable in native mobile apps because that's no longer true. --- packages/rocketchat-2fa/client/accountSecurity.html | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/rocketchat-2fa/client/accountSecurity.html b/packages/rocketchat-2fa/client/accountSecurity.html index 9ed51e09d061..d3f60641a4c6 100644 --- a/packages/rocketchat-2fa/client/accountSecurity.html +++ b/packages/rocketchat-2fa/client/accountSecurity.html @@ -12,11 +12,6 @@

{{_ "Two-factor_authentication"}}

-
- - WARNING: Once you enable this, you will not be able to login on the native mobile apps (Rocket.Chat+) using your password until they implement the 2FA. - -
{{#if isEnabled}} {{else}} From c9a47fb6fc068b4b6ffc3c7bdc921e07fdb6b03c Mon Sep 17 00:00:00 2001 From: Alex Payne Date: Tue, 27 Jun 2017 16:27:37 -0700 Subject: [PATCH 54/78] Use latest Node v4 'Argon' LTS version, 4.8.3, in Snap. --- .snapcraft/candidate/snapcraft.yaml | 2 +- .snapcraft/edge/snapcraft.yaml | 2 +- .snapcraft/stable/snapcraft.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.snapcraft/candidate/snapcraft.yaml b/.snapcraft/candidate/snapcraft.yaml index 567d2e479002..2a4d3c719752 100644 --- a/.snapcraft/candidate/snapcraft.yaml +++ b/.snapcraft/candidate/snapcraft.yaml @@ -39,7 +39,7 @@ apps: parts: node: plugin: nodejs - node-engine: 4.8.1 + node-engine: 4.8.3 node-packages: - promise - fibers diff --git a/.snapcraft/edge/snapcraft.yaml b/.snapcraft/edge/snapcraft.yaml index 2934d80e5907..d12d69d83934 100644 --- a/.snapcraft/edge/snapcraft.yaml +++ b/.snapcraft/edge/snapcraft.yaml @@ -39,7 +39,7 @@ apps: parts: node: plugin: nodejs - node-engine: 4.8.1 + node-engine: 4.8.3 node-packages: - promise - fibers diff --git a/.snapcraft/stable/snapcraft.yaml b/.snapcraft/stable/snapcraft.yaml index e548ef967a89..f61321281a28 100644 --- a/.snapcraft/stable/snapcraft.yaml +++ b/.snapcraft/stable/snapcraft.yaml @@ -39,7 +39,7 @@ apps: parts: node: plugin: nodejs - node-engine: 4.8.1 + node-engine: 4.8.3 node-packages: - promise - fibers From 187b49e79d6ac228913bb01ba4781f6aad7aefef Mon Sep 17 00:00:00 2001 From: Alex Payne Date: Tue, 27 Jun 2017 16:31:43 -0700 Subject: [PATCH 55/78] Revert "Remove warning about 2FA support being unavailable in native mobile apps because that's no longer true." This reverts commit 3f8cd5ee68ac94991961ca64d7a19b0ce4b8236b. --- packages/rocketchat-2fa/client/accountSecurity.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/rocketchat-2fa/client/accountSecurity.html b/packages/rocketchat-2fa/client/accountSecurity.html index d3f60641a4c6..9ed51e09d061 100644 --- a/packages/rocketchat-2fa/client/accountSecurity.html +++ b/packages/rocketchat-2fa/client/accountSecurity.html @@ -12,6 +12,11 @@

{{_ "Two-factor_authentication"}}

+
+ + WARNING: Once you enable this, you will not be able to login on the native mobile apps (Rocket.Chat+) using your password until they implement the 2FA. + +
{{#if isEnabled}} {{else}} From 3db03017c8e1f9ba54e0c9cc7f6fc9d087d4b6f8 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Wed, 28 Jun 2017 09:51:09 -0300 Subject: [PATCH 56/78] Fix user's customFields not being saved --- packages/rocketchat-lib/server/models/Users.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/rocketchat-lib/server/models/Users.js b/packages/rocketchat-lib/server/models/Users.js index ec3d6ad5036f..00513f5adc96 100644 --- a/packages/rocketchat-lib/server/models/Users.js +++ b/packages/rocketchat-lib/server/models/Users.js @@ -316,9 +316,8 @@ class ModelUsers extends RocketChat.models._Base { setCustomFields(_id, fields) { const values = {}; - Object.keys(fields).reduce(key => { - const value = fields[key]; - values[`customFields.${ key }`] = value; + Object.keys(fields).forEach(key => { + values[`customFields.${ key }`] = fields[key]; }); const update = {$set: values}; From 9afe9d166b0bc992ba8bb4465ac20fbb59856d95 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Wed, 28 Jun 2017 09:56:06 -0300 Subject: [PATCH 57/78] Remove Heroku's NODE_ENV env var --- app.json | 1 - 1 file changed, 1 deletion(-) diff --git a/app.json b/app.json index 1fe42a0e97ef..ea31755dbbba 100644 --- a/app.json +++ b/app.json @@ -6,7 +6,6 @@ "keywords": ["meteor", "social", "community", "chat"], "website": "https://rocket.chat", "env": { - "NODE_ENV": "production", "BUILDPACK_URL": "https://github.com/RocketChat/meteor-buildpack-horse.git", "HEROKU_APP_NAME": { "description": "Please re-enter your App Name from the top.", From f8273b24596d66f694921b5c20ddbe93e4d47502 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Wed, 28 Jun 2017 11:05:54 -0300 Subject: [PATCH 58/78] Merge pull request #7308 from RocketChat/improvements/escape-error-messages Escape error messages --- client/lib/handleError.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/lib/handleError.js b/client/lib/handleError.js index 703524a1bfdf..821d7e7cb0dd 100644 --- a/client/lib/handleError.js +++ b/client/lib/handleError.js @@ -9,8 +9,8 @@ this.handleError = function(error, useToastr = true) { } if (useToastr) { - return toastr.error(TAPi18n.__(error.error, error.details), error.details && error.details.errorTitle ? TAPi18n.__(error.details.errorTitle) : null); + return toastr.error(_.escapeHTML(TAPi18n.__(error.error, error.details)), error.details && error.details.errorTitle ? _.escapeHTML(TAPi18n.__(error.details.errorTitle)) : null); } - return TAPi18n.__(error.error, error.details); + return _.escapeHTML(TAPi18n.__(error.error, error.details)); }; From 2347d2a9dbac8c6147a3e11cff9ac624bc7808cc Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Wed, 28 Jun 2017 15:36:39 -0300 Subject: [PATCH 59/78] Bump version to 0.57.0-rc.3 --- .docker/Dockerfile | 2 +- .sandstorm/sandstorm-pkgdef.capnp | 2 +- .travis/snap.sh | 2 +- HISTORY.md | 28 +++++++++++++++++++++++++ package.json | 2 +- packages/rocketchat-lib/rocketchat.info | 2 +- 6 files changed, 33 insertions(+), 5 deletions(-) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index c469d26d0d4a..994ba0c14b48 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -1,6 +1,6 @@ FROM rocketchat/base:4 -ENV RC_VERSION 0.57.0-rc.2 +ENV RC_VERSION 0.57.0-rc.3 MAINTAINER buildmaster@rocket.chat diff --git a/.sandstorm/sandstorm-pkgdef.capnp b/.sandstorm/sandstorm-pkgdef.capnp index 4bd7fe8f6a2c..4bcfb679eb72 100644 --- a/.sandstorm/sandstorm-pkgdef.capnp +++ b/.sandstorm/sandstorm-pkgdef.capnp @@ -21,7 +21,7 @@ const pkgdef :Spk.PackageDefinition = ( appVersion = 62, # Increment this for every release. - appMarketingVersion = (defaultText = "0.57.0-rc.2"), + appMarketingVersion = (defaultText = "0.57.0-rc.3"), # Human-readable representation of appVersion. Should match the way you # identify versions of your app in documentation and marketing. diff --git a/.travis/snap.sh b/.travis/snap.sh index fc3e66e740f2..f7b7cadd5493 100755 --- a/.travis/snap.sh +++ b/.travis/snap.sh @@ -17,7 +17,7 @@ elif [[ $TRAVIS_TAG ]]; then RC_VERSION=$TRAVIS_TAG else CHANNEL=edge - RC_VERSION=0.57.0-rc.2 + RC_VERSION=0.57.0-rc.3 fi echo "Preparing to trigger a snap release for $CHANNEL channel" diff --git a/HISTORY.md b/HISTORY.md index a4ed842d9274..10c09da388c2 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,31 @@ + +# 0.57.0-rc.3 (2017-06-28) + + +### New Features + +- [#7311](https://github.com/RocketChat/Rocket.Chat/pull/7311) Force use of MongoDB for spotlight queries + + +### Bug Fixes + +- [#7345](https://github.com/RocketChat/Rocket.Chat/pull/7345) click on image in a message +- [#7207](https://github.com/RocketChat/Rocket.Chat/pull/7207) Fix Block Delete Message After (n) Minutes +- [#7320](https://github.com/RocketChat/Rocket.Chat/pull/7320) Fix jump to unread button +- [#7321](https://github.com/RocketChat/Rocket.Chat/pull/7321) Fix Secret Url +- [#7358](https://github.com/RocketChat/Rocket.Chat/pull/7358) Fix user's customFields not being saved correctly +- [#7352](https://github.com/RocketChat/Rocket.Chat/pull/7352) Improve avatar migration +- [#7304](https://github.com/RocketChat/Rocket.Chat/pull/7304) Proxy upload to correct instance + + +
+Others + +- [#7308](https://github.com/RocketChat/Rocket.Chat/pull/7308) Escape error messages +
+ + + # 0.57.0-rc.2 (2017-06-12) diff --git a/package.json b/package.json index 1a6d775e2f12..4ea43e21ff32 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "Rocket.Chat", "description": "The Ultimate Open Source WebChat Platform", - "version": "0.57.0-rc.2", + "version": "0.57.0-rc.3", "author": { "name": "Rocket.Chat", "url": "https://rocket.chat/" diff --git a/packages/rocketchat-lib/rocketchat.info b/packages/rocketchat-lib/rocketchat.info index a44b7c1f1bc5..b89c94081369 100644 --- a/packages/rocketchat-lib/rocketchat.info +++ b/packages/rocketchat-lib/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "0.57.0-rc.2" + "version": "0.57.0-rc.3" } From 0652928e9ccff29dd5376de28a50b29d9e6fc4ef Mon Sep 17 00:00:00 2001 From: Gabriel Engel Date: Wed, 28 Jun 2017 20:03:45 +0000 Subject: [PATCH 60/78] LingoHub Update :rocket: Manual push by LingoHub User: Gabriel Engel. Project: Rocket.Chat Made with :heart: by https://lingohub.com --- packages/rocketchat-i18n/i18n/af.i18n.json | 3 + packages/rocketchat-i18n/i18n/ca.i18n.json | 7 +- packages/rocketchat-i18n/i18n/cs.i18n.json | 7 +- packages/rocketchat-i18n/i18n/de.i18n.json | 2 +- packages/rocketchat-i18n/i18n/el.i18n.json | 2 + packages/rocketchat-i18n/i18n/en.i18n.json | 2 +- packages/rocketchat-i18n/i18n/fi.i18n.json | 2 + packages/rocketchat-i18n/i18n/ko.i18n.json | 173 ++++++++++++------ packages/rocketchat-i18n/i18n/ru.i18n.json | 8 +- packages/rocketchat-i18n/i18n/vi-VN.i18n.json | 3 + .../rocketchat-livechat/app/i18n/af.i18n.json | 4 + .../rocketchat-livechat/app/i18n/el.i18n.json | 11 ++ .../rocketchat-livechat/app/i18n/fi.i18n.json | 6 + .../rocketchat-livechat/app/i18n/ko.i18n.json | 2 +- .../app/i18n/vi-VN.i18n.json | 3 + 15 files changed, 171 insertions(+), 64 deletions(-) create mode 100644 packages/rocketchat-i18n/i18n/af.i18n.json create mode 100644 packages/rocketchat-i18n/i18n/vi-VN.i18n.json create mode 100644 packages/rocketchat-livechat/app/i18n/af.i18n.json create mode 100644 packages/rocketchat-livechat/app/i18n/vi-VN.i18n.json diff --git a/packages/rocketchat-i18n/i18n/af.i18n.json b/packages/rocketchat-i18n/i18n/af.i18n.json new file mode 100644 index 000000000000..db1a62920d66 --- /dev/null +++ b/packages/rocketchat-i18n/i18n/af.i18n.json @@ -0,0 +1,3 @@ +{ + "#channel": "#channel" +} \ No newline at end of file diff --git a/packages/rocketchat-i18n/i18n/ca.i18n.json b/packages/rocketchat-i18n/i18n/ca.i18n.json index d9b22df36000..51d605174402 100644 --- a/packages/rocketchat-i18n/i18n/ca.i18n.json +++ b/packages/rocketchat-i18n/i18n/ca.i18n.json @@ -751,7 +751,9 @@ "Integrations_for_all_channels": "Introdueix all_public_channels per escoltar a totes les sales públiques, all_private_groups per escoltar a tots els grups privats i all_direct_messages per escoltar tots els missatges directes.", "InternalHubot": "Hubot intern", "InternalHubot_ScriptsToLoad": "Seqüències d'ordres (scripts) per carregar", - "InternalHubot_ScriptsToLoad_Description": "Si us plau, introduiu una llista separada per comes de scripts de https://github.com/github/hubot-scripts/tree/master/src/scripts", + "InternalHubot_ScriptsToLoad_Description": "Si us plau, introduiu una llista separada per comes de scripts per carregar des de la carpeta personalitzada", + "InternalHubot_PathToLoadCustomScripts": "Carpeta des d'on carregar els scripts", + "InternalHubot_reload": "Recarrega els scripts", "InternalHubot_Username_Description": "Ha de ser un nom d'usuari vàlid d'un bot registrat al servidor.", "Invalid_confirm_pass": "La confirmació de la contrasenya no coincideix amb la contrasenya", "Invalid_email": "L'adreça de correu-e és invàlida", @@ -873,7 +875,7 @@ "LDAP_Sync_User_Data": "Sincronitzar dades d'usuari", "LDAP_Sync_User_Data_Description": "Mantenir les dades de l'usuari sincronitzades amb el servidor quan s'identifiqui (ex: nom, adreça de correu, etcètera).", "LDAP_Sync_User_Data_FieldMap": "Mapatge de camps de dades d'usuari", - "LDAP_Sync_User_Data_FieldMap_Description": "Configura com els camps del compte d'usuari (com el de correu-e) s'omplen des del registre LDAP (un cop trobat).
A tall d'exemple, `{\"cn\":\"name\", \"mail\":\"email\"}` triarà el nom des de l'atribut `cn`, i l'adreça-e des de l'atribut `mail`.
Els camps disponibles `name` i `email`.", + "LDAP_Sync_User_Data_FieldMap_Description": "Configura com els camps del compte d'usuari (com el de correu-e) s'omplen des del registre LDAP (un cop trobat).
A tall d'exemple, `{\"cn\":\"name\", \"mail\":\"email\"}` triarà el nom des de l'atribut `cn`, i l'adreça-e des de l'atribut `mail`. Addicionalment, és possible utilitzar variables, per exemple: `{ \"#{givenName} #{sn}\": \"name\", \"mail\": \"email\" }` utilitza una combinació del nom de pila i del cognom per al camp `name` de l'usuari de rocket chat.
Camps disponibles a Rocket.Chat: `name` i `email`.", "LDAP_Sync_Users": "Sincronització d'usuaris", "LDAP_Test_Connection": "Prova la connexió", "LDAP_Unique_Identifier_Field": "Camp d'identificador únic", @@ -1235,6 +1237,7 @@ "Registration_via_Admin": "Registre via Admin", "Regular_Expressions": "Expressions regulars", "Release": "Llançament", + "Reload": "Recarrega", "Remove": "Esborrar", "Remove_Admin": "Treu admin", "Remove_as_moderator": "Treu de moderador", diff --git a/packages/rocketchat-i18n/i18n/cs.i18n.json b/packages/rocketchat-i18n/i18n/cs.i18n.json index 2c48a17fa984..8383333fe6a8 100644 --- a/packages/rocketchat-i18n/i18n/cs.i18n.json +++ b/packages/rocketchat-i18n/i18n/cs.i18n.json @@ -751,7 +751,9 @@ "Integrations_for_all_channels": "Zadejte all_public_channels pro poslouchání nad všemi otevřenými místnostmi, all_private_groups pro všechny soukromé místnosti a all_direct_messages pro poslouchání přímých konverzací", "InternalHubot": "Interní Hubot", "InternalHubot_ScriptsToLoad": "Načíst skripty", - "InternalHubot_ScriptsToLoad_Description": "Prosím, zadejte čárkami oddělený seznam skriptů k načtení z https://github.com/github/hubot-scripts/tree/master/src/scripts", + "InternalHubot_ScriptsToLoad_Description": "Prosím, zadejte čárkami oddělený seznam skriptů k načtení z https://github.com/github/hubot-scripts/tree/master/src/scripts umístěných ve vaší složce", + "InternalHubot_PathToLoadCustomScripts": "Složka odkud načíst skripty", + "InternalHubot_reload": "Znovu načíst skripty", "InternalHubot_Username_Description": "Musí být platné uživatelské jméno jednoho z botů registrovaných na tomto serveru.", "Invalid_confirm_pass": "Hesla nesouhlasí", "Invalid_email": "Zadaný e-mail je neplatný", @@ -873,7 +875,7 @@ "LDAP_Sync_User_Data": "Synchronizace dat", "LDAP_Sync_User_Data_Description": "Udržujte uživatelská data synchronizovaná se serverem po přihlášení (např: jméno, e-mail).", "LDAP_Sync_User_Data_FieldMap": "Mapa polí uživatelských dat", - "LDAP_Sync_User_Data_FieldMap_Description": "Konfiguruje pole uživatelských dat (například e-mailu) v záznamu v LDAP.
Například `{\" CN \":\" name \",\" mail \":\" email \"}` vybere jméno osoby z atributu CN, a jeho e-mail z atributu pošty.
Volné pole obsahují `name` a `email`.", + "LDAP_Sync_User_Data_FieldMap_Description": "Konfiguruje pole uživatelských dat (například e-mailu) v záznamu v LDAP.
Například `{\"cn\":\"name\", \"mail\":\"email\"}` vybere jméno osoby z atributu `cn`, a jeho e-mail z atributu `mail`. Lze používat proměnné například: `{ \"#{givenName} #{sn}\": \"name\", \"mail\": \"email\" }` použije kombinaci křestínho jména a příjmení pro pole `name` v Rocket.Chat.
Dostupná pole Rocket.Chatu jsou `name`, a `email`.", "LDAP_Sync_Users": "Synchronizovat Uživatele", "LDAP_Test_Connection": "Test připojení", "LDAP_Unique_Identifier_Field": "Jedinečný identifikátor", @@ -1235,6 +1237,7 @@ "Registration_via_Admin": "Registrace přes Admin", "Regular_Expressions": "Regulární výrazy", "Release": "Verze", + "Reload": "Znovu načíst", "Remove": "Odstranit", "Remove_Admin": "Odebrat Správce", "Remove_as_moderator": "Odebrat moderátora", diff --git a/packages/rocketchat-i18n/i18n/de.i18n.json b/packages/rocketchat-i18n/i18n/de.i18n.json index 545e16b1e447..8e14837d53d7 100644 --- a/packages/rocketchat-i18n/i18n/de.i18n.json +++ b/packages/rocketchat-i18n/i18n/de.i18n.json @@ -1479,4 +1479,4 @@ "your_message_optional": "ihre optionale Nachricht", "Your_password_is_wrong": "Falsches Passwort", "Your_push_was_sent_to_s_devices": "Die Push-Nachricht wurde an %s Geräte gesendet." -} +} \ No newline at end of file diff --git a/packages/rocketchat-i18n/i18n/el.i18n.json b/packages/rocketchat-i18n/i18n/el.i18n.json index ba47065b0679..3ee98172fd93 100644 --- a/packages/rocketchat-i18n/i18n/el.i18n.json +++ b/packages/rocketchat-i18n/i18n/el.i18n.json @@ -6,6 +6,7 @@ "500": "Εσωτερικό Σφάλμα Διακομιστή", "__username__is_no_longer__role__defined_by__user_by_": "__username__ is no longer __role__ by __user_by__", "__username__was_set__role__by__user_by_": "__username__ was set __role__ by __user_by__", + "Accept": "Αποδοχή", "Access_not_authorized": "Πρόσβαση δεν επιτρέπονται", "Access_Token_URL": "Πρόσβαση Token URL", "Accessing_permissions": "Πρόσβαση δικαιώματα", @@ -135,6 +136,7 @@ "and": "και", "And_more": "Και πιο __length __", "Animals_and_Nature": "Ζώα και Φύση", + "Announcement": "Ανακοίνωση", "API": "API", "API_Analytics": "Analytics", "API_Embed": "Ενσωμάτωση", diff --git a/packages/rocketchat-i18n/i18n/en.i18n.json b/packages/rocketchat-i18n/i18n/en.i18n.json index 1b2888536b9a..70f5c8a30dc9 100644 --- a/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/packages/rocketchat-i18n/i18n/en.i18n.json @@ -1725,4 +1725,4 @@ "your_message_optional": "your message (optional)", "Your_password_is_wrong": "Your password is wrong!", "Your_push_was_sent_to_s_devices": "Your push was sent to %s devices" -} +} \ No newline at end of file diff --git a/packages/rocketchat-i18n/i18n/fi.i18n.json b/packages/rocketchat-i18n/i18n/fi.i18n.json index fbfdaa6bc411..8dffc605cc79 100644 --- a/packages/rocketchat-i18n/i18n/fi.i18n.json +++ b/packages/rocketchat-i18n/i18n/fi.i18n.json @@ -6,6 +6,7 @@ "403": "Kielletty", "500": "Sisäinen palvelinvirhe", "@username": "@käyttäjä", + "@username_message": "@käyttäjä ", "__username__is_no_longer__role__defined_by__user_by_": "__username__ ei ole enää __role__ (__user_by__)", "__username__was_set__role__by__user_by_": "__user_by__ muutti käyttäjän __username__ rooliksi __role__ ", "Accept": "Hyväksy", @@ -211,6 +212,7 @@ "Cancel": "Peruuta", "Cancel_message_input": "Peruuta", "Cannot_invite_users_to_direct_rooms": "Et voi kutsua käyttäjiä yksityisviesteihin", + "CAS_Sync_User_Data_FieldMap_Description": "Käytä tätä JSON syötettä rakentaessa sisäiset määritteet (avain) ulkoisista määritteistä (arvo). Ulkoisien määritteiden nimet suljettuna '%' merkkien väliin lisätään arvo teksteihin.
Esimerkiksi, `{\"email\":\"%email%\", \"name\":\"%firstname%, %lastname%\"}`

Määrite kartta on aina lisätty. CAS 1.0:ssa vain `username` määrite on saatavilla. Saatavilla olevat sisäiset määritteet ovat: username, name, email, rooms; rooms on pilkuilla erotettu lista huoneista joihin liittyä käyttäjää lisättäessä, esimerkiksi: {\"rooms\": \"%team%,%department%\"} liittyisi CAS käyttäjät niitä luotaessa heidän tiimi ja osasto kanavalle.", "CDN_PREFIX": "CDN etuliite", "Certificates_and_Keys": "Sertifikaatit ja avaimet", "Changing_email": "Vaihdetaan sähköposti", diff --git a/packages/rocketchat-i18n/i18n/ko.i18n.json b/packages/rocketchat-i18n/i18n/ko.i18n.json index 5d7f599dd39c..28b312bac237 100644 --- a/packages/rocketchat-i18n/i18n/ko.i18n.json +++ b/packages/rocketchat-i18n/i18n/ko.i18n.json @@ -11,11 +11,14 @@ "__username__was_set__role__by__user_by_": "__ 사용자에게 __사용자가 __역할을__ 설정하였습니다", "Accept": "수락", "Accept_incoming_livechat_requests_even_if_there_are_no_online_agents": "상담원이 온라인 상태가 아닌 경우에도 라이브챗을 수락합니다.", + "Accept_with_no_online_agents": "온라인 에이전트가 없는 것을 허용", "Access_not_authorized": "엑세스 권한이 없습니다", "Access_Token_URL": "액세스 토큰 URL", "Accessing_permissions": "접속권한", "Account_SID": "계정 SID", "Accounts": "계정", + "Accounts_AllowAnonymousRead": "익명사용자 읽기 허용", + "Accounts_AllowAnonymousWrite": "익명사용자 쓰기 허용", "Accounts_AllowDeleteOwnAccount": "사용자가 자신의 계정을 삭제할 수 있습니다", "Accounts_AllowedDomainsList": "허용된 도메인 목록", "Accounts_AllowedDomainsList_Description": "허용된 도메인을 쉼표(,)로 구분하기", @@ -31,12 +34,13 @@ "Accounts_BlockedUsernameList": "차단된 사용자 리스트", "Accounts_BlockedUsernameList_Description": "쉼표로 구문된 차단 사용자 리스트 (대소 문자 구분)", "Accounts_CustomFields_Description": "필드 설정에 포함된 필드명을 사용한 올바른 JSON 이여야 합니다.\n\n예:
{\n \"role\": {\n  \"type\": \"select\",\n  \"defaultValue\": \"student\",\n  \"options\": [\"teacher\", \"student\"],\n  \"required\": true,\n  \"modifyRecordField\": {\n   \"array\": true,\n   \"field\": \"roles\"\n  }\n },\n \"twitter\": {\n  \"type\": \"text\",\n  \"required\": true,\n  \"minLength\": 2,\n  \"maxLength\": 10\n }\n} ", + "Accounts_DefaultUsernamePrefixSuggestion": "사용자 기본 접두어 제안", "Accounts_denyUnverifiedEmail": "확인되지 않은 이메일 거부", "Accounts_EmailVerification": "이메일 확인", "Accounts_EmailVerification_Description": "이 기능을 사용하려면 SMTP설정이 올바르게 되어있는지 확인해주십시오.", "Accounts_Enrollment_Email": "등록된 이메일", "Accounts_Enrollment_Email_Default": "

에 오신 것을 환영합니다

[Site_Name]

[Site_URL]로 이동하여 오늘날 최고의 오픈 소스 채팅 솔루션을보십시오!

", - "Accounts_Enrollment_Email_Description": "당신은 각각 사용자의 전체 이름, 이름 또는 성을 위해 [lname], [name], [fname]을 사용할 수 있습니다.
당신은 사용자의 이메일을 [email]을 사용할 수 있습니다.", + "Accounts_Enrollment_Email_Description": "다음의 기호를 사용할 수 있습니다:
  • [lname] - 성, [name] - 이름, [fname] - 전체이름(성+이름)
  • [email] - 이메일
  • [Site_Name] - 응용프로그램의 이름, [Site_URL] - URL
", "Accounts_Enrollment_Email_Subject_Default": "[Site_Name] 에 오신 것을 환영합니다 ", "Accounts_ForgetUserSessionOnWindowClose": "창을 닫을때 사용자 세션을 삭제합니다", "Accounts_Iframe_api_method": "API 메소드", @@ -57,7 +61,7 @@ "Accounts_OAuth_Custom_Scope": "범위", "Accounts_OAuth_Custom_Secret": "비밀", "Accounts_OAuth_Custom_Token_Path": "Token 경로", - "Accounts_OAuth_Custom_Token_Sent_Via": "토큰 보낸 비아", + "Accounts_OAuth_Custom_Token_Sent_Via": "보내진 토큰", "Accounts_OAuth_Custom_Username_Field": "사용자 이름 필드", "Accounts_OAuth_Drupal": "듀팔 로그인 이 활성화 되었습니다.", "Accounts_OAuth_Drupal_callback_url": "듀팔 oAuth2 리다이렉트 URI", @@ -67,42 +71,43 @@ "Accounts_OAuth_Facebook_callback_url": "페이스 북 콜백 URL", "Accounts_OAuth_Facebook_id": "Facebook 앱 ID", "Accounts_OAuth_Facebook_secret": "Facebook 암호", - "Accounts_OAuth_Github": "Github 로그인", + "Accounts_OAuth_Github": "OAuth 활성화", "Accounts_OAuth_Github_callback_url": "GitHub의 콜백 URL", "Accounts_OAuth_GitHub_Enterprise": "OAuth 활성화", - "Accounts_OAuth_GitHub_Enterprise_callback_url": "GitHub의 기업 콜백 URL", - "Accounts_OAuth_GitHub_Enterprise_id": "Client ID", + "Accounts_OAuth_GitHub_Enterprise_callback_url": "GitHub Enterprise 의 콜백 URL", + "Accounts_OAuth_GitHub_Enterprise_id": "Client 아이디", "Accounts_OAuth_GitHub_Enterprise_secret": "Client 암호", - "Accounts_OAuth_Github_id": "Github ID", + "Accounts_OAuth_Github_id": "Github 아이디", "Accounts_OAuth_Github_secret": "Github 암호", "Accounts_OAuth_Gitlab": "OAuth 활성화", "Accounts_OAuth_Gitlab_callback_url": "GitLab 콜백 URL", - "Accounts_OAuth_Gitlab_id": "GitLab ID", + "Accounts_OAuth_Gitlab_id": "GitLab 아이디", "Accounts_OAuth_Gitlab_secret": "Client 암호", "Accounts_OAuth_Google": "구글 로그인", "Accounts_OAuth_Google_callback_url": "구글 콜백 URL", - "Accounts_OAuth_Google_id": "구글 ID", + "Accounts_OAuth_Google_id": "구글 아이디", "Accounts_OAuth_Google_secret": "구글 암호", - "Accounts_OAuth_Linkedin": "LinkedIn 로그인", + "Accounts_OAuth_Linkedin": "링크드 인 로그인", "Accounts_OAuth_Linkedin_callback_url": "링크드 인 콜백 URL", - "Accounts_OAuth_Linkedin_id": "LinkedIn ID", - "Accounts_OAuth_Linkedin_secret": "LinkedIn 암호", + "Accounts_OAuth_Linkedin_id": "링크드 인 아이디", + "Accounts_OAuth_Linkedin_secret": "링크드 인 암호", "Accounts_OAuth_Meteor": "Meteor 로그인", - "Accounts_OAuth_Meteor_callback_url": "유성 콜백 URL", + "Accounts_OAuth_Meteor_callback_url": "Meteor 콜백 URL", "Accounts_OAuth_Meteor_id": "Meteor ID", "Accounts_OAuth_Meteor_secret": "Meteor 암호", "Accounts_OAuth_Twitter": "트위터 로그인", "Accounts_OAuth_Twitter_callback_url": "트위터 콜백 URL", - "Accounts_OAuth_Twitter_id": "트위터 ID", + "Accounts_OAuth_Twitter_id": "트위터 아이디", "Accounts_OAuth_Twitter_secret": "트위터 암호", - "Accounts_OAuth_Wordpress": "WordPress 로그인", + "Accounts_OAuth_Wordpress": "워드 프레스 로그인", "Accounts_OAuth_Wordpress_callback_url": "워드 프레스 콜백 URL", - "Accounts_OAuth_Wordpress_id": "WordPress ID", - "Accounts_OAuth_Wordpress_secret": "WordPress 암호", + "Accounts_OAuth_Wordpress_id": "워드 프레스 아이디", + "Accounts_OAuth_Wordpress_secret": "워드 프레스 암호", "Accounts_PasswordReset": "암호 재설정", - "Accounts_OAuth_Proxy_host": "프록시 서버", + "Accounts_OAuth_Proxy_host": "프록시 호스트", "Accounts_OAuth_Proxy_services": "프록시 서비스", "Accounts_Registration_AuthenticationServices_Default_Roles": "인증서비스용 기본 역할", + "Accounts_Registration_AuthenticationServices_Default_Roles_Description": "인증 서비스를 통해서 등록된 사용자는 기본 역할이 주어지게 됩니다.", "Accounts_Registration_AuthenticationServices_Enabled": "인증 서비스에 등록", "Accounts_RegistrationForm": "등록 양식", "Accounts_RegistrationForm_Disabled": "비활성화", @@ -110,14 +115,16 @@ "Accounts_RegistrationForm_Public": "공개", "Accounts_RegistrationForm_Secret_URL": "비밀 URL", "Accounts_RegistrationForm_SecretURL": "등록 양식 비밀 URL", - "Accounts_RegistrationForm_SecretURL_Description": "당신은 당신의 등록 URL에 추가됩니다 임의의 문자열을 제공해야합니다. 예 : https://demo.rocket.chat/register/[secret_hash]", - "Accounts_RequireNameForSignUp": "회원 가입은 이름 필요", + "Accounts_RegistrationForm_SecretURL_Description": "등록 URL에 추가될 임의의 문자열을 제공해야 합니다. 예 : https://demo.rocket.chat/register/[secret_hash]", + "Accounts_RequireNameForSignUp": "회원 가입을 위한 이름이 필요합니다.", + "Accounts_RequirePasswordConfirmation": "비밀번호 확인이 필요합니다.", "Accounts_SetDefaultAvatar": "기본 아바타 설정", + "Accounts_SetDefaultAvatar_Description": "OAuth 계정이나 Gravatar 를 바탕으로 기본 아바타 설정을 시도합니다.", "Accounts_ShowFormLogin": "폼방식 로그인 보기", "Accounts_UseDefaultBlockedDomainsList": "기본 차단 도메인리스트 사용", "Accounts_UseDNSDomainCheck": "DNS 도메인 확인 사용", - "Accounts_UserAddedEmail_Default": "

에 오신 것을 환영합니다

[Site_Name]

[Site_URL]로 이동하여 오늘날 최고의 오픈 소스 채팅 솔루션을보십시오!

[email]과 비밀번호 : [password] 당신은 당신의 이메일을 사용하여 로그인 할 수 있습니다. 당신은 처음 로그인 후 변경해야 할 수 있습니다.", - "Accounts_UserAddedEmail_Description": "다음과 같은 자리를 사용할 수 있습니다 :

  • 각각 사용자의 전체 이름, 이름 또는 성을위한 [name], [fname], [lname].
  • 사용자의 이메일 [email].
  • 사용자의 비밀번호 [password].
  • [Site_Name]와 [Site_URL] 각각 응용 프로그램 이름 및 URL합니다.
", + "Accounts_UserAddedEmail_Default": "

[Site_Name]

에 오신 것을 환영합니다\n

[Site_URL]로 이동하여 오늘날 최고의 오픈 소스 채팅 솔루션을 경험 해 보십시오!

\n

이메일:[email] 과 비밀번호 : [password] 로 로그인 할 수 있습니다. 로그인 후에는 변경하셔야 합니다.", + "Accounts_UserAddedEmail_Description": "다음의 기호를 사용할 수 있습니다:

  • [lname] - 성, [name] - 이름, [fname] - 전체이름(성+이름)
  • [email] - 사용자 이메일
  • [password] - 사용자 암호
  • [Site_Name] - 응용프로그램의 이름, [Site_URL] - URL
", "Accounts_UserAddedEmailSubject_Default": "당신이은 [Site_Name] 에 추가되었습니다", "Activate": "활성화", "Activity": "활동", @@ -141,6 +148,7 @@ "Agent_removed": "상담사가 삭제되었습니다", "Alias": "별명", "Alias_Format": "별명 형식", + "Alias_Format_Description": "앨리어스를 가지고 Slack 으로부터 메시지를 임포트 합니다.; %s 는 사용자의 username으로 대치됩니다, 비어있으면 앨리어스를 사용하지 않습니다.", "Alias_Set": "별칭 설정", "All": "모든", "All_channels": "모든 채널", @@ -149,34 +157,49 @@ "Allow_Invalid_SelfSigned_Certs": "잘못된 자체서명 Certs 를 허용합니다", "Allow_Invalid_SelfSigned_Certs_Description": "링크확인 과 프리뷰에 잘못된 자체서명 Certs 를 허용합니다.", "Allow_switching_departments": "방문자가 부서를 변경할 수 있도록 허용합니다", + "Always_open_in_new_window": "항상 새창에서 열기", "Analytics_features_enabled": "기능이 활성화 되었습니다", - "Analytics_features_messages_Description": "사용자가 메시지에 대해 수행 행동과 관련된 사용자 정의 이벤트를 추적합니다.", - "Analytics_features_rooms_Description": "채널 또는 그룹 (삭제두고 작성)에 대한 작업에 관련된 사용자 정의 이벤트를 추적합니다.", + "Analytics_features_messages_Description": "사용자의 메시지에 대해 수행 행동과 관련된 사용자 정의 이벤트를 추적합니다.", + "Analytics_features_rooms_Description": "채널 또는 그룹에 대한 작업에 관련된 사용자 정의 이벤트를 추적합니다. (생성, 채널나감, 삭제)", "Analytics_features_users_Description": "사용자 (암호 재설정 시간, 프로필 사진 변경 등)에 관련 작업에 관련된 사용자 정의 이벤트를 추적합니다.", "Analytics_Google": "구글 애널리틱스", + "Analytics_Google_id": "Tracking ID", "and": "그리고", - "And_more": "그리고 더 __length __", + "And_more": "그리고 __length __만큼 더", "Animals_and_Nature": "동물과 자연", "Announcement": "공지", "API": "API", + "API_Allow_Infinite_Count": "모든것 허용", "API_Allow_Infinite_Count_Description": "REST API 호출이 모든 내용을 하나의 호출에 리턴 할 수 있도록 할까요?", - "API_Analytics": "분석", + "API_Analytics": "분석(에널리틱스)", + "API_CORS_Origin": "CORS Origin", + "API_Default_Count": "기본 카운트", + "API_Default_Count_Description": "아무것도 지정하지 않았을 때의 REST API 결과에 대한 기본 개수", "API_Drupal_URL": "Drupal 서버 URL", "API_Drupal_URL_Description": "예: https://domain.com (마지막의 슬레시 제외)", - "API_Embed": "포함", - "API_EmbedDisabledFor": "사용자에대한 Embed 비활성화", + "API_Embed": "링크 프리뷰 포함", + "API_Embed_Description": "사용자가 웹사이트에 대한 링크를 post 했을때에 그 링크 미리보기 기능의 포함 여부", + "API_EmbedCacheExpirationDays": "캐시 만료 날짜 Embed", + "API_EmbedDisabledFor": "사용자에 대한 Embed 비활성화", "API_EmbedDisabledFor_Description": "쉼표로 구분된 사용자 이름 목록", - "API_EmbedIgnoredHosts": "포함 무시 호스트", - "API_EmbedIgnoredHosts_Description": "예를 들어, 호스트 또는 CIDR 주소의 목록을 쉼표로 구분. 로컬 호스트, 127.0.0.1, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16", + "API_EmbedIgnoredHosts": "무시되어진 호스트 Embed", + "API_EmbedIgnoredHosts_Description": "쉼표로 구분된 호스트 또는 CIDR 주소의 목록. 예. localhost, 127.0.0.1, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16", "API_EmbedSafePorts": "안전 포트", - "API_EmbedSafePorts_Description": "미리보기 허용 포트 목록을 쉼표로 구분.", + "API_EmbedSafePorts_Description": "쉼표로 구분된 미리보기를 위한 허용 포트 목록.", + "API_Enable_CORS": "CORS 활성화", + "API_Enable_Direct_Message_History_EndPoint": "Direct Message History Endpoint 활성화", + "API_Enable_Direct_Message_History_EndPoint_Description": "소속되지 않은 다른 유저로 부터 보내진 다이렉트메시지를 보기를 허용하는 'api/v1/im.history.others' 를 활성화 합니다.", + "API_Enable_Shields": "쉴드 활성화", + "API_Enable_Shields_Description": "'/api/v1/shields.svg' 에 있는 쉴드를 활성화", "API_GitHub_Enterprise_URL": "Server URL", "API_GitHub_Enterprise_URL_Description": "예: http://domain.com (마지막 슬래시 제외)", "API_Gitlab_URL": "GitLab URL", + "API_Shield_Types": "쉴드 타입", + "API_Shield_Types_Description": "쉴드의 종류", "API_Token": "API 토큰", "API_Upper_Count_Limit": "최대 레코드 수", "API_User_Limit": "채널에 모든 사용자를 추가하는 사용자 제한", - "API_Wordpress_URL": "WordPress URL", + "API_Wordpress_URL": "워드프레스 URL", "Apiai_Key": "Api.ai 키", "Apiai_Language": "Api.ai 언어", "Appearance": "외관", @@ -187,7 +210,7 @@ "Archive": "아카이브", "are_also_typing": "또한 입력중", "are_typing": "입력 중", - "Are_you_sure": "괜찮아요?", + "Are_you_sure": "확실 합니까?", "Are_you_sure_you_want_to_delete_your_account": "당신은 당신의 계정을 삭제 하시겠습니까?", "at": "...에서", "Auth_Token": "인증 토큰", @@ -221,15 +244,21 @@ "away_male": "자리비움", "Away_male": "자리비움", "Back": "뒤로", - "Back_to_applications": "다시 응용 프로그램", - "Back_to_integrations": "위로 통합에", + "Back_to_applications": "응용 프로그램으로 돌아가기", + "Back_to_integrations": "Integrations 로 돌아가기", + "Back_to_integration_detail": "Integration detail 로 돌아가기", "Back_to_login": "로그인으로 돌아가기", - "Back_to_permissions": "돌아 가기 권한", + "Back_to_permissions": "권한 으로 돌아가기", + "Backup_codes": "백업 코드", + "Beta_feature_Depends_on_Video_Conference_to_be_enabled": "베타 기능. 활성화 될 비디오컨퍼런스 에 의존 함.", "Block_User": "사용자 차단", - "Body": "신체", + "Body": "본문", "bold": "굵게", + "bot_request": "봇(bot) 요청", "BotHelpers_userFields": "사용자 필드", + "BotHelpers_userFields_Description": "bots helper methods 가 접근할 수 있는 사용자 필드에 대한 CSV.", "Branch": "분기", + "Broadcast_Connected_Instances": "연결된 인스턴스 제공(broadcast)", "Bugsnag_api_key": "Bugsnag API 키", "busy": "바쁨", "Busy": "바쁨", @@ -238,14 +267,25 @@ "busy_male": "바쁨", "Busy_male": "바쁨", "by": "으로", + "Content": "내용", "cache_cleared": "캐시가 삭제됨", "Cancel": "취소", "Cancel_message_input": "취소", - "Cannot_invite_users_to_direct_rooms": "객실을 지시하는 사용자를 초대 할 수 없습니다", + "Cannot_invite_users_to_direct_rooms": "direct room 으로 사용자를 초대할 수 없습니다.", "CAS_autoclose": "로그인 팝업을 자동으로 닫음", + "CAS_base_url": "SSO Base URL", + "CAS_base_url_Description": "외부 SSO 서비스에 대한 base URL. 예: https://sso.example.undef/sso/", "CAS_button_color": "로그인 버튼 배경 색상", "CAS_button_label_color": "로그인 버튼 텍스트 색상", "CAS_button_label_text": "로그인 버튼 레이블", + "CAS_enabled": "활성화 됨", + "CAS_Login_Layout": "CAS 로그인 Layout", + "CAS_login_url": "SSO 로그인 URL", + "CAS_login_url_Description": "외부 SSO 서비스에 대한 로그인 URL. 예: https://sso.example.undef/sso/login", + "CAS_popup_height": "로그인 팝업 높이", + "CAS_popup_width": "로그인 팝업 넓이", + "CAS_Sync_User_Data_Enabled": "항상 사용자 데이터 동기화", + "CAS_Sync_User_Data_Enabled_Description": "로그인 시 마다 외부 CAS 사용자 데이터 중 가능한 속성에 대해 항상 동기화. 주: 속성은 계정생성이 될때 마다 항상 동기화 됩니다.", "CDN_PREFIX": "CDN Prefix", "Certificates_and_Keys": "인증서와 키", "Changing_email": "변경 이메일", @@ -282,28 +322,55 @@ "Compact": "콤팩트", "Confirm_password": "암호를 확인하세요", "Conversation": "대화", - "Conversation_closed": "대화 폐쇄 : __comment__합니다.", + "Conversation_closed": "대화 종료 : __comment__.", "Convert_Ascii_Emojis": "이모지를 ASCII로 변환", - "Copied": "복사", - "Copy": "부", + "Copied": "복사된", + "Copy": "복사", "Copy_to_clipboard": "클립 보드에 복사", "COPY_TO_CLIPBOARD": "클립 보드에 복사", "Count": "카운트", "Cozy": "편안한", - "Create": "몹시 떠들어 대다", + "Create": "생성", "Create_A_New_Channel": "새 채널 만들기", "Create_new": "새로 만들기", - "Created_at": "제작", + "Created_at": "만든", "Created_at_s_by_s": " %s에 의해 %s로 만든", + "Created_at_s_by_s_triggered_by_s": "%s 에 트리거 된 %s 에 의해 %s 에 생성됨", + "CROWD_Reject_Unauthorized": "인증되지않은 것 거부", + "CRM_Integration": "CRM Integration", "Current_Chats": "현재 채팅", - "Custom": "관습", + "Current_Status": "현재 상태", + "Custom": "맞춤", + "Custom_Emoji": "사용자 정의 이모지", + "Custom_Emoji_Add": "새 이모지 추가", + "Custom_Emoji_Added_Successfully": "사용자 정의 이모자가 추가 되었습니다.", + "Custom_Emoji_Delete_Warning": "이모지 삭제는 복구 할 수 없습니다", + "Custom_Emoji_Error_Invalid_Emoji": "유효하지 않은 이모지", + "Custom_Emoji_Error_Name_Or_Alias_Already_In_Use": "사용자 정의 이모지나 그 앨리어스가 이미 사용 중입니다.", + "Custom_Emoji_Has_Been_Deleted": "사용자 정의 이모지가 삭제 되었습니다.", + "Custom_Emoji_Info": "사용자 정의 이모지 정보", + "Custom_Emoji_Updated_Successfully": "사용자 정의 이모지가 성공적으로 업데이트 되었습니다", "Custom_Fields": "사용자 정의 필드", "Custom_oauth_helper": "OAuth Provider를 설정할때, 콜백 URL을 알려줘야합니다.
%s
를 사용.", - "Custom_oauth_unique_name": "사용자 정의 OAuth 고유한 이름", - "Custom_Script_Logged_In": "사용자 정의 스크립트 로그인 한 사용자를 위해", - "Custom_Script_Logged_Out": "사용자 정의 스크립트 로그 아웃 사용자를위한", - "Dashboard": "계기반", + "Custom_oauth_unique_name": "사용자 정의 OAuth 고유 이름", + "Custom_Scripts": "사용자 정의 스크립트", + "Custom_Script_Logged_In": "로그인 한 사용자를 위한 사용자 정의 스크립트 ", + "Custom_Script_Logged_Out": "로그 아웃 사용자를 위한 사용자 정의 스크립트 ", + "Custom_Sounds": "사용자 정의 사운드", + "Custom_Sound_Add": "사용자 정의 사운드 추가", + "Custom_Sound_Delete_Warning": "사운드 삭제는 복구 할 수 없습니다.", + "Custom_Sound_Error_Invalid_Sound": "잘못된 사운드", + "Custom_Sound_Error_Name_Already_In_Use": "사용자 정의 사운드 이름이 이미 사용중입니다.", + "Custom_Sound_Has_Been_Deleted": "사용자 정의 사운드가 삭제되었습니다.", + "Custom_Sound_Info": "사용자 정의 사운드 정보", + "Custom_Sound_Saved_Successfully": "사용자 정의 사운드가 성공적으로 저장 되었습니다", + "Custom_Translations": "사용자 정의 번역(해석)", + "Custom_Translations_Description": " Key는 Key와 번역의 딕셔너리가 포함된 언어 인 유효한 JSON 이어야 합니다. 예:
{\n \"en\": {\n  \"Channels\": \"Rooms\"\n },\n \"pt\": {\n  \"Channels\": \"Salas\"\n }\n}", + "CustomSoundsFilesystem": "사용자 정의 사운드 파일시스템", + "Dashboard": "대시보드", "Date": "날짜", + "Date_From": "발신", + "Date_to": "수신", "days": "일", "DB_Migration": "데이터베이스 마이그레이션", "DB_Migration_Date": "데이터베이스 마이그레이션 날짜", @@ -375,14 +442,14 @@ "Error": "오류", "error-action-not-allowed": "__action__ 허용되지 않습니다", "error-application-not-found": "응용 프로그램을 찾을 수 없습니다", - "error-archived-duplicate-name": "이름이 '__room_name__'에 보관 된 채널이있다", + "error-archived-duplicate-name": "보관된 '__room_name__' 채널이 있습니다.", "error-avatar-invalid-url": "잘못된 아바타 URL : __url__", - "error-avatar-url-handling": "오류 __ 사용자 이름 __에 대한 URL (__url__)에서 아바타 설정을 처리하는 동안", - "error-cant-invite-for-direct-room": "직접 객실에 대한 사용자를 초대 할 수 없습니다", + "error-avatar-url-handling": " __ username__에 대한 URL (__url__)에서 아바타 설정을 처리하는 동안 오류발생", + "error-cant-invite-for-direct-room": "direct room 으로 사용자를 초대할 수 없습니다.", "error-could-not-change-email": "이메일을 변경할 수 없습니다", "error-could-not-change-name": "이름을 변경할 수 없습니다", "error-could-not-change-username": "사용자 이름을 변경할 수 없습니다", - "error-delete-protected-role": "보호 역할을 삭제할 수 없습니다", + "error-delete-protected-role": "보호된 역할을 삭제할 수 없습니다", "error-department-not-found": "부서를 찾을 수 없습니다", "error-duplicate-channel-name": "'%s' 채널 이름은 이미 존재합니다.", "error-email-domain-blacklisted": "이메일 도메인이 블랙리스트", @@ -430,7 +497,7 @@ "error-not-allowed": "허용되지 않음", "error-not-authorized": "권한이 없습니다", "error-push-disabled": "푸시을 사용할 수 없습니다", - "error-remove-last-owner": "이 마지막 소유자입니다. 이 중 하나를 제거하기 전에 새 소유자를 설정하십시오.", + "error-remove-last-owner": "마지막 소유자입니다. 제거하기 전에 새 소유자를 설정하십시오.", "error-role-in-use": "그것이 사용 때문에 역할을 삭제할 수 없습니다", "error-role-name-required": "역할 이름이 필요합니다", "error-the-field-is-required": "필드 __field__이 필요합니다.", @@ -578,7 +645,7 @@ "Join_video_call": "화상 통화에 참여", "Joined": "가입", "Jump": "도약", - "Jump_to_first_unread": "첫 번째 읽지로 이동", + "Jump_to_first_unread": "읽지않은 첫 메시지로 이동", "Jump_to_message": "메시지로 이동", "Jump_to_recent_messages": "최근 메시지에 점프", "Katex_Dollar_Syntax": "허용 달러 구문", diff --git a/packages/rocketchat-i18n/i18n/ru.i18n.json b/packages/rocketchat-i18n/i18n/ru.i18n.json index 57b3f42652df..667d1342693c 100644 --- a/packages/rocketchat-i18n/i18n/ru.i18n.json +++ b/packages/rocketchat-i18n/i18n/ru.i18n.json @@ -1072,8 +1072,8 @@ "This_email_has_already_been_used_and_has_not_been_verified__Please_change_your_password": "Такой email уже использовался и не был подтверждён. Измените ваш пароль.", "This_is_a_desktop_notification": "Это уведомление рабочего стола", "This_is_a_push_test_messsage": "Это тестовое push-уведомление", - "This_room_has_been_archived_by__username_": "Этот номер был архивируются __username__", - "This_room_has_been_unarchived_by__username_": "Этот номер был разархивирована по __username__", + "This_room_has_been_archived_by__username_": "__username__ отправил этот чат в архив", + "This_room_has_been_unarchived_by__username_": "__username__ вернул этот чат из архива", "Time_in_seconds": "Время в секундах", "Title": "Заголовок", "Title_bar_color": "Цвет строки заголовка", @@ -1192,7 +1192,7 @@ "WebRTC_Enable_Direct": "Включить для личных сообщений", "WebRTC_Enable_Private": "Включить для приватных чатов", "WebRTC_Servers": "Серверы STUN/TURN", - "WebRTC_Servers_Description": "Список STUN/TURN серверов разделен запятой.
Имя пользователя, пароль и порт разрешены в формате `username:password@stun:host:port` или `username:password@turn:host:port`.", + "WebRTC_Servers_Description": "Список STUN/TURN серверов разделен запятой.
Имя пользователя, пароль и порт разрешены в формате `username:password@stun:host:port` или `username:password@turn:host:port`.", "Welcome": "Добро пожаловать, %s.", "Welcome_to_the": "Добро пожаловать в", "Why_do_you_want_to_report_question_mark": "Почему вы хотите сообщить?", @@ -1231,7 +1231,7 @@ "Your_email_has_been_queued_for_sending": "Ваш email был поставлен в очередь на отправку", "Your_entry_has_been_deleted": "Ваша запись была удалена.", "Your_file_has_been_deleted": "Ваш файл был удалён.", - "Your_mail_was_sent_to_s": "Ваше сообщение было отправлено на %s", + "Your_mail_was_sent_to_s": "Ваше сообщение было отправлено на %s", "Your_password_is_wrong": "Неверный пароль!", "Your_push_was_sent_to_s_devices": "Ваше push-уведомление было отправлено на % устройств." } \ No newline at end of file diff --git a/packages/rocketchat-i18n/i18n/vi-VN.i18n.json b/packages/rocketchat-i18n/i18n/vi-VN.i18n.json new file mode 100644 index 000000000000..037bbed489ee --- /dev/null +++ b/packages/rocketchat-i18n/i18n/vi-VN.i18n.json @@ -0,0 +1,3 @@ +{ + "#channel": "kênh " +} \ No newline at end of file diff --git a/packages/rocketchat-livechat/app/i18n/af.i18n.json b/packages/rocketchat-livechat/app/i18n/af.i18n.json new file mode 100644 index 000000000000..bb2c6a63ae4a --- /dev/null +++ b/packages/rocketchat-livechat/app/i18n/af.i18n.json @@ -0,0 +1,4 @@ +{ + "Additional_Feedback": "Bykomende terugvoer", + "No": "Nee" +} \ No newline at end of file diff --git a/packages/rocketchat-livechat/app/i18n/el.i18n.json b/packages/rocketchat-livechat/app/i18n/el.i18n.json index 724ee91211ea..d6cb296fd414 100644 --- a/packages/rocketchat-livechat/app/i18n/el.i18n.json +++ b/packages/rocketchat-livechat/app/i18n/el.i18n.json @@ -1,13 +1,21 @@ { "Additional_Feedback": "Πρόσθετα Σχόλια", "Appearance": "Εμφάνιση", + "Are_you_sure_do_you_want_end_this_chat": "Είσαι σίγουρος ότι θες να τερματίσεις τη συνομιλία;", + "Cancel": "Ακύρωση", + "Change": "Αλλαγή", + "Chat_ended": "Η συνομιλία τελείωσε!", + "Close_menu": "Κλείσιμο μενού", "Conversation_finished": "Η συνομιλία τελείωσε", + "End_chat": "Τερματισμός συνομιλίας", "How_friendly_was_the_chat_agent": "Πόσο φιλικός ήταν ο εκπρόσωπος μας;", "How_knowledgeable_was_the_chat_agent": "Πώς γνώστης ήταν ο εκπρόσωπος μας;", "How_responsive_was_the_chat_agent": "Πώς ανταποκρίσιμος ήταν ο εκπρόσωπος μας;", "How_satisfied_were_you_with_this_chat": "Πόσο ικανοποιημένοι είστε με αυτήν την συνομιλία;", "Installation": "Εγκατάσταση", "New_messages": "Νέα μηνύματα", + "No": "Όχι", + "Options": "Επιλογές", "Please_answer_survey": "Αφιερώστε λίγο χρόνο για να απαντήσετε σε μια σύντομη έρευνα σχετικά με αυτή τη συνομιλία", "Please_fill_name_and_email": "Παρακαλούμε συμπληρώστε το όνομα και το e-mail", "Powered_by": "Powered by", @@ -19,11 +27,14 @@ "Survey_instructions": "Βαθμολογήστε κάθε ερώτηση, σύμφωνα με την ικανοποίησή σας, 1 που σημαίνει ότι θα είναι εντελώς ανικανοποίητοι και 5 σημαίνει ότι είστε απόλυτα ικανοποιημένοι.", "Thank_you_for_your_feedback": "Ευχαριστούμε για την ανταπόκρισή σας", "Thanks_We_ll_get_back_to_you_soon": "Ευχαριστώ! Θα επικοινωνήσουμε μαζί σας σύντομα.", + "transcript_sent": "Το αντίγραφο της συνομιλίας στάλθηκε", "Type_your_email": "Πληκτρολογήστε το email σας", "Type_your_message": "Πληκτρολογήστε το μήνυμά σας", "Type_your_name": "Πληκτρολογήστε το όνομά σας", "User_joined": "εντάχθηκε χρήστη", "User_left": "αριστερή χρήστη", "We_are_offline_Sorry_for_the_inconvenience": "Είμαστε εκτός σύνδεσης. Συγγνώμη για την ταλαιπωρία.", + "Yes": "Ναι", + "You": "Εσύ", "You_must_complete_all_fields": "Πρέπει να συμπληρώσετε όλα τα πεδία" } \ No newline at end of file diff --git a/packages/rocketchat-livechat/app/i18n/fi.i18n.json b/packages/rocketchat-livechat/app/i18n/fi.i18n.json index d9797d678dff..9efa433e873f 100644 --- a/packages/rocketchat-livechat/app/i18n/fi.i18n.json +++ b/packages/rocketchat-livechat/app/i18n/fi.i18n.json @@ -2,8 +2,11 @@ "Additional_Feedback": "Lisäpalaute", "Appearance": "Ulkoasu", "Are_you_sure_do_you_want_end_this_chat": "Haluatko lopettaa tämän keskustelun?", + "Are_you_sure_do_you_want_end_this_chat_and_switch_department": "Oletko varma että haluat lopettaa tämän keskustelun ja vaihtaa osastoa?", "Cancel": "Peruuta", + "Change": "Muuta", "Chat_ended": "Keskustelu lopetettu!", + "Choose_a_new_department": "Valitse uusi osasto", "Close_menu": "Sulje valikko", "Conversation_finished": "Keskustelu päättynyt", "End_chat": "Lopeta keskustelu", @@ -16,9 +19,12 @@ "No": "Ei", "Options": "Valinnat", "Please_answer_survey": "Käytä hetki vastataksesi pikakyselyyn tästä chatista", + "Please_choose_a_department": "Ole hyvä ja valitse uusi osasto", "Please_fill_name_and_email": "Täytä nimi ja sähköpostiosoite", "Powered_by": "Palvelun tarjoaa", "Select_a_department": "Valitse osasto", + "Switch_department": "Vaihda osastoa", + "Department_switched": "Osasto vaihdettu", "Send": "Lähetä", "Skip": "Ohita", "Start_Chat": "Aloita Chat", diff --git a/packages/rocketchat-livechat/app/i18n/ko.i18n.json b/packages/rocketchat-livechat/app/i18n/ko.i18n.json index 04b448a9da55..4b8d8bc0aaa2 100644 --- a/packages/rocketchat-livechat/app/i18n/ko.i18n.json +++ b/packages/rocketchat-livechat/app/i18n/ko.i18n.json @@ -1,6 +1,6 @@ { "Additional_Feedback": "추가 의견", - "Appearance": "모양", + "Appearance": "보기", "Are_you_sure_do_you_want_end_this_chat": "이 채팅을 정말 끝내시겠습니까?", "Are_you_sure_do_you_want_end_this_chat_and_switch_department": "현재 진행중인 채팅을 종료하고 부서를 변경하시겠습니까?", "Cancel": "취소", diff --git a/packages/rocketchat-livechat/app/i18n/vi-VN.i18n.json b/packages/rocketchat-livechat/app/i18n/vi-VN.i18n.json new file mode 100644 index 000000000000..c76b13117526 --- /dev/null +++ b/packages/rocketchat-livechat/app/i18n/vi-VN.i18n.json @@ -0,0 +1,3 @@ +{ + "Additional_Feedback": "Phản hồi bổ sung" +} \ No newline at end of file From 46762eef0e7a5ded82598f0890a8a89856d82aa3 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Wed, 28 Jun 2017 18:49:01 -0300 Subject: [PATCH 61/78] Merge release-candidate --- .docker/Dockerfile | 2 +- .sandstorm/sandstorm-pkgdef.capnp | 2 +- .travis/snap.sh | 2 +- package.json | 2 +- packages/rocketchat-lib/rocketchat.info | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index 994ba0c14b48..beaccef6157c 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -1,6 +1,6 @@ FROM rocketchat/base:4 -ENV RC_VERSION 0.57.0-rc.3 +ENV RC_VERSION 0.57.0-develop MAINTAINER buildmaster@rocket.chat diff --git a/.sandstorm/sandstorm-pkgdef.capnp b/.sandstorm/sandstorm-pkgdef.capnp index 4bcfb679eb72..c794307a7de6 100644 --- a/.sandstorm/sandstorm-pkgdef.capnp +++ b/.sandstorm/sandstorm-pkgdef.capnp @@ -21,7 +21,7 @@ const pkgdef :Spk.PackageDefinition = ( appVersion = 62, # Increment this for every release. - appMarketingVersion = (defaultText = "0.57.0-rc.3"), + appMarketingVersion = (defaultText = "0.57.0-develop"), # Human-readable representation of appVersion. Should match the way you # identify versions of your app in documentation and marketing. diff --git a/.travis/snap.sh b/.travis/snap.sh index f7b7cadd5493..8b602fa558c0 100755 --- a/.travis/snap.sh +++ b/.travis/snap.sh @@ -17,7 +17,7 @@ elif [[ $TRAVIS_TAG ]]; then RC_VERSION=$TRAVIS_TAG else CHANNEL=edge - RC_VERSION=0.57.0-rc.3 + RC_VERSION=0.57.0-develop fi echo "Preparing to trigger a snap release for $CHANNEL channel" diff --git a/package.json b/package.json index e07258126087..f7d366b5bab0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "Rocket.Chat", "description": "The Ultimate Open Source WebChat Platform", - "version": "0.57.0-rc.3", + "version": "0.57.0-develop", "author": { "name": "Rocket.Chat", "url": "https://rocket.chat/" diff --git a/packages/rocketchat-lib/rocketchat.info b/packages/rocketchat-lib/rocketchat.info index b89c94081369..fbad42938baf 100644 --- a/packages/rocketchat-lib/rocketchat.info +++ b/packages/rocketchat-lib/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "0.57.0-rc.3" + "version": "0.57.0-develop" } From fc4fbe74b1be1ac39f35051992d4c0f3f1f06d01 Mon Sep 17 00:00:00 2001 From: Aaron Ogle Date: Thu, 29 Jun 2017 17:03:01 -0500 Subject: [PATCH 62/78] Dont mention if replying to self --- packages/rocketchat-lib/client/MessageAction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rocketchat-lib/client/MessageAction.js b/packages/rocketchat-lib/client/MessageAction.js index ae3f68edd982..993cc6fe97c9 100644 --- a/packages/rocketchat-lib/client/MessageAction.js +++ b/packages/rocketchat-lib/client/MessageAction.js @@ -106,7 +106,7 @@ Meteor.startup(function() { const roomInfo = RocketChat.models.Rooms.findOne(message.rid, { fields: { t: 1 } }); let text = `[ ](${ url }) `; - if (roomInfo.t !== 'd') { + if (roomInfo.t !== 'd' && message.u.username !== Meteor.user().username) { text += `@${ message.u.username } `; } From 02017e122f10b439628f5a34369b271f30372bcc Mon Sep 17 00:00:00 2001 From: Oliver Acevedo Date: Fri, 30 Jun 2017 11:12:06 -0500 Subject: [PATCH 63/78] Fix sweet-alert box position for mobile devices --- packages/rocketchat-theme/client/imports/base.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/rocketchat-theme/client/imports/base.css b/packages/rocketchat-theme/client/imports/base.css index 139776250008..ed397062f772 100644 --- a/packages/rocketchat-theme/client/imports/base.css +++ b/packages/rocketchat-theme/client/imports/base.css @@ -4656,6 +4656,12 @@ body:not(.is-cordova) { } } +@media all and (max-width: 540px) { + .sweet-alert { + margin-left: 0 !important; + } +} + .one-passsword { background-image: url('/images/onepassword-button.png'); height: 40px; From bc546b7ed58d65756dcc51b42e236096fd0000a3 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Fri, 30 Jun 2017 17:07:18 -0300 Subject: [PATCH 64/78] revert i18n sorting --- .../client/views/permissions.html | 2 +- packages/rocketchat-i18n/i18n/en.i18n.json | 75 +------------------ 2 files changed, 2 insertions(+), 75 deletions(-) diff --git a/packages/rocketchat-authorization/client/views/permissions.html b/packages/rocketchat-authorization/client/views/permissions.html index 683f6c091c33..e0e47d6b426d 100644 --- a/packages/rocketchat-authorization/client/views/permissions.html +++ b/packages/rocketchat-authorization/client/views/permissions.html @@ -19,7 +19,7 @@ {{#each permission}} - {{_ permissionName}} + {{_ permissionName}}
[{{_id}}] {{#each role}} diff --git a/packages/rocketchat-i18n/i18n/en.i18n.json b/packages/rocketchat-i18n/i18n/en.i18n.json index 982cff8d3d95..e9cdb23e3dd8 100644 --- a/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/packages/rocketchat-i18n/i18n/en.i18n.json @@ -1155,223 +1155,150 @@ "People": "People", "Permalink": "Permalink", "Permissions": "Permissions", - "access-mailer":"Access Mailer Screen", "access-mailer_description":"Permission to send mass email to all users.", - "access-permissions":"Access Permissions Screen", "access-permissions_description":"Modify permissions for various roles.", - "add-oauth-service":"Add Oauth Service", "add-oauth-service_description":"Permission to add a new Oauth service", - "add-user":"Add User", "add-user_description":"Permission to add new users to the server via users screen", - "add-user-to-any-c-room":"Add User to Any Public Channel", "add-user-to-any-c-room_description":"Permission to add a user to any public channel", - "add-user-to-any-p-room":"Add User to Any Private Channel", "add-user-to-any-p-room_description":"Permission to add a user to any private channel", - "add-user-to-joined-room":"Add User to Any Joined Channel", "add-user-to-joined-room_description":"Permission to add a user to a currently joined channel", - "archive-room":"Archive Room", "archive-room_description":"Permission to archive a channel", - "assign-admin-role":"Assign Admin Role", "assign-admin-role_description":"Permission to assign the admin role to other users", - "auto-translate":"Auto Translate", "auto-translate_description":"Permission to use the auto translate tool", - "ban-user":"Ban User", "ban-user_description":"Permission to ban a user from a channel", - "bulk-create-c":"Bulk Create Channels", "bulk-create-c_description":"Permission to create channels in bulk", - "bulk-register-user":"Bulk Create Channels", "bulk-register-user_description":"Permission to create channels in bulk", - "clean-channel-history":"Clean Channel History", "clean-channel-history_description":"Permission to Clear the history from channels", - "close-livechat-room":"Close Livechat Room", "close-livechat-room_description":"Permission to close the current LiveChat channel", - "close-others-livechat-room":"Close Livechat Room", "close-others-livechat-room_description":"Permission to close other LiveChat channels", - "create-c":"Create Public Channels", "create-c_description":"Permission to create public channels", - "create-d":"Create Direct Messages", "create-d_description":"Permission to start direct messages", - "create-p":"Create Private Channels", "create-p_description":"Permission to create private channels", - "create-user":"Create User", "create-user_description":"Permission to create users", - "delete-c":"Delete Public Channels", "delete-c_description":"Permission to delete public channels", - "delete-d":"Delete Direct Messages", "delete-d_description":"Permission to delete direct messages", - "delete-p":"Delete Private Channels", "delete-p_description":"Permission to delete private channels", - "delete-message":"Delete Message", "delete-message_description":"Permission to delete a message within a room", - "delete-user":"Delete User", "delete-user_description":"Permission to delete users", - "edit-message":"Edit Message", "edit-message_description":"Permission to edit a message within a room", - "edit-other-user-active-status":"Edit Other User Active Status", "edit-other-user-active-status_description":"Permission to enable or disable other accounts", - "edit-other-user-info":"Edit Other User Information", "edit-other-user-info_description":"Permission to change other user’s name, username or email address.", - "edit-other-user-password":"Edit Other User Password", "edit-other-user-password_description":"Permission to modify other user’s passwords. Requires edit-other-user-info permission.", - "edit-privileged-setting":"Edit privileged Setting", "edit-privileged-setting_description":"Permission to edit settings", - "edit-room":"Edit Room", "edit-room_description":"Permission to edit a room’s name, topic, type (private or public status) and status (active or archived)", - "force-delete-message":"Force Delete Message", "force-delete-message_description":"Permission to delete a message bypassing all restrictions", - "join-without-join-code":"Join Without Join Code", "join-without-join-code_description":"Permission to bypass the join code in channels with join code enabled", - "mail-messages":"Mail Messages", "mail-messages_description":"Permission to use the mail messages option", - "manage-assets":"Manage Assets", "manage-assets_description":"Permission to manage the server assets", - "manage-emoji":"Manage Emoji", "manage-emoji_description":"Permission to manage the server emojis", - "manage-integrations":"Manage Integrations", "manage-integrations_description":"Permission to manage the server integrations", - "manage-oauth-apps":"Manage Oauth Apps", "manage-oauth-apps_description":"Permission to manage the server Oauth apps", - "manage-own-integrations":"Manage Own Integrations", "manage-own-integrations_description":"Permition to users create and edit their own integration or webhooks", - "manage-sounds":"Manage Sounds", "manage-sounds_description":"Permission to manage the server sounds", - "mention-all":"Mention All", "mention-all_description":"Permission to use the @all mention", - "mute-user":"Mute User", "mute-user_description":"Permission to mute other users in the same channel", - "pin-message":"Pin Message", "pin-message_description":"Permission to pin a message in a channel", - "post-readonly":"Post ReadOnly", "post-readonly_description":"Permission to post a message in a read-only channel", - "preview-c-room":"Preview Public Channel", "preview-c-room_description":"Permission view the contents of a public channel before joining", - "remove-user":"Remove User", "remove-user_description":"Permission to remove a user from a room", - "run-import":"Run Import", "run-import_description":"Permission to run the importers", - "run-migration":"Run Migration", "run-migration_description":"Permission to run the migrations", - "save-others-livechat-room-info":"Save Others Livechat Room Info", "save-others-livechat-room-info_description":"Permission to save information from other livechat channels", - "set-moderator":"Set Moderator", "set-moderator_description":"Permission to set other users as moderator of a channel", - "set-owner":"Set Owner", "set-owner_description":"Permission to set other users as owner of a channel", - "set-react-when-readonly":"Set React When ReadOnly", "set-react-when-readonly_description":"Permission to set the ability to react to messages in a read only channel", - "set-readonly":"Set ReadOnly", "set-readonly_description":"Permission to set a channel to read only channel", - "snippet-message":"Snippet Message", "snippet-message_description":"Permission to create snippet message", - "unarchive-room":"Unarchive Room", "unarchive-room_description":"Permission to unarchive channels", - "user-generate-access-token":"User Generate Access Token", "user-generate-access-token_description":"Permission to users generate access tokens", - "view-c-room":"View Public Channel", "view-c-room_description":"Permission to view public channels", - "view-d-room":"View Direct Messages", "view-d-room_description":"Permission to view direct messages", - "view-full-other-user-info":"View Full Other User Info", "view-full-other-user-info_description":"Permission to view full profile of other users including account creation date, last login, etc.", - "view-history":"View History", "view-history_description":"Permission to view the channel history", - "view-join-code":"View Join Code", "view-join-code_description":"Permission to view the channel join code", - "view-joined-room":"View Joined Room", "view-joined-room_description":"Permission to view the currently joined channels", - "view-l-room":"View Livechat Rooms", "view-l-room_description":"Permission to view livechat channels", - "view-livechat-manager":"View Livechat Manager", "view-livechat-manager_description":"Permission to view other livechat managers", - "view-livechat-rooms":"View Livechat Rooms", "view-livechat-rooms_description":"Permission to view other livechat channels", - "view-logs":"View Logs", "view-logs_description":"Permission to view the server logs ", - "view-p-room":"View Private Room", "view-p-room_description":"Permission to view private channels", - "view-privileged-setting":"View Privileged Setting", "view-privileged-setting_description":"Permission to view settings", - "view-other-user-channels":"View Other User Channels", "view-other-user-channels_description":"Permission to view channels owned by other users", - "view-room-administration":"View Room Administration", "view-room-administration_description":"Permission to view public, private and direct message statistics. Does not include the ability to view conversations or archives", - "view-statistics":"View Private Room", "view-statistics_description":"Permission o view system statistics such as number of users logged in, number of rooms, operating system information", - "view-user-administration":"View User Administration", "view-user-administration_description":"Permission to partial, read-only list view of other user accounts currently logged into the system. No user account information is accessible with this permission", - "Pin_Message": "Pin Message", "Pinned_a_message": "Pinned a message:", "Pinned_Messages": "Pinned Messages", @@ -1942,4 +1869,4 @@ "your_message_optional": "your message (optional)", "Your_password_is_wrong": "Your password is wrong!", "Your_push_was_sent_to_s_devices": "Your push was sent to %s devices" -} +} \ No newline at end of file From 2e8251d805d350518854b343379237b1b59e6f07 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Fri, 30 Jun 2017 17:14:24 -0300 Subject: [PATCH 65/78] fix typos --- packages/rocketchat-i18n/i18n/en.i18n.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/rocketchat-i18n/i18n/en.i18n.json b/packages/rocketchat-i18n/i18n/en.i18n.json index e9cdb23e3dd8..c420047213a3 100644 --- a/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/packages/rocketchat-i18n/i18n/en.i18n.json @@ -1232,7 +1232,7 @@ "manage-oauth-apps":"Manage Oauth Apps", "manage-oauth-apps_description":"Permission to manage the server Oauth apps", "manage-own-integrations":"Manage Own Integrations", - "manage-own-integrations_description":"Permition to users create and edit their own integration or webhooks", + "manage-own-integrations_description":"Permition to allow users to create and edit their own integration or webhooks", "manage-sounds":"Manage Sounds", "manage-sounds_description":"Permission to manage the server sounds", "mention-all":"Mention All", @@ -1244,7 +1244,7 @@ "post-readonly":"Post ReadOnly", "post-readonly_description":"Permission to post a message in a read-only channel", "preview-c-room":"Preview Public Channel", - "preview-c-room_description":"Permission view the contents of a public channel before joining", + "preview-c-room_description":"Permission to view the contents of a public channel before joining", "remove-user":"Remove User", "remove-user_description":"Permission to remove a user from a room", "run-import":"Run Import", @@ -1266,7 +1266,7 @@ "unarchive-room":"Unarchive Room", "unarchive-room_description":"Permission to unarchive channels", "user-generate-access-token":"User Generate Access Token", - "user-generate-access-token_description":"Permission to users generate access tokens", + "user-generate-access-token_description":"Permission for users to generate access tokens", "view-c-room":"View Public Channel", "view-c-room_description":"Permission to view public channels", "view-d-room":"View Direct Messages", @@ -1295,7 +1295,7 @@ "view-other-user-channels_description":"Permission to view channels owned by other users", "view-room-administration":"View Room Administration", "view-room-administration_description":"Permission to view public, private and direct message statistics. Does not include the ability to view conversations or archives", - "view-statistics":"View Private Room", + "view-statistics":"View Statistics", "view-statistics_description":"Permission o view system statistics such as number of users logged in, number of rooms, operating system information", "view-user-administration":"View User Administration", "view-user-administration_description":"Permission to partial, read-only list view of other user accounts currently logged into the system. No user account information is accessible with this permission", From d25a515f9e0889c9bbd366ef296ecb68de230d80 Mon Sep 17 00:00:00 2001 From: Gabriel Delavald Date: Fri, 30 Jun 2017 17:36:27 -0300 Subject: [PATCH 66/78] Refactoring markdowncode a bit and fixes messages showing unescaped when just sent --- packages/rocketchat-markdown/markdowncode.js | 31 ++++++------------- packages/rocketchat-mentions/Mentions.js | 3 +- .../client/renderMessageBody.js | 6 ++-- 3 files changed, 13 insertions(+), 27 deletions(-) diff --git a/packages/rocketchat-markdown/markdowncode.js b/packages/rocketchat-markdown/markdowncode.js index 65f00ce79ff1..e00b030d01bc 100644 --- a/packages/rocketchat-markdown/markdowncode.js +++ b/packages/rocketchat-markdown/markdowncode.js @@ -60,29 +60,16 @@ class MarkdownCode { if (codeMatch != null) { // Process highlight if this part is code - let code; - let lang; - let result; const singleLine = codeMatch[0].indexOf('\n') === -1; - - if (singleLine) { - lang = ''; - code = _.unescapeHTML(codeMatch[1] + codeMatch[2]); - } else { - lang = codeMatch[1]; - code = _.unescapeHTML(codeMatch[2]); - } - - if (s.trim(lang) === '') { - lang = ''; - } - - if (!Array.from(hljs.listLanguages()).includes(s.trim(lang))) { - result = hljs.highlightAuto((lang + code)); - } else { - result = hljs.highlight(s.trim(lang), code); - } - + const lang = !singleLine && Array.from(hljs.listLanguages()).includes(s.trim(codeMatch[1])) ? s.trim(codeMatch[1]) : ''; + const code = + singleLine ? + _.unescapeHTML(codeMatch[1]) : + lang === '' ? + _.unescapeHTML(codeMatch[1] + codeMatch[2]) : + _.unescapeHTML(codeMatch[2]); + + const result = lang === '' ? hljs.highlightAuto((lang + code)) : hljs.highlight(lang, code); const token = `=!=${ Random.id() }=!=`; message.tokens.push({ diff --git a/packages/rocketchat-mentions/Mentions.js b/packages/rocketchat-mentions/Mentions.js index 55959a9bed54..c9a744a9ac40 100644 --- a/packages/rocketchat-mentions/Mentions.js +++ b/packages/rocketchat-mentions/Mentions.js @@ -50,7 +50,8 @@ export default class { }); } replaceChannels(str, message) { - return str.replace(this.channelMentionRegex, (match, name) => { + //since apostrophe escaped contains # we need to unescape it + return str.replace(/'/g, '\'').replace(this.channelMentionRegex, (match, name) => { if (message.temp == null && _.findWhere(message.channels, {name}) == null) { return match; } diff --git a/packages/rocketchat-ui-message/client/renderMessageBody.js b/packages/rocketchat-ui-message/client/renderMessageBody.js index ec6dc6a89056..ebaa6a9eded4 100644 --- a/packages/rocketchat-ui-message/client/renderMessageBody.js +++ b/packages/rocketchat-ui-message/client/renderMessageBody.js @@ -1,10 +1,8 @@ /* global renderMessageBody:true */ renderMessageBody = function(msg) { - msg.html = msg.msg; - - if (_.trim(msg.html) !== '') { - msg.html = _.escapeHTML(msg.html); + if (_.trim(msg.msg) !== '') { + msg.html = _.escapeHTML(msg.msg); } const message = RocketChat.callbacks.run('renderMessage', msg); From ab28c73e1788d290066fdcb6b893070b3d3eb7d6 Mon Sep 17 00:00:00 2001 From: Gabriel Delavald Date: Fri, 30 Jun 2017 18:04:47 -0300 Subject: [PATCH 67/78] lint fix --- packages/rocketchat-ui-message/client/renderMessageBody.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rocketchat-ui-message/client/renderMessageBody.js b/packages/rocketchat-ui-message/client/renderMessageBody.js index ebaa6a9eded4..9babc5e7025b 100644 --- a/packages/rocketchat-ui-message/client/renderMessageBody.js +++ b/packages/rocketchat-ui-message/client/renderMessageBody.js @@ -2,7 +2,7 @@ renderMessageBody = function(msg) { if (_.trim(msg.msg) !== '') { - msg.html = _.escapeHTML(msg.msg); + msg.html = _.escapeHTML(msg.msg); } const message = RocketChat.callbacks.run('renderMessage', msg); From d182b169f5866fb498f6cfc0bf5795c442ef1f0a Mon Sep 17 00:00:00 2001 From: Gabriel Engel Date: Fri, 30 Jun 2017 19:15:42 -0300 Subject: [PATCH 68/78] dependencies upgrade --- .meteor/versions | 12 ++++++------ package.json | 8 ++++---- packages/rocketchat-livechat/app/.meteor/versions | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.meteor/versions b/.meteor/versions index 0308b0b5ac70..cadd1f98c7c3 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -1,5 +1,5 @@ accounts-base@1.3.0 -accounts-facebook@1.2.0 +accounts-facebook@1.2.1 accounts-github@1.3.0 accounts-google@1.2.0 accounts-meteor-developer@1.3.0 @@ -9,14 +9,14 @@ accounts-twitter@1.3.0 aldeed:simple-schema@1.5.3 allow-deny@1.0.5 autoupdate@1.3.12 -babel-compiler@6.19.2 +babel-compiler@6.19.3 babel-runtime@1.0.1 base64@1.0.10 binary-heap@1.0.10 blaze@2.3.2 blaze-html-templates@1.1.2 blaze-tools@1.0.10 -boilerplate-generator@1.1.0 +boilerplate-generator@1.1.1 caching-compiler@1.1.9 caching-html-compiler@1.1.2 callback-hook@1.0.10 @@ -34,7 +34,7 @@ deps@1.0.12 diff-sequence@1.0.7 dispatch:run-as-user@1.1.1 dynamic-import@0.1.1 -ecmascript@0.8.0 +ecmascript@0.8.1 ecmascript-runtime@0.4.1 ecmascript-runtime-client@0.4.2 ecmascript-runtime-server@0.4.1 @@ -42,7 +42,7 @@ edgee:slingshot@0.7.1 ejson@1.0.13 email@1.2.3 emojione:emojione@3.0.3 -facebook-oauth@1.3.1 +facebook-oauth@1.3.2 fastclick@1.0.13 francocatena:status@1.5.3 geojson-utils@1.0.10 @@ -89,7 +89,7 @@ mizzao:autocomplete@0.5.1 mizzao:timesync@0.3.4 mobile-experience@1.0.4 mobile-status-bar@1.0.14 -modules@0.9.1 +modules@0.9.2 modules-runtime@0.8.0 mongo@1.1.18 mongo-id@1.0.6 diff --git a/package.json b/package.json index f7d366b5bab0..2b19b57bce9b 100644 --- a/package.json +++ b/package.json @@ -81,19 +81,19 @@ "babel-plugin-array-includes": "^2.0.3", "chimp": "^0.49.0", "conventional-changelog-cli": "^1.3.1", - "eslint": "^4.0.0", + "eslint": "^4.1.1", "postcss-cssnext": "^2.11.0", "postcss-smart-import": "^0.7.4", "simple-git": "^1.73.0", - "stylelint": "^7.11.1", + "stylelint": "^7.12.0", "supertest": "^3.0.0" }, "dependencies": { "@google-cloud/storage": "^1.1.1", - "aws-sdk": "^2.73.0", + "aws-sdk": "^2.80.0", "babel-runtime": "^6.23.0", "bcrypt": "^1.0.2", - "codemirror": "^5.26.0", + "codemirror": "^5.27.4", "file-type": "^5.2.0", "highlight.js": "^9.12.0", "jquery": "^3.2.1", diff --git a/packages/rocketchat-livechat/app/.meteor/versions b/packages/rocketchat-livechat/app/.meteor/versions index 544530b6eca2..31564bdee99e 100644 --- a/packages/rocketchat-livechat/app/.meteor/versions +++ b/packages/rocketchat-livechat/app/.meteor/versions @@ -2,13 +2,13 @@ accounts-base@1.3.0 accounts-password@1.3.7 aldeed:simple-schema@1.5.3 allow-deny@1.0.5 -babel-compiler@6.19.2 +babel-compiler@6.19.3 babel-runtime@1.0.1 base64@1.0.10 binary-heap@1.0.10 blaze@2.3.2 blaze-tools@1.0.10 -boilerplate-generator@1.1.0 +boilerplate-generator@1.1.1 caching-compiler@1.1.9 caching-html-compiler@1.1.2 callback-hook@1.0.10 @@ -23,7 +23,7 @@ ddp-server@1.3.14 deps@1.0.12 diff-sequence@1.0.7 dynamic-import@0.1.1 -ecmascript@0.8.0 +ecmascript@0.8.1 ecmascript-runtime@0.4.1 ecmascript-runtime-client@0.4.2 ecmascript-runtime-server@0.4.1 @@ -50,7 +50,7 @@ minifier-css@1.2.16 minifier-js@2.1.0 minimongo@1.2.1 mizzao:timesync@0.5.0 -modules@0.9.1 +modules@0.9.2 modules-runtime@0.8.0 momentjs:moment@2.18.1 mongo@1.1.18 From 8924b67c16e632cd325eb12cf84b1f024ea79f8a Mon Sep 17 00:00:00 2001 From: Gabriel Delavald Date: Mon, 3 Jul 2017 17:36:31 -0300 Subject: [PATCH 69/78] Rollback changes to renderMessageBody which were causing exception --- packages/rocketchat-ui-message/client/renderMessageBody.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/rocketchat-ui-message/client/renderMessageBody.js b/packages/rocketchat-ui-message/client/renderMessageBody.js index 9babc5e7025b..ec6dc6a89056 100644 --- a/packages/rocketchat-ui-message/client/renderMessageBody.js +++ b/packages/rocketchat-ui-message/client/renderMessageBody.js @@ -1,8 +1,10 @@ /* global renderMessageBody:true */ renderMessageBody = function(msg) { - if (_.trim(msg.msg) !== '') { - msg.html = _.escapeHTML(msg.msg); + msg.html = msg.msg; + + if (_.trim(msg.html) !== '') { + msg.html = _.escapeHTML(msg.html); } const message = RocketChat.callbacks.run('renderMessage', msg); From 915f82a1cda51bb4e38d6acd57b5d2865c854dc3 Mon Sep 17 00:00:00 2001 From: Karl Prieb Date: Tue, 4 Jul 2017 16:14:08 -0300 Subject: [PATCH 70/78] Fix sweetalert alignment on mobile --- packages/rocketchat-theme/client/imports/base.css | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/rocketchat-theme/client/imports/base.css b/packages/rocketchat-theme/client/imports/base.css index 139776250008..580ba865b567 100644 --- a/packages/rocketchat-theme/client/imports/base.css +++ b/packages/rocketchat-theme/client/imports/base.css @@ -4648,12 +4648,8 @@ body:not(.is-cordova) { } } -.sweet-alert { - margin-left: -239px !important; - - & .sa-input-error { - top: 19px; - } +.sweet-alert .sa-input-error { + top: 19px; } .one-passsword { @@ -4796,6 +4792,10 @@ a + br.only-after-a { .main-content { transform: translateX(0) !important; } + + .sweet-alert { + margin-left: -239px !important; + } } @media (width <= 780px) { From 0fe0b63723693804052244b8e3bcd4ac8e24db9e Mon Sep 17 00:00:00 2001 From: Karl Prieb Date: Tue, 4 Jul 2017 17:00:29 -0300 Subject: [PATCH 71/78] fix media query --- packages/rocketchat-theme/client/imports/base.css | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/rocketchat-theme/client/imports/base.css b/packages/rocketchat-theme/client/imports/base.css index e94936eea52f..580ba865b567 100644 --- a/packages/rocketchat-theme/client/imports/base.css +++ b/packages/rocketchat-theme/client/imports/base.css @@ -4652,12 +4652,6 @@ body:not(.is-cordova) { top: 19px; } -@media all and (max-width: 540px) { - .sweet-alert { - margin-left: 0 !important; - } -} - .one-passsword { background-image: url('/images/onepassword-button.png'); height: 40px; From f24a8d560e009d172ed6eb436e9a80a050795c99 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Wed, 5 Jul 2017 18:15:40 -0300 Subject: [PATCH 72/78] Run avatar migration after server startup --- server/startup/migrations/v097.js | 116 +++++++++++++++--------------- 1 file changed, 59 insertions(+), 57 deletions(-) diff --git a/server/startup/migrations/v097.js b/server/startup/migrations/v097.js index 1ec5ae82c8ef..a283984d5bb4 100644 --- a/server/startup/migrations/v097.js +++ b/server/startup/migrations/v097.js @@ -117,75 +117,77 @@ RocketChat.Migrations.add({ const avatarsPath = RocketChat.models.Settings.findOne({_id: 'Accounts_AvatarStorePath'}).value; const avatarStoreType = RocketChat.models.Settings.findOne({_id: 'Accounts_AvatarStoreType'}).value; - Meteor.setTimeout(function() { - const avatarsFileStore = FileUpload.getStore('Avatars'); + Meteor.startup(function() { + Meteor.setTimeout(function() { + const avatarsFileStore = FileUpload.getStore('Avatars'); - const oldAvatarGridFS = new RocketChatFile.GridFS({ - name: 'avatars' - }); + const oldAvatarGridFS = new RocketChatFile.GridFS({ + name: 'avatars' + }); - const users = RocketChat.models.Users.find({avatarOrigin: {$in: avatarOrigins}}, {avatarOrigin: 1, username: 1}).fetch(); + const users = RocketChat.models.Users.find({avatarOrigin: {$in: avatarOrigins}}, {avatarOrigin: 1, username: 1}).fetch(); - const usersTotal = users.length; + const usersTotal = users.length; - log('Total users to migrate avatars ->', usersTotal); + log('Total users to migrate avatars ->', usersTotal); - let current = 0; + let current = 0; - batch(users, 300, (user) => { - const id = `${ user.username }.jpg`; + batch(users, 300, (user) => { + const id = `${ user.username }.jpg`; - const gridFSAvatar = oldAvatarGridFS.getFileWithReadStream(id); + const gridFSAvatar = oldAvatarGridFS.getFileWithReadStream(id); - log('Migrating', ++current, 'of', usersTotal); + log('Migrating', ++current, 'of', usersTotal); - if (gridFSAvatar) { - const details = { - userId: user._id, - type: gridFSAvatar.contentType, - size: gridFSAvatar.length - }; + if (gridFSAvatar) { + const details = { + userId: user._id, + type: gridFSAvatar.contentType, + size: gridFSAvatar.length + }; - return insertAvatar({ - details, - avatarsFileStore, - stream: gridFSAvatar.readStream, - callback() { - oldAvatarGridFS.deleteFile(id); - } - }); - } - if (avatarStoreType === 'FileSystem' && avatarsPath && avatarsPath.trim()) { - try { - const filePath = path.join(avatarsPath, id); - const stat = fs.statSync(filePath); - if (stat && stat.isFile()) { - const details = { - userId: user._id, - type: 'image/jpeg', - size: stat.size - }; - return insertAvatar({ - details, - avatarsFileStore, - stream: fs.createReadStream(filePath), - callback() { - fs.unlinkSync(filePath); - } - }); + return insertAvatar({ + details, + avatarsFileStore, + stream: gridFSAvatar.readStream, + callback() { + oldAvatarGridFS.deleteFile(id); + } + }); + } + if (avatarStoreType === 'FileSystem' && avatarsPath && avatarsPath.trim()) { + try { + const filePath = path.join(avatarsPath, id); + const stat = fs.statSync(filePath); + if (stat && stat.isFile()) { + const details = { + userId: user._id, + type: 'image/jpeg', + size: stat.size + }; + return insertAvatar({ + details, + avatarsFileStore, + stream: fs.createReadStream(filePath), + callback() { + fs.unlinkSync(filePath); + } + }); + } + } catch (e) { + logError('Error migrating old avatar', e); + return Promise.resolve(); } - } catch (e) { - logError('Error migrating old avatar', e); - return Promise.resolve(); } - } - }).then(() => { - const avatarsFiles = new Mongo.Collection('avatars.files'); - const avatarsChunks = new Mongo.Collection('avatars.chunks'); - avatarsFiles.rawCollection().drop(); - avatarsChunks.rawCollection().drop(); - }); - }, 1000); + }).then(() => { + const avatarsFiles = new Mongo.Collection('avatars.files'); + const avatarsChunks = new Mongo.Collection('avatars.chunks'); + avatarsFiles.rawCollection().drop(); + avatarsChunks.rawCollection().drop(); + }); + }, 1000); + }); RocketChat.models.Settings.remove({_id: 'Accounts_AvatarStoreType'}); RocketChat.models.Settings.remove({_id: 'Accounts_AvatarStorePath'}); } From a3ce28a03d4c3538c857f5782920579167fa9130 Mon Sep 17 00:00:00 2001 From: Pierre Ozoux Date: Thu, 6 Jul 2017 00:27:03 +0100 Subject: [PATCH 73/78] Add helm chart kubernetes deployment (#6340) --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 1ef374f33836..a1de201ca5ae 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ * [Ubuntu 16.04](#ubuntu-1604) * [Cloudron.io](#cloudronio) * [Heroku](#heroku) + * [Helm Kubernetes](#helm-kubernetes) * [Scalingo](#scalingo) * [Sloppy.io](#sloppyio) * [Docker](#docker) @@ -137,6 +138,9 @@ Host your own Rocket.Chat server for **FREE** with [One-Click Deploy](https://he [![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/RocketChat/Rocket.Chat/tree/master) +## Helm Kubernetes +Deploy on Kubernetes using the official [helm chart](https://github.com/kubernetes/charts/pull/752). + ## Scalingo Deploy your own Rocket.Chat server instantly on [Scalingo](https://scalingo.com) From 892b469878cd08ec6915f5ff76c5792476c634c0 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Wed, 5 Jul 2017 22:01:55 -0300 Subject: [PATCH 74/78] Move migration 97 to 99 --- packages/rocketchat-file/file.server.js | 1 + server/startup/migrations/v097.js | 190 +-------------------- server/startup/migrations/v099.js | 217 ++++++++++++++++++++++++ 3 files changed, 219 insertions(+), 189 deletions(-) create mode 100644 server/startup/migrations/v099.js diff --git a/packages/rocketchat-file/file.server.js b/packages/rocketchat-file/file.server.js index 500513a58e54..1fb0487184e6 100644 --- a/packages/rocketchat-file/file.server.js +++ b/packages/rocketchat-file/file.server.js @@ -105,6 +105,7 @@ RocketChatFile.GridFS = class { this.store = new Grid(db, mongo); this.findOneSync = Meteor.wrapAsync(this.store.collection(this.name).findOne.bind(this.store.collection(this.name))); this.removeSync = Meteor.wrapAsync(this.store.remove.bind(this.store)); + this.countSync = Meteor.wrapAsync(this.store._col.count.bind(this.store._col)); this.getFileSync = Meteor.wrapAsync(this.getFile.bind(this)); } diff --git a/server/startup/migrations/v097.js b/server/startup/migrations/v097.js index a283984d5bb4..bd6e421ac7a1 100644 --- a/server/startup/migrations/v097.js +++ b/server/startup/migrations/v097.js @@ -1,194 +1,6 @@ -import fs from 'fs'; -import path from 'path'; - -function log(...args) { - console.log('[AVATAR]', ...args); -} - -function logError(...args) { - console.error('[AVATAR]', ...args); -} - -function insertAvatar({ details, avatarsFileStore, stream, callback = () => {} }) { - return new Promise((resolve) => { - Meteor.defer(() => { - Meteor.runAsUser('rocket.cat', () => { - avatarsFileStore.insert(details, stream, (err) => { - if (err) { - logError({err}); - resolve(); - } else { - Meteor.setTimeout(() => { - callback(); - }, 200); - } - resolve(); - }); - }); - }); - }); -} - -function batch(arr, limit, fn) { - if (!arr.length) { - return Promise.resolve(); - } - return Promise.all(arr.splice(0, limit).map((item) => { - return fn(item); - })).then(() => { return batch(arr, limit, fn); }); -} - RocketChat.Migrations.add({ version: 97, up() { - log('Migrating avatars. This might take a while.'); - - const query = { - $or: [{ - 's3.path': { - $exists: true - } - }, { - 'googleCloudStorage.path': { - $exists: true - } - }] - }; - - RocketChat.models.Uploads.find(query).forEach((record) => { - if (record.s3) { - RocketChat.models.Uploads.model.direct.update({_id: record._id}, { - $set: { - 'store': 'AmazonS3:Uploads', - AmazonS3: { - path: record.s3.path + record._id - } - }, - $unset: { - s3: 1 - } - }, {multi: true}); - } else { - RocketChat.models.Uploads.model.direct.update({_id: record._id}, { - $set: { - store: 'GoogleCloudStorage:Uploads', - GoogleStorage: { - path: record.googleCloudStorage.path + record._id - } - }, - $unset: { - googleCloudStorage: 1 - } - }, {multi: true}); - } - }); - - RocketChat.models.Uploads.model.direct.update({ - store: 'fileSystem' - }, { - $set: { - store: 'FileSystem:Uploads' - } - }, { - multi: true - }); - RocketChat.models.Uploads.model.direct.update({ - store: 'rocketchat_uploads' - }, { - $set: { - store: 'GridFS:Uploads' - } - }, { - multi: true - }); - - const avatarOrigins = [ - 'upload', - 'gravatar', - 'facebook', - 'twitter', - 'github', - 'google', - 'url', - 'gitlab', - 'linkedin' - ]; - - const avatarsPath = RocketChat.models.Settings.findOne({_id: 'Accounts_AvatarStorePath'}).value; - const avatarStoreType = RocketChat.models.Settings.findOne({_id: 'Accounts_AvatarStoreType'}).value; - - Meteor.startup(function() { - Meteor.setTimeout(function() { - const avatarsFileStore = FileUpload.getStore('Avatars'); - - const oldAvatarGridFS = new RocketChatFile.GridFS({ - name: 'avatars' - }); - - const users = RocketChat.models.Users.find({avatarOrigin: {$in: avatarOrigins}}, {avatarOrigin: 1, username: 1}).fetch(); - - const usersTotal = users.length; - - log('Total users to migrate avatars ->', usersTotal); - - let current = 0; - - batch(users, 300, (user) => { - const id = `${ user.username }.jpg`; - - const gridFSAvatar = oldAvatarGridFS.getFileWithReadStream(id); - - log('Migrating', ++current, 'of', usersTotal); - - if (gridFSAvatar) { - const details = { - userId: user._id, - type: gridFSAvatar.contentType, - size: gridFSAvatar.length - }; - - return insertAvatar({ - details, - avatarsFileStore, - stream: gridFSAvatar.readStream, - callback() { - oldAvatarGridFS.deleteFile(id); - } - }); - } - if (avatarStoreType === 'FileSystem' && avatarsPath && avatarsPath.trim()) { - try { - const filePath = path.join(avatarsPath, id); - const stat = fs.statSync(filePath); - if (stat && stat.isFile()) { - const details = { - userId: user._id, - type: 'image/jpeg', - size: stat.size - }; - return insertAvatar({ - details, - avatarsFileStore, - stream: fs.createReadStream(filePath), - callback() { - fs.unlinkSync(filePath); - } - }); - } - } catch (e) { - logError('Error migrating old avatar', e); - return Promise.resolve(); - } - } - }).then(() => { - const avatarsFiles = new Mongo.Collection('avatars.files'); - const avatarsChunks = new Mongo.Collection('avatars.chunks'); - avatarsFiles.rawCollection().drop(); - avatarsChunks.rawCollection().drop(); - }); - }, 1000); - }); - RocketChat.models.Settings.remove({_id: 'Accounts_AvatarStoreType'}); - RocketChat.models.Settings.remove({_id: 'Accounts_AvatarStorePath'}); + // Migration moved to 099.js to fix a bug } }); diff --git a/server/startup/migrations/v099.js b/server/startup/migrations/v099.js new file mode 100644 index 000000000000..43344c5e5d03 --- /dev/null +++ b/server/startup/migrations/v099.js @@ -0,0 +1,217 @@ +/* globals SystemLogger */ + +import fs from 'fs'; +import path from 'path'; + +function log(...args) { + console.log('[AVATAR]', ...args); +} + +function logError(...args) { + console.error('[AVATAR]', ...args); +} + +function insertAvatar({ details, avatarsFileStore, stream, callback = () => {} }) { + return new Promise((resolve) => { + Meteor.defer(() => { + Meteor.runAsUser('rocket.cat', () => { + avatarsFileStore.insert(details, stream, (err) => { + if (err) { + logError({err}); + resolve(); + } else { + Meteor.setTimeout(() => { + callback(); + }, 200); + } + resolve(); + }); + }); + }); + }); +} + +function batch(arr, limit, fn) { + if (!arr.length) { + return Promise.resolve(); + } + return Promise.all(arr.splice(0, limit).map((item) => { + return fn(item); + })).then(() => { return batch(arr, limit, fn); }); +} + +RocketChat.Migrations.add({ + version: 99, + up() { + log('Migrating avatars. This might take a while.'); + + const query = { + $or: [{ + 's3.path': { + $exists: true + } + }, { + 'googleCloudStorage.path': { + $exists: true + } + }] + }; + + RocketChat.models.Uploads.find(query).forEach((record) => { + if (record.s3) { + RocketChat.models.Uploads.model.direct.update({_id: record._id}, { + $set: { + 'store': 'AmazonS3:Uploads', + AmazonS3: { + path: record.s3.path + record._id + } + }, + $unset: { + s3: 1 + } + }, {multi: true}); + } else { + RocketChat.models.Uploads.model.direct.update({_id: record._id}, { + $set: { + store: 'GoogleCloudStorage:Uploads', + GoogleStorage: { + path: record.googleCloudStorage.path + record._id + } + }, + $unset: { + googleCloudStorage: 1 + } + }, {multi: true}); + } + }); + + RocketChat.models.Uploads.model.direct.update({ + store: 'fileSystem' + }, { + $set: { + store: 'FileSystem:Uploads' + } + }, { + multi: true + }); + RocketChat.models.Uploads.model.direct.update({ + store: 'rocketchat_uploads' + }, { + $set: { + store: 'GridFS:Uploads' + } + }, { + multi: true + }); + + const avatarOrigins = [ + 'upload', + 'gravatar', + 'facebook', + 'twitter', + 'github', + 'google', + 'url', + 'gitlab', + 'linkedin' + ]; + + const avatarsPathRecord = RocketChat.models.Settings.findOne({_id: 'Accounts_AvatarStorePath'}); + const avatarStoreTypeRecord = RocketChat.models.Settings.findOne({_id: 'Accounts_AvatarStoreType'}); + + const avatarsPath = avatarsPathRecord ? avatarsPathRecord.value : process.env.AVATARS_PATH; + let avatarStoreType = avatarStoreTypeRecord && avatarStoreTypeRecord.value; + + const oldAvatarGridFS = new RocketChatFile.GridFS({ + name: 'avatars' + }); + + // 1. Novo usuário, não executa migration + // 2. Antigo, migra de antes da 97, vai ter storage type + // 3. Executou a 97, não vai ter storeType + // 3.1 Se ainda tem dados no gridfs, manda ver + // 3.2 Se não tem, quebra e pede a variável OU forçar a reexecutar a 97??? + + if (avatarStoreType == null) { + const count = oldAvatarGridFS.countSync(); + if (Match.test(count, Number) && count > 0) { + avatarStoreType = 'GridFS'; + } else if (Match.test(avatarsPath, String) && avatarsPath.length > 0) { + avatarStoreType = 'FileSystem'; + } else { + SystemLogger.error_box('Can\'t define the avatar\'s storage type.\nIf you have avatars missing and they was stored in your file system\nrun the process including the following environment variables: \n AVATARS_PATH=\'YOUR AVATAR\'S DIRECTORY\'\n MIGRATION_VERSION=98', 'WARNING'); + return; + } + } + + Meteor.startup(function() { + Meteor.setTimeout(function() { + const avatarsFileStore = FileUpload.getStore('Avatars'); + + const users = RocketChat.models.Users.find({avatarOrigin: {$in: avatarOrigins}}, {avatarOrigin: 1, username: 1}).fetch(); + + const usersTotal = users.length; + + log('Total users to migrate avatars ->', usersTotal); + + let current = 0; + + batch(users, 300, (user) => { + const id = `${ user.username }.jpg`; + + const gridFSAvatar = oldAvatarGridFS.getFileWithReadStream(id); + + log('Migrating', ++current, 'of', usersTotal); + + if (gridFSAvatar) { + const details = { + userId: user._id, + type: gridFSAvatar.contentType, + size: gridFSAvatar.length + }; + + return insertAvatar({ + details, + avatarsFileStore, + stream: gridFSAvatar.readStream, + callback() { + oldAvatarGridFS.deleteFile(id); + } + }); + } + if (avatarStoreType === 'FileSystem' && avatarsPath && avatarsPath.trim()) { + try { + const filePath = path.join(avatarsPath, id); + const stat = fs.statSync(filePath); + if (stat && stat.isFile()) { + const details = { + userId: user._id, + type: 'image/jpeg', + size: stat.size + }; + return insertAvatar({ + details, + avatarsFileStore, + stream: fs.createReadStream(filePath), + callback() { + fs.unlinkSync(filePath); + } + }); + } + } catch (e) { + logError('Error migrating old avatar', e); + return Promise.resolve(); + } + } + }).then(() => { + const avatarsFiles = new Mongo.Collection('avatars.files'); + const avatarsChunks = new Mongo.Collection('avatars.chunks'); + avatarsFiles.rawCollection().drop(); + avatarsChunks.rawCollection().drop(); + RocketChat.models.Settings.remove({_id: 'Accounts_AvatarStoreType'}); + RocketChat.models.Settings.remove({_id: 'Accounts_AvatarStorePath'}); + }); + }, 1000); + }); + } +}); From f9ad156717ca86719cb6edf29eebdb56b1bef206 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Wed, 5 Jul 2017 22:17:18 -0300 Subject: [PATCH 75/78] Remove unecessary comments --- server/startup/migrations/v099.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/server/startup/migrations/v099.js b/server/startup/migrations/v099.js index 43344c5e5d03..3d77e4a5e765 100644 --- a/server/startup/migrations/v099.js +++ b/server/startup/migrations/v099.js @@ -126,12 +126,6 @@ RocketChat.Migrations.add({ name: 'avatars' }); - // 1. Novo usuário, não executa migration - // 2. Antigo, migra de antes da 97, vai ter storage type - // 3. Executou a 97, não vai ter storeType - // 3.1 Se ainda tem dados no gridfs, manda ver - // 3.2 Se não tem, quebra e pede a variável OU forçar a reexecutar a 97??? - if (avatarStoreType == null) { const count = oldAvatarGridFS.countSync(); if (Match.test(count, Number) && count > 0) { From 47dad0da400dea17a24d4c2e21d029f350a15dec Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Wed, 5 Jul 2017 22:41:03 -0300 Subject: [PATCH 76/78] Fix the migration `rerun` command --- packages/rocketchat-migrations/migrations.js | 2 +- server/startup/migrations/v099.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rocketchat-migrations/migrations.js b/packages/rocketchat-migrations/migrations.js index ee54c145e696..82885469da8b 100644 --- a/packages/rocketchat-migrations/migrations.js +++ b/packages/rocketchat-migrations/migrations.js @@ -239,7 +239,7 @@ Migrations._migrateTo = function(version, rerun) { if (rerun) { log.info('Rerunning version ' + version); - migrate('up', version); + migrate('up', this._findIndexByVersion(version)); log.info('Finished migrating.'); unlock(); return true; diff --git a/server/startup/migrations/v099.js b/server/startup/migrations/v099.js index 3d77e4a5e765..5e9334103326 100644 --- a/server/startup/migrations/v099.js +++ b/server/startup/migrations/v099.js @@ -133,7 +133,7 @@ RocketChat.Migrations.add({ } else if (Match.test(avatarsPath, String) && avatarsPath.length > 0) { avatarStoreType = 'FileSystem'; } else { - SystemLogger.error_box('Can\'t define the avatar\'s storage type.\nIf you have avatars missing and they was stored in your file system\nrun the process including the following environment variables: \n AVATARS_PATH=\'YOUR AVATAR\'S DIRECTORY\'\n MIGRATION_VERSION=98', 'WARNING'); + SystemLogger.error_box('Can\'t define the avatar\'s storage type.\nIf you have avatars missing and they was stored in your file system\nrun the process including the following environment variables: \n AVATARS_PATH=\'YOUR AVATAR\'S DIRECTORY\'\n MIGRATION_VERSION=99,rerun', 'WARNING'); return; } } From a7f2e6bcb55b2d7147bc606f6c8486257c719161 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Thu, 6 Jul 2017 10:23:39 -0300 Subject: [PATCH 77/78] Fix Emails in User Admin View --- packages/rocketchat-ui-admin/client/users/adminUsers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rocketchat-ui-admin/client/users/adminUsers.js b/packages/rocketchat-ui-admin/client/users/adminUsers.js index 1562e6a095c8..430f64a23add 100644 --- a/packages/rocketchat-ui-admin/client/users/adminUsers.js +++ b/packages/rocketchat-ui-admin/client/users/adminUsers.js @@ -21,7 +21,7 @@ Template.adminUsers.helpers({ } }, emailAddress() { - return _.map(this.emails, function(e) { e.address; }).join(', '); + return _.map(this.emails, function(e) { return e.address; }).join(', '); }, flexData() { return { From 5cb30b479f37e3add3ce007dea5e37021491bec1 Mon Sep 17 00:00:00 2001 From: Flavio Grossi Date: Fri, 7 Jul 2017 19:22:13 +0200 Subject: [PATCH 78/78] [FIX] url click events in the cordova app open in external browser or not at all (#7205) * fix url click events in the cordova app fixes RocketChat/Rocket.Chat.Cordova#142 * make urls regexp case insensitive since mobile devices often autocapitalize them --- packages/rocketchat-ui-master/client/main.js | 2 +- .../rocketchat-ui/client/lib/cordova/urls.js | 4 ++-- packages/rocketchat-ui/client/views/app/room.js | 16 +++++++++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/packages/rocketchat-ui-master/client/main.js b/packages/rocketchat-ui-master/client/main.js index 9e91eea36872..ad47ade5c67a 100644 --- a/packages/rocketchat-ui-master/client/main.js +++ b/packages/rocketchat-ui-master/client/main.js @@ -184,7 +184,7 @@ Template.main.events({ }, 'touchmove'(e, t) { if (t.touchstartX != null) { - const [touch] = e.originalEvent.touches; + const touch = e.originalEvent.touches[0]; const diffX = touch.clientX - t.touchstartX; const diffY = touch.clientY - t.touchstartY; const absX = Math.abs(diffX); diff --git a/packages/rocketchat-ui/client/lib/cordova/urls.js b/packages/rocketchat-ui/client/lib/cordova/urls.js index a11c61d810bd..ed6d9744e482 100644 --- a/packages/rocketchat-ui/client/lib/cordova/urls.js +++ b/packages/rocketchat-ui/client/lib/cordova/urls.js @@ -1,14 +1,14 @@ Meteor.startup(() => { if (!Meteor.isCordova) { return; } // Handle click events for all external URLs - $(document).on('deviceready', () => { + document.addEventListener('deviceready', () => { // const platform = device.platform.toLowerCase(); $(document).on('click', function(e) { const $link = $(e.target).closest('a[href]'); if (!($link.length > 0)) { return; } const url = $link.attr('href'); - if (/^https?:\/\/.+/.test(url) === true) { + if (/^https?:\/\/.+/i.test(url) === true) { window.open(url, '_system'); return e.preventDefault(); } diff --git a/packages/rocketchat-ui/client/views/app/room.js b/packages/rocketchat-ui/client/views/app/room.js index 227956fdd7c7..c066b0c600d8 100644 --- a/packages/rocketchat-ui/client/views/app/room.js +++ b/packages/rocketchat-ui/client/views/app/room.js @@ -234,6 +234,8 @@ Template.room.helpers({ let isSocialSharingOpen = false; let touchMoved = false; +let lastTouchX = null; +let lastTouchY = null; Template.room.events({ 'click, touchend'(e, t) { @@ -249,6 +251,11 @@ Template.room.events({ }, 'touchstart .message'(e, t) { + const touches = e.originalEvent.touches; + if (touches && touches.length) { + lastTouchX = touches[0].pageX; + lastTouchY = touches[0].pagey; + } touchMoved = false; isSocialSharingOpen = false; if (e.originalEvent.touches.length !== 1) { @@ -343,7 +350,14 @@ Template.room.events({ }, 'touchmove .message'(e, t) { - touchMoved = true; + const touches = e.originalEvent.touches; + if (touches && touches.length) { + const deltaX = Math.abs(lastTouchX - touches[0].pageX); + const deltaY = Math.abs(lastTouchY - touches[0].pageY); + if (deltaX > 5 || deltaY > 5) { + touchMoved = true; + } + } return Meteor.clearTimeout(t.touchtime); },