Merge remote-tracking branch 'origin/color-variables' into color-variables

pull/7748/head
Guilherme Gazzo 8 years ago
commit 3ef36d0089
  1. 2
      .github/changelog.js
  2. 8
      client/routes/router.js
  3. 226
      package.json
  4. 13
      packages/meteor-autocomplete/package.js
  5. 0
      packages/rocketchat-autolinker/client/client.js
  6. 4
      packages/rocketchat-autolinker/package.js
  7. 0
      packages/rocketchat-autolinker/server/settings.js
  8. 0
      packages/rocketchat-cas/client/cas_client.js
  9. 7
      packages/rocketchat-cas/package.js
  10. 0
      packages/rocketchat-cas/server/cas_rocketchat.js
  11. 0
      packages/rocketchat-cas/server/cas_server.js
  12. 0
      packages/rocketchat-colors/client/client.js
  13. 0
      packages/rocketchat-colors/client/style.css
  14. 6
      packages/rocketchat-colors/package.js
  15. 0
      packages/rocketchat-colors/server/settings.js
  16. 0
      packages/rocketchat-custom-oauth/client/custom_oauth_client.js
  17. 4
      packages/rocketchat-custom-oauth/package.js
  18. 0
      packages/rocketchat-custom-oauth/server/custom_oauth_server.js
  19. 0
      packages/rocketchat-custom-sounds/client/admin/adminSoundEdit.html
  20. 0
      packages/rocketchat-custom-sounds/client/admin/adminSoundInfo.html
  21. 0
      packages/rocketchat-custom-sounds/client/admin/adminSounds.html
  22. 0
      packages/rocketchat-custom-sounds/client/admin/adminSounds.js
  23. 0
      packages/rocketchat-custom-sounds/client/admin/route.js
  24. 0
      packages/rocketchat-custom-sounds/client/admin/soundEdit.html
  25. 0
      packages/rocketchat-custom-sounds/client/admin/soundEdit.js
  26. 0
      packages/rocketchat-custom-sounds/client/admin/soundInfo.html
  27. 0
      packages/rocketchat-custom-sounds/client/admin/soundInfo.js
  28. 0
      packages/rocketchat-custom-sounds/client/admin/startup.js
  29. 20
      packages/rocketchat-custom-sounds/package.js
  30. 0
      packages/rocketchat-emoji/client/emoji.css
  31. 0
      packages/rocketchat-emoji/client/emojiButton.js
  32. 0
      packages/rocketchat-emoji/client/emojiParser.js
  33. 24
      packages/rocketchat-emoji/client/emojiPicker.css
  34. 0
      packages/rocketchat-emoji/client/emojiPicker.html
  35. 0
      packages/rocketchat-emoji/client/emojiPicker.js
  36. 0
      packages/rocketchat-emoji/client/function-isSet.js
  37. 0
      packages/rocketchat-emoji/client/keyboardFix.js
  38. 0
      packages/rocketchat-emoji/client/lib/EmojiPicker.js
  39. 0
      packages/rocketchat-emoji/client/lib/emojiRenderer.js
  40. 0
      packages/rocketchat-emoji/client/rocketchat.js
  41. 22
      packages/rocketchat-emoji/package.js
  42. 1
      packages/rocketchat-file-upload/server/methods/sendFileMessage.js
  43. 0
      packages/rocketchat-highlight-words/client/client.js
  44. 2
      packages/rocketchat-highlight-words/package.js
  45. 8
      packages/rocketchat-i18n/i18n/en.i18n.json
  46. 6
      packages/rocketchat-importer-csv/.npm/package/npm-shrinkwrap.json
  47. 2
      packages/rocketchat-importer-csv/package.js
  48. 61
      packages/rocketchat-importer-csv/server.js
  49. 6
      packages/rocketchat-importer-hipchat-enterprise/server.js
  50. 6
      packages/rocketchat-importer-hipchat/server.js
  51. 6
      packages/rocketchat-importer-slack/server.js
  52. 56
      packages/rocketchat-importer/client/admin/adminImportPrepare.html
  53. 6
      packages/rocketchat-importer/client/admin/adminImportPrepare.js
  54. 4
      packages/rocketchat-importer/server/classes/ImporterSelection.js
  55. 5
      packages/rocketchat-lib/client/MessageAction.js
  56. 88
      packages/rocketchat-lib/client/views/customFieldsForm.html
  57. 38
      packages/rocketchat-lib/server/lib/notifyUsersOnMessage.js
  58. 87
      packages/rocketchat-lib/server/lib/sendEmailOnMessage.js
  59. 13
      packages/rocketchat-lib/server/startup/settings.js
  60. 4
      packages/rocketchat-livechat/client/views/sideNav/livechatFlex.html
  61. 6
      packages/rocketchat-markdown/markdown.js
  62. 10
      packages/rocketchat-markdown/package.js
  63. 2
      packages/rocketchat-message-attachments/client/messageAttachment.html
  64. 4
      packages/rocketchat-message-attachments/client/messageAttachment.js
  65. 6
      packages/rocketchat-oembed/client/oembedFrameWidget.html
  66. 2
      packages/rocketchat-oembed/client/oembedVideoWidget.html
  67. 2
      packages/rocketchat-oembed/client/oembedYoutubeWidget.html
  68. 17
      packages/rocketchat-theme/client/imports/components/message-box.css
  69. 2
      packages/rocketchat-theme/client/imports/components/sidebar/sidebar-item.css
  70. 1
      packages/rocketchat-theme/client/imports/general/base_old.css
  71. 0
      packages/rocketchat-tooltip/client/init.js
  72. 0
      packages/rocketchat-tooltip/client/rocketchat-tooltip.html
  73. 0
      packages/rocketchat-tooltip/client/rocketchat-tooltip.js
  74. 0
      packages/rocketchat-tooltip/client/tooltip.css
  75. 8
      packages/rocketchat-tooltip/package.js
  76. 4
      packages/rocketchat-ui-account/client/accountFlex.html
  77. 6
      packages/rocketchat-ui-account/client/accountProfile.html
  78. 3
      packages/rocketchat-ui-account/client/avatar/prompt.js
  79. 4
      packages/rocketchat-ui-admin/client/adminFlex.html
  80. 4
      packages/rocketchat-ui-master/client/main.js
  81. 1
      packages/rocketchat-ui-master/package.js
  82. 4
      packages/rocketchat-ui-master/public/icons.svg
  83. 1
      packages/rocketchat-ui-master/server/dynamic-css.js
  84. 31
      packages/rocketchat-ui-message/client/messageBox.html
  85. 157
      packages/rocketchat-ui-message/client/messageBox.js
  86. 4
      packages/rocketchat-ui-sidenav/client/accountBox.html
  87. 8
      packages/rocketchat-ui-sidenav/client/roomList.html
  88. 8
      packages/rocketchat-ui-sidenav/client/roomList.js
  89. 28
      packages/rocketchat-ui/client/lib/RoomManager.js
  90. 1
      packages/rocketchat-ui/client/views/app/createChannel.html
  91. 1
      packages/rocketchat-ui/client/views/app/createChannel.js
  92. 1
      packages/rocketchat-ui/package.js
  93. 2
      private/node_scripts/unsubscribe_csv/unsubscribe.js
  94. 16
      tests/pageobjects/administration.page.js
  95. 2
      tests/pageobjects/side-nav.page.js

@ -70,7 +70,7 @@ var writerOpts = {
// GitHub issue URLs.
commit.subject = commit.subject.replace(/#([0-9]+)/g, function(_, issue) {
issues.push(issue);
return '[#' + issue + '](' + gitUrl + '/issue/' + issue + ')';
return '[#' + issue + '](' + gitUrl + '/issues/' + issue + ')';
});
// GitHub user URLs.
commit.subject = commit.subject.replace(/@([a-zA-Z0-9_]+)/g, '[@$1](https://github.com/$1)');

@ -68,14 +68,6 @@ FlowRouter.route('/home', {
}
});
// FlowRouter.route('/changeavatar', {
// name: 'changeAvatar',
//
// action() {
// BlazeLayout.render('main', {center: 'avatarPrompt'});
// }
// });
FlowRouter.route('/account/:group?', {
name: 'account',

@ -1,111 +1,119 @@
{
"name": "Rocket.Chat",
"description": "The Ultimate Open Source WebChat Platform",
"version": "0.59.0-develop",
"author": {
"name": "Rocket.Chat",
"url": "https://rocket.chat/"
},
"contributors": [
{
"name": "Aaron Ogle",
"email": "aaron.ogle@rocket.chat"
},
{
"name": "Bradley Hilton",
"email": "bradley.hilton@rocket.chat"
},
{
"name": "Diego Sampaio",
"email": "diego.sampaio@rocket.chat"
},
{
"name": "Gabriel Engel",
"email": "gabriel.engel@rocket.chat"
},
{
"name": "Marcelo Schmidt",
"email": "marcelo.schmidt@rocket.chat"
},
{
"name": "Rodrigo Nascimento",
"email": "rodrigo.nascimento@rocket.chat"
},
{
"name": "Sing Li",
"email": "sing.li@rocket.chat"
}
],
"mocha": {
"tests": [
"packages/**/*.tests.js"
],
"files": [
"packages/**/*.js",
"!packages/**/*.tests.js"
]
},
"keywords": [
"rocketchat",
"rocket",
"chat"
],
"scripts": {
"start": "meteor npm i && meteor",
"lint": "eslint .",
"lint-fix": "eslint . --fix",
"stylelint": "stylelint packages/**/*.css",
"test": "node .scripts/start.js",
"deploy": "npm run build && pm2 startOrRestart pm2.json",
"chimp-watch": "chimp --ddp=http://localhost:3000 --watch --mocha --path=tests/end-to-end",
"chimp-test": "chimp tests/chimp-config.js",
"postinstall": "cd packages/rocketchat-katex && npm i",
"testunit-watch": "mocha --watch --opts ./mocha.opts \"`node -e \"console.log(require('./package.json').mocha.tests.join(' '))\"`\"",
"coverage": "nyc -r html mocha --opts ./mocha.opts \"`node -e \"console.log(require('./package.json').mocha.tests.join(' '))\"`\"",
"testunit": "mocha --opts ./mocha.opts \"`node -e \"console.log(require('./package.json').mocha.tests.join(' '))\"`\"",
"version": "node .scripts/version.js",
"set-version": "node .scripts/set-version.js",
"release": "npm run set-version --silent"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/RocketChat/Rocket.Chat.git"
},
"bugs": {
"url": "https://github.com/RocketChat/Rocket.Chat/issues",
"email": "support@rocket.chat"
},
"devDependencies": {
"babel-mocha-es6-compiler": "^0.1.0",
"babel-plugin-array-includes": "^2.0.3",
"chimp": "^0.49.1",
"conventional-changelog-cli": "^1.3.2",
"eslint": "^4.2.0",
"postcss-cssnext": "^2.11.0",
"postcss-smart-import": "^0.7.5",
"simple-git": "^1.73.0",
"stylelint": "^7.13.0",
"stylelint-order": "^0.6.0",
"supertest": "^3.0.0"
},
"dependencies": {
"@google-cloud/storage": "^1.2.0",
"aws-sdk": "^2.86.0",
"babel-runtime": "^6.23.0",
"bcrypt": "^1.0.2",
"codemirror": "^5.27.4",
"file-type": "^5.2.0",
"highlight.js": "^9.12.0",
"jquery": "^3.2.1",
"mime-db": "^1.29.0",
"mime-type": "^3.0.5",
"moment": "^2.18.1",
"moment-timezone": "^0.5.13",
"photoswipe": "^4.1.2",
"prom-client": "^10.0.2",
"semver": "^5.3.0",
"toastr": "^2.1.2",
"wolfy87-eventemitter": "^5.1.0"
}
"name": "Rocket.Chat",
"description": "The Ultimate Open Source WebChat Platform",
"version": "0.59.0-develop",
"author": {
"name": "Rocket.Chat",
"url": "https://rocket.chat/"
},
"contributors": [
{
"name": "Aaron Ogle",
"email": "aaron.ogle@rocket.chat"
},
{
"name": "Bradley Hilton",
"email": "bradley.hilton@rocket.chat"
},
{
"name": "Diego Sampaio",
"email": "diego.sampaio@rocket.chat"
},
{
"name": "Gabriel Engel",
"email": "gabriel.engel@rocket.chat"
},
{
"name": "Guilherme Gazzo",
"email": "guilherme.gazzo@rocket.chat"
},
{
"name": "Karl Prieb",
"email": "karl.priebk@rocket.chat"
},
{
"name": "Marcelo Schmidt",
"email": "marcelo.schmidt@rocket.chat"
},
{
"name": "Rodrigo Nascimento",
"email": "rodrigo.nascimento@rocket.chat"
},
{
"name": "Sing Li",
"email": "sing.li@rocket.chat"
}
],
"mocha": {
"tests": [
"packages/**/*.tests.js"
],
"files": [
"packages/**/*.js",
"!packages/**/*.tests.js"
]
},
"keywords": [
"rocketchat",
"rocket",
"chat"
],
"scripts": {
"start": "meteor npm i && meteor",
"lint": "eslint .",
"lint-fix": "eslint . --fix",
"stylelint": "stylelint packages/**/*.css",
"test": "node .scripts/start.js",
"deploy": "npm run build && pm2 startOrRestart pm2.json",
"chimp-watch": "chimp --ddp=http://localhost:3000 --watch --mocha --path=tests/end-to-end",
"chimp-test": "chimp tests/chimp-config.js",
"postinstall": "cd packages/rocketchat-katex && npm i",
"testunit-watch": "mocha --watch --opts ./mocha.opts \"`node -e \"console.log(require('./package.json').mocha.tests.join(' '))\"`\"",
"coverage": "nyc -r html mocha --opts ./mocha.opts \"`node -e \"console.log(require('./package.json').mocha.tests.join(' '))\"`\"",
"testunit": "mocha --opts ./mocha.opts \"`node -e \"console.log(require('./package.json').mocha.tests.join(' '))\"`\"",
"version": "node .scripts/version.js",
"set-version": "node .scripts/set-version.js",
"release": "npm run set-version --silent"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/RocketChat/Rocket.Chat.git"
},
"bugs": {
"url": "https://github.com/RocketChat/Rocket.Chat/issues",
"email": "support@rocket.chat"
},
"devDependencies": {
"babel-mocha-es6-compiler": "^0.1.0",
"babel-plugin-array-includes": "^2.0.3",
"chimp": "^0.49.1",
"conventional-changelog-cli": "^1.3.2",
"eslint": "^4.2.0",
"postcss-cssnext": "^2.11.0",
"postcss-smart-import": "^0.7.5",
"simple-git": "^1.73.0",
"stylelint": "^7.13.0",
"stylelint-order": "^0.6.0",
"supertest": "^3.0.0"
},
"dependencies": {
"@google-cloud/storage": "^1.2.0",
"aws-sdk": "^2.86.0",
"babel-runtime": "^6.23.0",
"bcrypt": "^1.0.2",
"codemirror": "^5.27.4",
"file-type": "^5.2.0",
"highlight.js": "^9.12.0",
"jquery": "^3.2.1",
"mime-db": "^1.29.0",
"mime-type": "^3.0.5",
"moment": "^2.18.1",
"moment-timezone": "^0.5.13",
"photoswipe": "^4.1.2",
"prom-client": "^10.0.2",
"semver": "^5.3.0",
"toastr": "^2.1.2",
"wolfy87-eventemitter": "^5.1.0"
}
}

@ -25,17 +25,4 @@ Package.onUse(function(api) {
], 'server');
api.export('Autocomplete', 'server');
api.export('AutocompleteTest', {testOnly: true});
});
Package.onTest(function(api) {
api.use('mizzao:autocomplete');
api.use('mongo');
api.use('tinytest');
api.addFiles('tests/rule_tests.coffee', 'client');
api.addFiles('tests/regex_tests.coffee', 'client');
api.addFiles('tests/param_tests.coffee', 'client');
api.addFiles('tests/security_tests.coffee');
});

@ -13,7 +13,7 @@ Package.onUse(function(api) {
api.use('ecmascript');
api.use('rocketchat:lib');
api.addFiles('client.js', 'client');
api.addFiles('client/client.js', 'client');
api.addFiles('settings.js', 'server');
api.addFiles('server/settings.js', 'server');
});

@ -18,12 +18,11 @@ Package.onUse(function(api) {
api.use('ecmascript');
// Server files
api.add_files('cas_rocketchat.js', 'server');
api.add_files('cas_server.js', 'server');
api.add_files('server/cas_rocketchat.js', 'server');
api.add_files('server/cas_server.js', 'server');
// Client files
api.add_files('cas_client.js', 'client');
api.add_files('client/cas_client.js', 'client');
});
Npm.depends({

@ -9,7 +9,7 @@ Package.onUse(function(api) {
api.use('rocketchat:lib');
api.use('ecmascript');
api.addFiles('client.js', ['client']);
api.addFiles('style.css', ['client']);
api.addFiles('settings.js', ['server']);
api.addFiles('client/client.js', 'client');
api.addFiles('client/style.css', 'client');
api.addFiles('server/settings.js', 'server');
});

@ -20,9 +20,9 @@ Package.onUse(function(api) {
api.use('http', 'server');
api.mainModule('custom_oauth_client.js', 'client');
api.mainModule('client/custom_oauth_client.js', 'client');
api.mainModule('custom_oauth_server.js', 'server');
api.mainModule('server/custom_oauth_server.js', 'server');
api.export('CustomOAuth');
});

@ -34,16 +34,16 @@ Package.onUse(function(api) {
api.addFiles('assets/stylesheets/customSoundsAdmin.css', 'client');
api.addFiles('admin/startup.js', 'client');
api.addFiles('admin/adminSounds.html', 'client');
api.addFiles('admin/adminSounds.js', 'client');
api.addFiles('admin/adminSoundEdit.html', 'client');
api.addFiles('admin/adminSoundInfo.html', 'client');
api.addFiles('admin/soundEdit.html', 'client');
api.addFiles('admin/soundEdit.js', 'client');
api.addFiles('admin/soundInfo.html', 'client');
api.addFiles('admin/soundInfo.js', 'client');
api.addFiles('admin/route.js', 'client');
api.addFiles('client/admin/startup.js', 'client');
api.addFiles('client/admin/adminSounds.html', 'client');
api.addFiles('client/admin/adminSounds.js', 'client');
api.addFiles('client/admin/adminSoundEdit.html', 'client');
api.addFiles('client/admin/adminSoundInfo.html', 'client');
api.addFiles('client/admin/soundEdit.html', 'client');
api.addFiles('client/admin/soundEdit.js', 'client');
api.addFiles('client/admin/soundInfo.html', 'client');
api.addFiles('client/admin/soundInfo.js', 'client');
api.addFiles('client/admin/route.js', 'client');
api.addFiles('client/lib/CustomSounds.js', 'client');
api.addFiles('client/models/CustomSounds.js', 'client');

@ -102,8 +102,32 @@
align-items: center;
& .emoji-filter {
position: relative;
width: 90%;
margin-bottom: 0;
& .search {
position: relative;
width: 100%;
height: 35px;
padding: 2px 8px;
border-width: 1px;
border-style: solid;
border-radius: 5px;
outline: none;
line-height: normal;
appearance: none;
}
& .icon-search {
position: absolute;
top: 10px;
left: 7px;
}
}
& .change-tone {

@ -14,21 +14,21 @@ Package.onUse(function(api) {
'rocketchat:ui-message'
]);
api.addFiles('function-isSet.js', 'client');
api.addFiles('rocketchat.js');
api.addFiles('client/function-isSet.js', 'client');
api.addFiles('client/rocketchat.js');
api.addFiles('emojiParser.js', 'client');
api.addFiles('client/emojiParser.js', 'client');
api.addFiles('emojiPicker.html', 'client');
api.addFiles('emojiPicker.js', 'client');
api.addFiles('emojiPicker.css', 'client');
api.addFiles('client/emojiPicker.html', 'client');
api.addFiles('client/emojiPicker.js', 'client');
api.addFiles('client/emojiPicker.css', 'client');
api.addFiles('emoji.css', 'client');
api.addFiles('client/emoji.css', 'client');
api.addFiles('lib/emojiRenderer.js', 'client');
api.addFiles('lib/EmojiPicker.js', 'client');
api.addFiles('emojiButton.js', 'client');
api.addFiles('keyboardFix.js', 'client');
api.addFiles('client/lib/emojiRenderer.js', 'client');
api.addFiles('client/lib/EmojiPicker.js', 'client');
api.addFiles('client/emojiButton.js', 'client');
api.addFiles('client/keyboardFix.js', 'client');
api.export('renderEmoji');
});

@ -24,6 +24,7 @@ Meteor.methods({
const attachment = {
title: file.name,
type: 'file',
description: file.description,
title_link: fileUrl,
title_link_download: true

@ -16,5 +16,5 @@ Package.onUse(function(api) {
'rocketchat:lib'
]);
api.addFiles('client.js', 'client');
api.addFiles('client/client.js', 'client');
});

@ -256,6 +256,7 @@
"Away_male": "Away",
"Back": "Back",
"Back_to_applications": "Back to applications",
"Back_to_chat": "Back to chat",
"Back_to_integrations": "Back to integrations",
"Back_to_integration_detail": "Back to the integration detail",
"Back_to_login": "Back to login",
@ -993,6 +994,7 @@
"Members_List": "Members List",
"Mentions": "Mentions",
"Mentions_default": "Mentions (default)",
"Mentions_only": "Mentions only",
"Message": "Message",
"Message_AllowBadWordsFilter": "Allow Message bad words filtering",
"Message_AllowDeleting": "Allow Message Deleting",
@ -1143,6 +1145,7 @@
"Offline_form_unavailable_message": "Offline form unavailable message",
"Offline_Link_Message": "GO TO MESSAGE",
"Offline_Mention_Email": "You have been mentioned by __user__ in #__room__",
"Offline_Mention_All_Email": "__user__ has posted a message in #__room__",
"Offline_message": "Offline message",
"Offline_success_message": "Offline success message",
"Offline_unavailable": "Offline unavailable",
@ -1378,6 +1381,8 @@
"Private_Groups": "Private Groups",
"Private_Groups_list": "List of Private Groups",
"Profile": "Profile",
"Profile_details": "Profile details",
"Profile_picture": "Profile picture",
"Profile_saved_successfully": "Profile saved successfully",
"Public": "Public",
"Public_Channel": "Public Channel",
@ -1759,6 +1764,7 @@
"Unnamed": "Unnamed",
"Unpin_Message": "Unpin Message",
"Unread_Count": "Unread Count",
"Unread_Count_DM": "Unread Count for Direct Messages",
"Unread_Tray_Icon_Alert": "Unread Tray Icon Alert",
"Unread_Messages": "Unread Messages",
"Unread_Rooms": "Unread Rooms",
@ -1932,4 +1938,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"
}
}

@ -1,9 +1,9 @@
{
"dependencies": {
"csv-parse": {
"version": "1.1.7",
"resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-1.1.7.tgz",
"from": "csv-parse@1.1.7"
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-1.2.0.tgz",
"from": "csv-parse@1.2.0"
}
}
}

@ -17,5 +17,5 @@ Package.onUse(function(api) {
});
Npm.depends({
'csv-parse': '1.1.7'
'csv-parse': '1.2.0'
});

@ -131,9 +131,10 @@ Importer.CSV = class ImporterCSV extends Importer.Base {
const selectionUsers = tempUsers.map((u) => new Importer.SelectionUser(u.id, u.username, u.email, false, false, true));
const selectionChannels = tempChannels.map((c) => new Importer.SelectionChannel(c.id, c.name, false, true, c.isPrivate));
const selectionMessages = this.importRecord.count.messages;
super.updateProgress(Importer.ProgressStep.USER_SELECTION);
return new Importer.Selection(this.name, selectionUsers, selectionChannels);
return new Importer.Selection(this.name, selectionUsers, selectionChannels, selectionMessages);
}
startImport(importSelection) {
@ -232,16 +233,60 @@ Importer.CSV = class ImporterCSV extends Importer.Base {
}
this.collection.update({ _id: this.channels._id }, { $set: { 'channels': this.channels.channels }});
//If no channels file, collect channel map from DB for message-only import
if (this.channels.channels.length === 0) {
for (const cname of this.messages.keys()) {
Meteor.runAsUser(startedByUserId, () => {
const existantRoom = RocketChat.models.Rooms.findOneByName(cname);
if (existantRoom || cname.toUpperCase() === 'GENERAL') {
this.channels.channels.push({
id: cname.replace('.', '_'),
name: cname,
rocketId: (cname.toUpperCase() === 'GENERAL' ? 'GENERAL' : existantRoom._id),
do_import: true
});
}
});
}
}
//If no users file, collect user map from DB for message-only import
if (this.users.users.length === 0) {
for (const [ch, messagesMap] of this.messages.entries()) {
const csvChannel = this.getChannelFromName(ch);
if (!csvChannel || !csvChannel.do_import) {
continue;
}
Meteor.runAsUser(startedByUserId, () => {
for (const msgs of messagesMap.values()) {
for (const msg of msgs.messages) {
if (!this.getUserFromUsername(msg.username)) {
const user = RocketChat.models.Users.findOneByUsername(msg.username);
if (user) {
this.users.users.push({
rocketId: user._id,
username: user.username
});
}
}
}
}
});
}
}
//Import the Messages
super.updateProgress(Importer.ProgressStep.IMPORTING_MESSAGES);
for (const [ch, messagesMap] of this.messages.entries()) {
const csvChannel = this.getChannelFromName(ch);
if (!csvChannel.do_import) {
if (!csvChannel || !csvChannel.do_import) {
continue;
}
const room = RocketChat.models.Rooms.findOneById(csvChannel.rocketId, { fields: { usernames: 1, t: 1, name: 1 } });
Meteor.runAsUser(startedByUserId, () => {
const timestamps = {};
for (const [msgGroupData, msgs] of messagesMap.entries()) {
super.updateRecord({ 'messagesstatus': `${ ch }/${ msgGroupData }.${ msgs.messages.length }` });
for (const msg of msgs.messages) {
@ -253,8 +298,15 @@ Importer.CSV = class ImporterCSV extends Importer.Base {
const creator = this.getUserFromUsername(msg.username);
if (creator) {
let suffix = '';
if (timestamps[msg.ts] === undefined) {
timestamps[msg.ts] = 1;
} else {
suffix = `-${ timestamps[msg.ts] }`;
timestamps[msg.ts] += 1;
}
const msgObj = {
_id: `csv-${ csvChannel.id }-${ msg.ts }`,
_id: `csv-${ csvChannel.id }-${ msg.ts }${ suffix }`,
ts: new Date(parseInt(msg.ts)),
msg: msg.text,
rid: room._id,
@ -285,8 +337,9 @@ Importer.CSV = class ImporterCSV extends Importer.Base {
getSelection() {
const selectionUsers = this.users.users.map((u) => new Importer.SelectionUser(u.id, u.username, u.email, false, false, true));
const selectionChannels = this.channels.channels.map((c) => new Importer.SelectionChannel(c.id, c.name, false, true, c.isPrivate));
const selectionMessages = this.importRecord.count.messages;
return new Importer.Selection(this.name, selectionUsers, selectionChannels);
return new Importer.Selection(this.name, selectionUsers, selectionChannels, selectionMessages);
}
getChannelFromName(channelName) {

@ -190,10 +190,11 @@ Importer.HipChatEnterprise = class ImporterHipChatEnterprise extends Importer.Ba
const selectionUsers = tempUsers.map((u) => new Importer.SelectionUser(u.id, u.username, u.email, u.isDeleted, false, true));
const selectionChannels = tempRooms.map((r) => new Importer.SelectionChannel(r.id, r.name, r.isArchived, true, r.isPrivate));
const selectionMessages = this.importRecord.count.messages;
super.updateProgress(Importer.ProgressStep.USER_SELECTION);
resolve(new Importer.Selection(this.name, selectionUsers, selectionChannels));
resolve(new Importer.Selection(this.name, selectionUsers, selectionChannels, selectionMessages));
}));
//Wish I could make this cleaner :(
@ -431,8 +432,9 @@ Importer.HipChatEnterprise = class ImporterHipChatEnterprise extends Importer.Ba
getSelection() {
const selectionUsers = this.users.users.map((u) => new Importer.SelectionUser(u.id, u.username, u.email, false, false, true));
const selectionChannels = this.channels.channels.map((c) => new Importer.SelectionChannel(c.id, c.name, false, true, c.isPrivate));
const selectionMessages = this.importRecord.count.messages;
return new Importer.Selection(this.name, selectionUsers, selectionChannels);
return new Importer.Selection(this.name, selectionUsers, selectionChannels, selectionMessages);
}
getChannelFromRoomIdentifier(roomIdentifier) {

@ -131,8 +131,9 @@ Importer.HipChat = Importer.HipChat = (function() {
const selectionChannels = tempRooms.map(function(room) {
return new Importer.SelectionChannel(room.room_id, room.name, room.is_archived, true, false);
});
const selectionMessages = this.importRecord.count.messages;
this.updateProgress(Importer.ProgressStep.USER_SELECTION);
return new Importer.Selection(this.name, selectionUsers, selectionChannels);
return new Importer.Selection(this.name, selectionUsers, selectionChannels, selectionMessages);
}
startImport(importSelection) {
@ -331,7 +332,8 @@ Importer.HipChat = Importer.HipChat = (function() {
const selectionChannels = this.channels.channels.map(function(room) {
return new Importer.SelectionChannel(room.room_id, room.name, room.is_archived, true, false);
});
return new Importer.Selection(this.name, selectionUsers, selectionChannels);
const selectionMessages = this.importRecord.count.messages;
return new Importer.Selection(this.name, selectionUsers, selectionChannels, selectionMessages);
}
}

@ -92,8 +92,9 @@ Importer.Slack = class extends Importer.Base {
}
const selectionUsers = tempUsers.map(user => new Importer.SelectionUser(user.id, user.name, user.profile.email, user.deleted, user.is_bot, !user.is_bot));
const selectionChannels = tempChannels.map(channel => new Importer.SelectionChannel(channel.id, channel.name, channel.is_archived, true, false));
const selectionMessages = this.importRecord.count.messages;
this.updateProgress(Importer.ProgressStep.USER_SELECTION);
return new Importer.Selection(this.name, selectionUsers, selectionChannels);
return new Importer.Selection(this.name, selectionUsers, selectionChannels, selectionMessages);
}
startImport(importSelection) {
super.startImport(importSelection);
@ -431,6 +432,7 @@ Importer.Slack = class extends Importer.Base {
getSelection() {
const selectionUsers = this.users.users.map(user => new Importer.SelectionUser(user.id, user.name, user.profile.email, user.deleted, user.is_bot, !user.is_bot));
const selectionChannels = this.channels.channels.map(channel => new Importer.SelectionChannel(channel.id, channel.name, channel.is_archived, true, false));
return new Importer.Selection(this.name, selectionUsers, selectionChannels);
const selectionMessages = this.importRecord.count.messages;
return new Importer.Selection(this.name, selectionUsers, selectionChannels, selectionMessages);
}
};

@ -33,35 +33,43 @@
</div>
</div>
<div class="section">
<h1>{{_ "Users"}}</h1>
<div class="section-content">
<ul>
{{#each users}}
{{#unless is_bot}}
{{#if users.length}}
<div class="section">
<h1>{{_ "Users"}}</h1>
<div class="section-content">
<ul>
{{#each users}}
{{#unless is_bot}}
<li>
<input type="checkbox" name="{{user_id}}" checked="checked" />{{username}} - {{email}}
{{#if is_deleted }} <em>({{_ "Deleted"}})</em>{{/if}}
</li>
{{/unless}}
{{/each}}
</ul>
</div>
</div>
{{/if}}
{{#if channels.length}}
<div class="section">
<h1>{{_ "Channels"}}</h1>
<div class="section-content">
<ul>
{{#each channels}}
<li>
<input type="checkbox" name="{{user_id}}" checked="checked" />{{username}} - {{email}}
{{#if is_deleted }} <em>({{_ "Deleted"}})</em>{{/if}}
<input type="checkbox" name="{{channel_id}}" checked="checked" />{{name}}
{{#if is_archived}} <em>({{_ "Importer_Archived"}})</em>{{/if}}
{{#if is_private}} <em>({{_ "Private_Group"}})</em>{{/if}}
</li>
{{/unless}}
{{/each}}
</ul>
{{/each}}
</ul>
</div>
</div>
</div>
{{/if}}
<div class="section">
<h1>{{_ "Channels"}}</h1>
<div class="section-content">
<ul>
{{#each channels}}
<li>
<input type="checkbox" name="{{channel_id}}" checked="checked" />{{name}}
{{#if is_archived}} <em>({{_ "Importer_Archived"}})</em>{{/if}}
{{#if is_private}} <em>({{_ "Private_Group"}})</em>{{/if}}
</li>
{{/each}}
</ul>
</div>
<h1>{{_ "Messages"}}: {{message_count}}</h1>
</div>
{{else}}
{{#if isPreparing}}

@ -27,6 +27,9 @@ Template.adminImportPrepare.helpers({
},
channels() {
return Template.instance().channels.get();
},
message_count() {
return Template.instance().message_count.get();
}
});
@ -70,6 +73,7 @@ Template.adminImportPrepare.events({
template.users.set(data.users);
template.channels.set(data.channels);
template.message_count.set(data.message_count);
template.loaded.set(true);
template.preparing.set(false);
});
@ -131,6 +135,7 @@ Template.adminImportPrepare.onCreated(function() {
this.loaded = new ReactiveVar(false);
this.users = new ReactiveVar([]);
this.channels = new ReactiveVar([]);
this.message_count = new ReactiveVar(0);
function loadSelection(progress) {
if ((progress != null ? progress.step : undefined)) {
@ -146,6 +151,7 @@ Template.adminImportPrepare.onCreated(function() {
}
instance.users.set(data.users);
instance.channels.set(data.channels);
instance.message_count.set(data.message_count);
instance.loaded.set(true);
return instance.preparing.set(false);
});

@ -6,10 +6,12 @@ Importer.Selection = (Importer.Selection = class Selection {
// @param [String] name the name of the Importer
// @param [Array<Importer.User>] users the array of users
// @param [Array<Importer.Channel>] channels the array of channels
// @param [Integer] number of collected messages
//
constructor(name, users, channels) {
constructor(name, users, channels, message_count) {
this.name = name;
this.users = users;
this.channels = channels;
this.message_count = message_count;
}
});

@ -138,11 +138,6 @@ Meteor.startup(function() {
const message = $(e.currentTarget).closest('.message')[0];
chatMessages[Session.get('openedRoom')].edit(message);
RocketChat.MessageAction.hideDropDown();
// const input = instance.find('.input-message');
// Meteor.setTimeout(() => {
// input.focus();
// input.change();
// }, 200);
},
validation(message) {
if (RocketChat.models.Subscriptions.findOne({

@ -1,53 +1,55 @@
<template name="customFieldsForm">
{{#if customFields}}
<div class="rc-form-group rc-grid">
{{#each customFields}}
<div class="rc-input rc-w50 padded">
{{#if $eq field.type 'select'}}
{{# unless ../new}}
<div class="input-line">
<label for="{{fieldName}}">{{_ fieldName}}</label>
<div>
<select name="{{fieldName}}" data-customfield="true">
{{#each field.options}}
<option value="{{.}}" selected="{{selectedField . ..}}">{{_ .}}</option>
{{/each}}
</select>
<div class="input-error"></div>
</div>
</div>
{{else}}
<label class="rc-input__label">
<div class="rc-input__title">{{_ fieldName}}</div>
<div class="rc-input__wrapper">
<select name="{{fieldName}}" data-customfield="true" class="rc-input__element">
<option></option>
{{#each field.options}}
<option value="{{.}}" selected="{{selectedField . ..}}">{{_ .}}</option>
{{/each}}
</select>
</div>
</label>
{{/unless}}
{{/if}}
{{#if $eq field.type 'text'}}
{{# unless ../new}}
<div class="input-line">
<label for="{{fieldName}}">{{_ fieldName}}</label>
<div>
<input type="text" name="{{fieldName}}" id="{{fieldName}}" data-customfield="true" value="{{fieldValue}}" maxlength="{{field.maxLength}}" />
<div class="input-error"></div>
</div>
</div>
{{else}}
{{#each customFields}}
<div class="rc-input rc-w50 padded">
{{#if $eq field.type 'select'}}
{{# unless ../new}}
<div class="input-line">
<label for="{{fieldName}}">{{_ fieldName}}</label>
<div>
<select name="{{fieldName}}" data-customfield="true">
{{#each field.options}}
<option value="{{.}}" selected="{{selectedField . ..}}">{{_ .}}</option>
{{/each}}
</select>
<div class="input-error"></div>
</div>
</div>
{{else}}
<label class="rc-input__label">
<div class="rc-input__title">{{_ fieldName}}</div>
<div class="rc-input__wrapper">
<select name="{{fieldName}}" data-customfield="true" class="rc-input__element">
<option></option>
{{#each field.options}}
<option value="{{.}}" selected="{{selectedField . ..}}">{{_ .}}</option>
{{/each}}
</select>
</div>
</label>
{{/unless}}
{{/if}}
{{#if $eq field.type 'text'}}
{{# unless ../new}}
<div class="input-line">
<label for="{{fieldName}}">{{_ fieldName}}</label>
<div>
<input type="text" name="{{fieldName}}" id="{{fieldName}}" data-customfield="true" value="{{fieldValue}}" maxlength="{{field.maxLength}}" />
<div class="input-error"></div>
</div>
</div>
{{else}}
<label class="rc-input__label">
<div class="rc-input__title">{{_ fieldName}}</div>
<div class="rc-input__wrapper">
<input type="text" class="rc-input__element" name="{{fieldName}}" id="{{fieldName}}" data-customfield="true" value="{{fieldValue}}" maxlength="{{field.maxLength}}">
</div>
</label>
{{/unless}}
{{/if}}
{{/unless}}
{{/if}}
</div>
{{/each}}
</div>
{{/each}}
</div>
{{/if}}
</template>

@ -68,22 +68,34 @@ RocketChat.callbacks.add('afterSaveMessage', function(message, room) {
}
});
const unreadCount = RocketChat.settings.get('Unread_Count');
if (room.t === 'd') {
const unreadCountDM = RocketChat.settings.get('Unread_Count_DM');
if (toAll || toHere) {
let incUnread = 0;
if (['all_messages', 'group_mentions_only', 'user_and_group_mentions_only'].includes(unreadCount)) {
incUnread = 1;
if (unreadCountDM === 'all_messages') {
RocketChat.models.Subscriptions.incUnreadForRoomIdExcludingUserId(room._id, message.u._id);
} else if (toAll || toHere) {
RocketChat.models.Subscriptions.incGroupMentionsAndUnreadForRoomIdExcludingUserId(room._id, message.u._id, 1, 1);
} else if ((mentionIds && mentionIds.length > 0) || (highlightsIds && highlightsIds.length > 0)) {
RocketChat.models.Subscriptions.incUserMentionsAndUnreadForRoomIdAndUserIds(room._id, _.compact(_.unique(mentionIds.concat(highlightsIds))), 1, 1);
}
RocketChat.models.Subscriptions.incGroupMentionsAndUnreadForRoomIdExcludingUserId(room._id, message.u._id, 1, incUnread);
} else if ((mentionIds && mentionIds.length > 0) || (highlightsIds && highlightsIds.length > 0)) {
let incUnread = 0;
if (['all_messages', 'user_mentions_only', 'user_and_group_mentions_only'].includes(unreadCount)) {
incUnread = 1;
} else {
const unreadCount = RocketChat.settings.get('Unread_Count');
if (toAll || toHere) {
let incUnread = 0;
if (['all_messages', 'group_mentions_only', 'user_and_group_mentions_only'].includes(unreadCount)) {
incUnread = 1;
}
RocketChat.models.Subscriptions.incGroupMentionsAndUnreadForRoomIdExcludingUserId(room._id, message.u._id, 1, incUnread);
} else if ((mentionIds && mentionIds.length > 0) || (highlightsIds && highlightsIds.length > 0)) {
let incUnread = 0;
if (['all_messages', 'user_mentions_only', 'user_and_group_mentions_only'].includes(unreadCount)) {
incUnread = 1;
}
RocketChat.models.Subscriptions.incUserMentionsAndUnreadForRoomIdAndUserIds(room._id, _.compact(_.unique(mentionIds.concat(highlightsIds))), 1, incUnread);
} else if (unreadCount === 'all_messages') {
RocketChat.models.Subscriptions.incUnreadForRoomIdExcludingUserId(room._id, message.u._id);
}
RocketChat.models.Subscriptions.incUserMentionsAndUnreadForRoomIdAndUserIds(room._id, _.compact(_.unique(mentionIds.concat(highlightsIds))), 1, incUnread);
} else if (unreadCount === 'all_messages') {
RocketChat.models.Subscriptions.incUnreadForRoomIdExcludingUserId(room._id, message.u._id);
}
}

@ -10,30 +10,6 @@ RocketChat.callbacks.add('afterSaveMessage', function(message, room) {
return message;
}
let emailSubject;
const usersToSendEmail = {};
const directMessage = room.t === 'd';
if (directMessage) {
usersToSendEmail[message.rid.replace(message.u._id, '')] = 1;
emailSubject = TAPi18n.__('Offline_DM_Email', {
user: message.u.username
});
} else {
if (message.mentions) {
message.mentions.forEach(function(mention) {
usersToSendEmail[mention._id] = 1;
});
}
emailSubject = TAPi18n.__('Offline_Mention_Email', {
user: message.u.username,
room: room.name
});
}
const getMessageLink = (room, sub) => {
const roomPath = RocketChat.roomTypes.getRouteLink(room.t, sub);
const path = Meteor.absoluteUrl(roomPath ? roomPath.replace(/^\//, '') : '');
@ -63,28 +39,33 @@ RocketChat.callbacks.add('afterSaveMessage', function(message, room) {
const footer = RocketChat.placeholders.replace(RocketChat.settings.get('Email_Footer') || '');
messageHTML = messageHTML.replace(/\n/gm, '<br/>');
RocketChat.models.Subscriptions.findWithSendEmailByRoomId(room._id).forEach((sub) => {
if (sub.disableNotifications) {
delete usersToSendEmail[sub.u._id];
} else {
switch (sub.emailNotifications) {
case 'all':
usersToSendEmail[sub.u._id] = 'force';
break;
case 'mentions':
if (usersToSendEmail[sub.u._id]) {
usersToSendEmail[sub.u._id] = 'force';
}
break;
case 'nothing':
delete usersToSendEmail[sub.u._id];
break;
case 'default':
break;
const usersToSendEmail = {};
if (room.t === 'd') {
usersToSendEmail[message.rid.replace(message.u._id, '')] = 'direct';
} else {
RocketChat.models.Subscriptions.findWithSendEmailByRoomId(room._id).forEach((sub) => {
if (sub.disableNotifications) {
return delete usersToSendEmail[sub.u._id];
}
}
});
const emailNotifications = sub.emailNotifications;
if (emailNotifications !== 'nothing') {
const mentionedUser = message.mentions.find((mention) => {
return mention._id === sub.u._id;
});
if (emailNotifications === 'mentions' || mentionedUser) {
return usersToSendEmail[sub.u._id] = 'mention';
}
if (emailNotifications === 'all') {
return usersToSendEmail[sub.u._id] = 'all';
}
}
delete usersToSendEmail[sub.u._id];
});
}
const userIdsToSendEmail = Object.keys(usersToSendEmail);
let defaultLink;
@ -114,6 +95,24 @@ RocketChat.callbacks.add('afterSaveMessage', function(message, room) {
return;
}
let emailSubject;
switch (usersToSendEmail[user._id]) {
case 'all':
emailSubject = TAPi18n.__('Offline_Mention_All_Email', {
user: message.u.username,
room: room.name || room.label
});
break;
case 'direct':
emailSubject = TAPi18n.__('Offline_DM_Email', { user: message.u.username });
break;
case 'mention':
emailSubject = TAPi18n.__('Offline_Mention_Email', {
user: message.u.username,
room: room.name
});
break;
}
user.emails.some((email) => {
if (email.verified) {
email = {

@ -373,6 +373,19 @@ RocketChat.settings.addGroup('General', function() {
],
'public': true
});
this.add('Unread_Count_DM', 'all_messages', {
type: 'select',
values: [
{
key: 'all_messages',
i18nLabel: 'All_messages'
}, {
key: 'mentions_only',
i18nLabel: 'Mentions_only'
}
],
'public': true
});
this.add('CDN_PREFIX', '', {
type: 'string',
'public': true

@ -1,12 +1,12 @@
<template name="livechatFlex">
<aside class="sidebar sidebar--light" role="navigation">
<header class="sidebar__header">
{{> accountBox lighten=true }}
{{> accountBox lighten=true modifier="--livechat"}}
<button class="sidebar-flex__back-button" data-action="back">
<svg class="sidebar-flex__back-icon">
<use xlink:href="#icon-arrow-back"></use>
</svg>
<span>Back to chat</span>
<span>{{_ "Back_to_chat"}}</span>
</button>
</header>
<div class="rooms-list">

@ -57,7 +57,7 @@ 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';
const html = `<a href="${ _.escapeHTML(url) }" title="${ _.escapeHTML(title) }" target="${ _.escapeHTML(target) }" ref="noopener noreferrer"><div class="inline-image" style="background-image: url(${ _.escapeHTML(url) });"></div></a>`;
const html = `<a href="${ _.escapeHTML(url) }" title="${ _.escapeHTML(title) }" target="${ _.escapeHTML(target) }" rel="noopener noreferrer"><div class="inline-image" style="background-image: url(${ _.escapeHTML(url) });"></div></a>`;
if (message && message.tokens) {
const token = `=!=${ Random.id() }=!=`;
@ -76,13 +76,13 @@ class MarkdownClass {
// Support [Text](http://link)
msg = msg.replace(new RegExp(`\\[([^\\]]+)\\]\\(((?:${ schemes }):\\/\\/[^\\)]+)\\)`, 'gm'), function(match, title, url) {
const target = url.indexOf(Meteor.absoluteUrl()) === 0 ? '' : '_blank';
return `<a href="${ _.escapeHTML(url) }" target="${ _.escapeHTML(target) }" ref="noopener noreferrer">${ _.escapeHTML(title) }</a>`;
return `<a href="${ _.escapeHTML(url) }" target="${ _.escapeHTML(target) }" rel="noopener noreferrer">${ _.escapeHTML(title) }</a>`;
});
// Support <http://link|Text>
msg = msg.replace(new RegExp(`(?:<|&lt;)((?:${ schemes }):\\/\\/[^\\|]+)\\|(.+?)(?=>|&gt;)(?:>|&gt;)`, 'gm'), (match, url, title) => {
const target = url.indexOf(Meteor.absoluteUrl()) === 0 ? '' : '_blank';
return `<a href="${ _.escapeHTML(url) }" target="${ _.escapeHTML(target) }" ref="noopener noreferrer">${ _.escapeHTML(title) }</a>`;
return `<a href="${ _.escapeHTML(url) }" target="${ _.escapeHTML(target) }" rel="noopener noreferrer">${ _.escapeHTML(title) }</a>`;
});
if (typeof window !== 'undefined' && window !== null ? window.rocketDebug : undefined) { console.log('Markdown', msg); }

@ -18,13 +18,3 @@ Package.onUse(function(api) {
api.addFiles('markdown.js');
api.addFiles('markdowncode.js');
});
Package.onTest(function(api) {
api.use([
'sanjo:jasmine@0.20.2',
'rocketchat:lib',
'rocketchat:markdown'
]);
api.addFiles('tests/jasmine/client/unit/markdown.spec.js', 'client');
});

@ -30,7 +30,7 @@
{{#if title}}
<div class="attachment-title">
{{#if title_link}}
<a href="{{fixCordova title_link}}" target="_blank">{{_ "Attachment_File_Uploaded"}} : {{title}}</a>
<a href="{{fixCordova title_link}}" target="_blank">{{#if isFile}} {{_ "Attachment_File_Uploaded"}}: {{/if}}{{title}}</a>
{{#if title_link_download}}
<a class="icon-download attachment-download-icon" href="{{fixCordova title_link}}" target="_blank" download=""></a>
{{/if}}

@ -70,5 +70,9 @@ Template.messageAttachment.helpers({
},
injectIndex(data, previousIndex, index) {
data.index = `${ previousIndex }.attachments.${ index }`;
},
isFile() {
return this.type === 'file';
}
});

@ -3,19 +3,19 @@
<blockquote class="background-transparent-darker-before">
{{#if meta.oembedProviderName}}
{{#if meta.oembedProviderUrl}}
<a href="{{meta.oembedProviderUrl}}" style="color: #9e9ea6">{{meta.oembedProviderName}}</a>
<a href="{{meta.oembedProviderUrl}}" target="_blank" style="color: #9e9ea6">{{meta.oembedProviderName}}</a>
{{/if}}
{{/if}}
{{#if meta.oembedAuthorName}}
{{#if meta.oembedAuthorUrl}}
<br class="only-after-a"/>
<a href="{{meta.oembedAuthorUrl}}">{{meta.oembedAuthorName}}</a>
<a href="{{meta.oembedAuthorUrl}}" target="_blank">{{meta.oembedAuthorName}}</a>
{{/if}}
{{/if}}
{{#if meta.oembedTitle}}
{{#if meta.oembedUrl}}
<br class="only-after-a"/>
<a href="{{meta.oembedUrl}}">{{meta.oembedTitle}}</a>
<a href="{{meta.oembedUrl}}" target="_blank">{{meta.oembedTitle}}</a>
{{/if}}
{{/if}}
{{#if collapsed}}

@ -1,7 +1,7 @@
<template name="oembedVideoWidget">
{{#if parsedUrl}}
<blockquote class="background-transparent-darker-before">
<div><a href="{{url}}">{{parsedUrl.host}}</a></div>
<div><a href="{{url}}" target="_blank">{{parsedUrl.host}}</a></div>
<span>{{title}}</span>
{{#if collapsed}}
<span class="collapse-switch icon-right-dir" data-index="{{index}}" data-collapsed="{{collapsed}}"></span>

@ -1,7 +1,7 @@
<template name="oembedYoutubeWidget">
{{#if parsedUrl}}
<blockquote class="background-transparent-darker-before">
<a href="{{url}}">{{parsedUrl.host}}</a>
<a href="{{url}}" target="_blank">{{parsedUrl.host}}</a>
{{#if collapsed}}
<span class="collapse-switch icon-right-dir" data-index="{{index}}" data-collapsed="{{collapsed}}"></span><br>
{{else}}

@ -15,16 +15,17 @@
width: 100%;
height: 24px;
color: var(--message-box-markdown-color);
justify-content: center;
&-item {
display: flex;
width: 16px;
min-width: 16px;
margin: 0 4px;
transition: color 0.1s;
color: var(--message-box-markdown-color);
justify-content: center;
&:hover,
@ -34,6 +35,12 @@
}
}
&-link {
color: currentColor;
font-size: 0.75rem;
}
&-icon {
fill: currentColor;
stroke: currentColor;
@ -50,7 +57,7 @@
stroke: none;
}
&--inline_code {
&--inline-code {
width: 16px;
height: 12px;
}
@ -61,7 +68,7 @@
stroke: none;
}
&--multi_line {
&--multi-line {
width: 13px;
height: 11px;
}
@ -107,7 +114,7 @@
border-width: var(--message-box-container-border-width);
border-color: var(--message-box-container-border-color);
border-radius: var(--message-box-container-border-radius);
align-items: flex-end;
align-items: center;
&.editing {
background-color: var(--message-box-editing-color);

@ -119,8 +119,8 @@
&__picture {
display: flex;
flex: 0 0 var(--sidebar-item-thumb-size);
width: var(--sidebar-item-thumb-size);
margin-right: 6px;
align-items: center;
}

@ -200,7 +200,6 @@
.rc-old .alert {
margin-bottom: 20px;
padding: 15px;
border-width: 1px;
border-radius: 4px;

@ -13,10 +13,10 @@ Package.onUse(function(api) {
api.use('rocketchat:theme');
api.use('rocketchat:ui-master');
api.addFiles('tooltip.css', 'client');
api.addFiles('client/tooltip.css', 'client');
api.addFiles('rocketchat-tooltip.html', 'client');
api.addFiles('rocketchat-tooltip.js', 'client');
api.addFiles('client/rocketchat-tooltip.html', 'client');
api.addFiles('client/rocketchat-tooltip.js', 'client');
api.addFiles('init.js', 'client');
api.addFiles('client/init.js', 'client');
});

@ -1,12 +1,12 @@
<template name="accountFlex">
<aside class="sidebar sidebar--light" role="navigation">
<header class="sidebar__header">
{{> accountBox lighten=true }}
{{> accountBox lighten=true modifier="--account" }}
<button class="sidebar-flex__back-button" data-action="back">
<svg class="sidebar-flex__back-icon">
<use xlink:href="#icon-arrow-back"></use>
</svg>
<span>Back to chat</span>
<span>{{_ "Back_to_chat"}}</span>
</button>
</header>
<div class="rooms-list">

@ -18,17 +18,17 @@
{{> burger}}
<h2 style="flex: 1 1; white-space: nowrap;">{{_ "My Profile"}}</h2>
<div class="content" style="text-align: end; max-width: 649px; flex: 1 1 100%">
<button class="rc-button rc-button--primary" name="send" type="submit" data-button="create" form="profile" {{canSave 'disabled'}}>Save Changes</button>
<button class="rc-button rc-button--primary" name="send" type="submit" data-button="create" form="profile" {{canSave 'disabled'}}>{{_ "Save_changes"}}</button>
</div>
<div style="flex: 1 1;"></div>
</header>
<div class="preferences-page__content">
<form id="profile" autocomplete="off" class="container">
<fieldset class="rc-form-legend">
<legend style="margin-bottom: 2.5rem;">Profile Details</legend>
<legend style="margin-bottom: 2.5rem;">{{_ "Profile_details"}}</legend>
<div>
<div class="rc-form-group">
<label class="rc-form-label">{{_ "Profile Picture"}}</label>
<label class="rc-form-label">{{_ "Profile_picture"}}</label>
<div class="rc-select-avatar">
<div class="rc-select-avatar__preview">
{{# unless avatarPreview}}

@ -85,7 +85,8 @@ Template.avatarPrompt.events({
files = event.dataTransfer && event.dataTransfer.files || [];
}
for (const file of files) {
for (let i = 0; i < files.length; i++) {
const file = files[i];
Object.defineProperty(file, 'type', { value: mime.lookup(file.name) });
}

@ -1,12 +1,12 @@
<template name="adminFlex">
<aside class="sidebar sidebar--light" role="navigation">
<header class="sidebar__header">
{{> accountBox lighten=true }}
{{> accountBox lighten=true modifier="--admin"}}
<button class="sidebar-flex__back-button" data-action="back">
<svg class="sidebar-flex__back-icon">
<use xlink:href="#icon-arrow-back"></use>
</svg>
<span>Back to chat</span>
<span>{{_ "Back_to_chat"}}</span>
</button>
</header>
<div class="rooms-list" aria-label="{{_ "Administration"}}">

@ -118,6 +118,7 @@ Template.body.onRendered(function() {
}
});
RocketChat.mainReady = new ReactiveVar(false);
Template.main.helpers({
siteName() {
return RocketChat.settings.get('Site_Name');
@ -145,6 +146,9 @@ Template.main.helpers({
const settingsReady = RocketChat.settings.cachedCollection.ready.get();
const ready = (Meteor.userId() == null) || (routerReady && subscriptionsReady && settingsReady);
RocketChat.CachedCollectionManager.syncEnabled = ready;
Meteor.defer(() => {
RocketChat.mainReady.set(ready);
});
return ready;
},
hasUsername() {

@ -20,6 +20,7 @@ Package.onUse(function(api) {
'ecmascript',
'templating',
'underscore',
'reactive-var',
'rocketchat:lib',
'meteorhacks:inject-initial'
]);

@ -11,8 +11,8 @@
<symbol id="icon-map-pin" viewBox="0 0 12 16"><g transform="translate(1 1)" stroke-width="1.5" fill="none" fill-rule="evenodd"><path d="M5 14s5-4.15 5-9.027C10 2.226 7.761 0 5 0S0 2.226 0 4.973C0 9.85 5 14 5 14z"/><circle cx="5" cy="5" r="2"/></g></symbol>
<symbol id="icon-md-bold" viewBox="0 0 8 10"><path d="M4.501 10H.928V.84h3.504c.842 0 1.504.206 1.986.616.483.41.724.967.724 1.67 0 .473-.153.9-.46 1.282-.307.38-.68.611-1.12.692V5.2c.626.08 1.123.32 1.491.72.368.4.552.903.552 1.508 0 .804-.274 1.434-.822 1.889-.548.455-1.308.682-2.282.682zm-2.43-8.15v2.939h1.827c.694 0 1.216-.123 1.565-.369.35-.245.524-.611.524-1.098 0-.465-.158-.827-.473-1.085-.315-.258-.757-.387-1.324-.387H2.07zm0 7.14h2.26c.689 0 1.211-.137 1.567-.412.355-.275.533-.677.533-1.206 0-.529-.185-.928-.555-1.196-.37-.27-.922-.404-1.654-.404H2.07v3.219z" fill-rule="evenodd"/></symbol>
<symbol id="icon-md-italic" viewBox="0 0 2 10"><path d="M.486 10h1.092V3.157H.486V10zm.546-8.233a.73.73 0 0 0 .54-.225.738.738 0 0 0 .221-.537.735.735 0 0 0-.222-.54.735.735 0 0 0-.54-.221.738.738 0 0 0-.536.222.73.73 0 0 0-.225.54c0 .207.075.386.225.536.15.15.33.225.537.225z" fill-rule="evenodd"/></symbol>
<symbol id="icon-md-inline_code" viewBox="0 0 16 12"><g stroke-width="1.5" fill="none" fill-rule="evenodd"><path d="M4.667 9.105L1.562 6l3.105-3.105"/><path d="M9.329 1.04L6.633 11.1 9.33 1.04z" stroke-linecap="square"/><path d="M11.333 2.895L14.438 6l-3.105 3.105"/></g></symbol>
<symbol id="icon-md-multi_line" viewBox="0 0 13 11"><g stroke-width="1.5" fill="none" fill-rule="evenodd"><path d="M8 1h4v5H2"/><path d="M4.536 9.571L1 6.036 4.536 2.5"/></g></symbol>
<symbol id="icon-md-inline-code" viewBox="0 0 16 12"><g stroke-width="1.5" fill="none" fill-rule="evenodd"><path d="M4.667 9.105L1.562 6l3.105-3.105"/><path d="M9.329 1.04L6.633 11.1 9.33 1.04z" stroke-linecap="square"/><path d="M11.333 2.895L14.438 6l-3.105 3.105"/></g></symbol>
<symbol id="icon-md-multi-line" viewBox="0 0 13 11"><g stroke-width="1.5" fill="none" fill-rule="evenodd"><path d="M8 1h4v5H2"/><path d="M4.536 9.571L1 6.036 4.536 2.5"/></g></symbol>
<symbol id="icon-md-strike" viewBox="0 0 12 11"><g fill-rule="evenodd"><path d="M2.62 7.607c.06.791.399 1.424 1.019 1.898.62.474 1.414.71 2.383.71 1.05 0 1.882-.248 2.498-.745.616-.497.924-1.167.924-2.01 0-.672-.207-1.207-.62-1.605-.412-.398-1.092-.715-2.04-.952l-.959-.254c-.63-.16-1.082-.353-1.355-.578a1.08 1.08 0 0 1-.41-.876c0-.465.186-.838.556-1.117.37-.28.86-.419 1.47-.419.571 0 1.04.132 1.406.397.366.264.589.631.67 1.101H9.31c-.046-.74-.368-1.348-.965-1.822C7.75.861 7.008.625 6.124.625c-.97 0-1.751.24-2.346.72-.594.48-.892 1.11-.892 1.888 0 .652.189 1.174.565 1.565.377.392.98.693 1.81.905l1.174.304c.63.157 1.094.364 1.39.622.296.259.444.582.444.972 0 .452-.202.828-.606 1.126-.404.299-.915.448-1.533.448-.652 0-1.189-.142-1.612-.425-.423-.284-.67-.665-.743-1.143H2.62z"/><path d="M.8 4.3h10.5v1.5H.8z"/></g></symbol>
<symbol id="icon-plus" viewBox="0 0 14 14"><g stroke-width="1.5" fill="none" fill-rule="evenodd" stroke-linecap="square"><path d="M7 1v12M13 7H1"/></g></symbol>
<symbol id="icon-sign-out" viewBox="0 0 512 512"><path d="M48 64h132c6.6 0 12 5.4 12 12v8c0 6.6-5.4 12-12 12H48c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h132c6.6 0 12 5.4 12 12v8c0 6.6-5.4 12-12 12H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48zm279 19.5l-7.1 7.1c-4.7 4.7-4.7 12.3 0 17l132 131.4H172c-6.6 0-12 5.4-12 12v10c0 6.6 5.4 12 12 12h279.9L320 404.4c-4.7 4.7-4.7 12.3 0 17l7.1 7.1c4.7 4.7 12.3 4.7 17 0l164.5-164c4.7-4.7 4.7-12.3 0-17L344 83.5c-4.7-4.7-12.3-4.7-17 0z"/></symbol>

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

@ -150,6 +150,7 @@ export default () => {
}, 100);
DynamicCss = typeof DynamicCss !=='undefined'? DynamicCss : {};
DynamicCss.test = () => window.CSS && window.CSS.supports && window.CSS.supports('(--foo: red)');
DynamicCss.run = debounce((replace = false) => {
if (replace) {
document.querySelector('#css-variables').innerHTML = RocketChat.settings.get('theme-custom-variables');

@ -28,7 +28,7 @@
</svg>
</div>
<textarea autofocus dir="auto" name="msg" maxlength="{{maxMessageLength}}" placeholder="{{_ 'Message'}}" rows="1" class="rc-message-box__textarea js-input-message autogrow-short"></textarea>
{{# if sendIcon}}
{{#if sendIcon}}
<div class="rc-message-box__icon js-send">
<svg class="rc-input__icon-svg rc-input__icon-svg--smile">
<use xlink:href="#icon-send"></use>
@ -75,18 +75,23 @@
{{/if}}
</label>
<div class="rc-message-box__toolbar-markdown">
<!--{{#if katexSyntax}}
<span><a href="https://github.com/Khan/KaTeX/wiki/Function-Support-in-KaTeX" target="_blank">{{katexSyntax}}</a></span>
{{/if}}-->
{{#each mdButtons}}
<button class="rc-message-box__toolbar-markdown-item rc-tooltip js-md" aria-label={{_ label}}>
<svg class="rc-message-box__toolbar-markdown-icon rc-message-box__toolbar-markdown-icon--{{label}}">
<use xlink:href="#icon-md-{{label}}"></use>
</svg>
</button>
{{/each}}
</div>
{{#if showFormattingTips}}
<div class="rc-message-box__toolbar-markdown">
{{#each mdButtons}}
<button class="rc-message-box__toolbar-markdown-item rc-tooltip js-md" aria-label={{_ label}} data-link="{{link}}">
{{#if icon}}
<svg class="rc-message-box__toolbar-markdown-icon rc-message-box__toolbar-markdown-icon--{{icon}}">
<use xlink:href="#icon-md-{{icon}}"></use>
</svg>
{{else}}
{{#if link}}
<a href="{{link}}" target="_blank" class="rc-message-box__toolbar-markdown-link">{{label}}</a>
{{/if}}
{{/if}}
</button>
{{/each}}
</div>
{{/if}}
{{else}}
<div class="stream-info">
{{#if isBlockedOrBlocker}}

@ -1,12 +1,7 @@
/* globals fileUpload KonchatNotification chatMessages */
import toastr from 'toastr';
import mime from 'mime-type/with-db';
import moment from 'moment';
//import {VRecDialog} from 'meteor/rocketchat:ui-vrecord';
function katexSyntax() {
if (RocketChat.katex.katex_enabled()) {
if (RocketChat.katex.dollar_syntax_enabled()) {
@ -20,6 +15,10 @@ function katexSyntax() {
}
function applyMd(e, t) {
if (e.currentTarget.dataset.link) {
return false;
}
e.preventDefault();
const box = t.find('.js-input-message');
const {selectionEnd = box.value.length, selectionStart = 0} = box;
@ -83,37 +82,44 @@ function applyMd(e, t) {
const markdownButtons = [
{
label: 'bold',
icon: 'bold',
pattern: '*{{text}}*',
group: 'showMarkdown',
command: 'b'
command: 'b',
condition: () => RocketChat.Markdown
},
{
label: 'italic',
icon: 'italic',
pattern: '_{{text}}_',
group: 'showMarkdown',
command: 'i'
command: 'i',
condition: () => RocketChat.Markdown
},
{
label: 'strike',
icon: 'strike',
pattern: '~{{text}}~',
group: 'showMarkdown'
condition: () => RocketChat.Markdown
},
{
label: 'inline_code',
icon: 'inline-code',
pattern: '`{{text}}`',
group: 'showMarkdownCode'
condition: () => RocketChat.Markdown
},
{
label: 'multi_line',
icon: 'multi-line',
pattern: '```\n{{text}}\n``` ',
group: 'showMarkdownCode'
condition: () => RocketChat.MarkdownCode
},
{
label: katexSyntax,
link: 'https://github.com/Khan/KaTeX/wiki/Function-Support-in-KaTeX',
condition: () => RocketChat.katex
}
];
Template.messageBox.helpers({
toString(obj) {
return JSON.stringify(obj);
},
columns() {
const groups = RocketChat.messageBox.actions.get();
const sorted = Object.keys(groups).sort((a, b) => groups[b].length - groups[a].length);
@ -138,7 +144,7 @@ Template.messageBox.helpers({
return columns;
},
mdButtons() {
return markdownButtons;
return markdownButtons.filter(button => !button.condition || button.condition());
},
roomName() {
const roomData = Session.get(`roomData${ this._id }`);
@ -158,20 +164,8 @@ Template.messageBox.helpers({
return roomData.name;
}
},
showMarkdown() {
return RocketChat.Markdown;
},
showMarkdownCode() {
return RocketChat.MarkdownCode;
},
showKatex() {
return RocketChat.katex;
},
katexSyntax() {
return katexSyntax();
},
showFormattingTips() {
return RocketChat.settings.get('Message_ShowFormattingTips') && (RocketChat.Markdown || RocketChat.MarkdownCode || katexSyntax());
return RocketChat.settings.get('Message_ShowFormattingTips');
},
canJoin() {
return Meteor.userId() && RocketChat.roomTypes.verifyShowJoinLink(this._id);
@ -261,46 +255,9 @@ Template.messageBox.helpers({
return 'hidden';
}
},
fileUploadEnabled() {
return RocketChat.settings.get('FileUpload_Enabled');
},
fileUploadAllowedMediaTypes() {
return RocketChat.settings.get('FileUpload_MediaTypeWhiteList');
},
showFileUpload() {
let roomData;
if (RocketChat.settings.get('FileUpload_Enabled')) {
roomData = Session.get(`roomData${ this._id }`);
if (roomData && roomData.t === 'd') {
return RocketChat.settings.get('FileUpload_Enabled_Direct');
} else {
return true;
}
} else {
return RocketChat.settings.get('FileUpload_Enabled');
}
},
showMic() {
return Template.instance().showMicButton.get();
},
showVRec() {
return Template.instance().showVideoRec.get();
},
showSend() {
if (!Template.instance().isMessageFieldEmpty.get()) {
return 'show-send';
}
},
showLocation() {
return RocketChat.Geolocation.get() !== false;
},
notSubscribedTpl() {
return RocketChat.roomTypes.getNotSubscribedTpl(this._id);
},
showSandstorm() {
return Meteor.settings['public'].sandstorm && !Meteor.isCordova;
},
anonymousRead() {
return (Meteor.userId() == null) && RocketChat.settings.get('Accounts_AllowAnonymousRead') === true;
},
@ -462,54 +419,6 @@ Template.messageBox.events({
'click .editing-commands-save > button'() {
return chatMessages[this._id].send(this._id, chatMessages[this._id].input);
},
'change .message-form input[type=file]'(event) {
const e = event.originalEvent || event;
let files = e.target.files;
if (!files || files.length === 0) {
files = (e.dataTransfer && e.dataTransfer.files) || [];
}
const filesToUpload = [...files].map(file => {
// `file.type = mime.lookup(file.name)` does not work.
Object.defineProperty(file, 'type', {
value: mime.lookup(file.name)
});
return {
file,
name: file.name
};
});
return fileUpload(filesToUpload);
},
'click .message-buttons.share'(e, t) {
t.$('.share-items').toggleClass('hidden');
return t.$('.message-buttons.share').toggleClass('active');
},
'click .sandstorm-offer'() {
const roomId = this._id;
return RocketChat.Sandstorm.request('uiView', (err, data) => {
if (err || !data.token) {
console.error(err);
return;
}
return Meteor.call('sandstormClaimRequest', data.token, data.descriptor, function(err, viewInfo) {
if (err) {
console.error(err);
return;
}
Meteor.call('sendMessage', {
_id: Random.id(),
rid: roomId,
msg: '',
urls: [
{
url: 'grain://sandstorm',
sandstormViewInfo: viewInfo
}
]
});
});
});
},
'click .js-md'(e, t) {
applyMd.apply(this, [e, t]);
}
@ -528,27 +437,7 @@ Template.messageBox.onRendered(function() {
Template.messageBox.onCreated(function() {
this.isMessageFieldEmpty = new ReactiveVar(true);
this.showMicButton = new ReactiveVar(false);
this.showVideoRec = new ReactiveVar(false);
this.showVideoRec = new ReactiveVar(false);
this.sendIcon = new ReactiveVar(false);
return this.autorun(() => {
const videoRegex = /video\/webm|video\/\*/i;
const videoEnabled = !RocketChat.settings.get('FileUpload_MediaTypeWhiteList') || RocketChat.settings.get('FileUpload_MediaTypeWhiteList').match(videoRegex);
if (RocketChat.settings.get('Message_VideoRecorderEnabled') && ((navigator.getUserMedia != null) || (navigator.webkitGetUserMedia != null)) && videoEnabled && RocketChat.settings.get('FileUpload_Enabled')) {
this.showVideoRec.set(true);
} else {
this.showVideoRec.set(false);
}
const wavRegex = /audio\/wav|audio\/\*/i;
const wavEnabled = !RocketChat.settings.get('FileUpload_MediaTypeWhiteList') || RocketChat.settings.get('FileUpload_MediaTypeWhiteList').match(wavRegex);
if (RocketChat.settings.get('Message_AudioRecorderEnabled') && ((navigator.getUserMedia != null) || (navigator.webkitGetUserMedia != null)) && wavEnabled && RocketChat.settings.get('FileUpload_Enabled')) {
return this.showMicButton.set(true);
} else {
return this.showMicButton.set(false);
}
});
});
Meteor.startup(function() {

@ -2,13 +2,13 @@
<div class="sidebar__account {{#if lighten}}sidebar__account--lighten{{/if}}" aria-label="{{_ "Account"}}" role="region">
{{#with myUserInfo}}
{{#if username}}
<label class="sidebar__account-label" for="sidebar__account-menu" data-popover="label">
<label class="sidebar__account-label" for="sidebar__account-menu{{../modifier}}" data-popover="label">
<div class="sidebar__account-thumb" data-status='{{visualStatus}}'>
{{> avatar username=username}}
</div>
<div class="sidebar__account-data">
<h3 class="sidebar__account-username {{#if ../lighten}}sidebar__account-username--lighten{{/if}}" data-username="{{username}}">@{{username}}</h3>
<input id="sidebar__account-menu" type="checkbox" class="rc-popover-anchor" data-popover="anchor" {{isAnonymous}}>
<input id="sidebar__account-menu{{../modifier}}" type="checkbox" class="rc-popover-anchor" data-popover="anchor" {{isAnonymous}}>
<div class="rc-popover" data-popover="popover">
<div class="rc-popover__content">
<div class="rc-popover__column">

@ -19,14 +19,6 @@
<p class="rooms-list__empty-room">{{_ "No_channels_yet" }}</p>
{{/each}}
</ul>
{{#if hasMoreChannelsButton ..}}
{{!--<button class="rooms-list__more">{{_ "More_channels"}}...</button>--}}
{{/if}}
{{#if hasMoreGroupsButton ..}}
{{!--<button class="rooms-list__more">{{_ "More_groups"}}...</button>--}}
{{/if}}
{{/if}}
{{/with}}
{{/if}}

@ -69,14 +69,6 @@ Template.roomList.helpers({
return !['unread', 'f'].includes(group.identifier) || rooms.count();
},
hasMoreChannelsButton(room) {
return room.identifier === 'c' || room.anonymous;
},
hasMoreGroupsButton(room) {
return room.identifier === 'p';
},
roomType(room) {
if (room.header || room.identifier) {
return `type-${ room.header || room.identifier }`;

@ -12,7 +12,7 @@ const RoomManager = new function() {
Object.keys(openedRooms).forEach(typeName => {
const record = openedRooms[typeName];
if (record.active !== true || record.ready === true) { return; }
const ready = CachedChatRoom.ready.get() && CachedChatSubscription.ready.get() === true;
const ready = CachedChatRoom.ready.get() && RocketChat.mainReady.get();
if (ready !== true) { return; }
const user = Meteor.user();
@ -256,21 +256,19 @@ Tracker.autorun(function() {
return connectionWasOnline = connected;
});
// Reload rooms after login
let currentUsername = undefined;
Tracker.autorun(() => {
const user = Meteor.user();
if ((currentUsername === undefined) && ((user != null ? user.username : undefined) != null)) {
currentUsername = user.username;
RoomManager.closeAllRooms();
if (FlowRouter._current.route) {
return FlowRouter._current.route.callAction(FlowRouter._current);
Meteor.startup(() => {
// Reload rooms after login
let currentUsername = undefined;
Tracker.autorun(() => {
const user = Meteor.user();
if ((currentUsername === undefined) && ((user != null ? user.username : undefined) != null)) {
currentUsername = user.username;
RoomManager.closeAllRooms();
FlowRouter.reload();
}
}
});
});
Meteor.startup(() =>
ChatMessage.find().observe({
removed(record) {
if (RoomManager.getOpenedRoomByRid(record.rid) != null) {
@ -285,8 +283,8 @@ Meteor.startup(() =>
}
}
}
})
);
});
});
const onDeleteMessageStream = msg => ChatMessage.remove({_id: msg._id});

@ -28,7 +28,6 @@
{{_ "Read_only_channel"}}
</span>
</label>
{{!--<span class="rc-switch__description">Only admin can write new messages</span>--}}
</div>
</div>
<div class="create-channel__inputs">

@ -109,7 +109,6 @@ Template.createChannel.events({
t.type.set(e.target.checked ? e.target.value : 'p');
},
'input [name=users]'(e, t) {
console.log(this);
const input = e.target;
const position = input.selectionEnd || input.selectionStart;
const length = input.value.length;

@ -22,6 +22,7 @@ Package.onUse(function(api) {
'templating',
'underscore',
'rocketchat:lib',
'rocketchat:ui-master',
'raix:push',
'raix:ui-dropped-event'
]);

@ -8,7 +8,7 @@ program.usage('[options]').option('-v, --verbose', 'Verbose', (function(v, total
}), 0).option('-M, --mongo-db [mongo db]', 'Mongo DB', 'localhost:27017').option('-N, --db-name [db name]', 'DB Name', 'meteor').on('--help', function() {
console.log(' Example:');
console.log('');
console.log(' $ coffee unsubscribe.coffee');
console.log(' $ node unsubscribe.js');
return console.log('');
}).parse(process.argv);

@ -1,14 +1,14 @@
import Page from './Page';
class Administration extends Page {
get flexNav() { return browser.element('.sidebar--flex'); }
get flexNavContent() { return browser.element('.sidebar--flex'); }
get layoutLink() { return browser.element('.sidebar--flex [href="/admin/Layout"]'); }
get infoLink() { return browser.element('.sidebar--flex [href="/admin/info"]'); }
get roomsLink() { return browser.element('.sidebar--flex [href="/admin/rooms"]'); }
get usersLink() { return browser.element('.sidebar--flex [href="/admin/users"]'); }
get generalLink() { return browser.element('.sidebar--flex [href="/admin/General"]'); }
get permissionsLink() { return browser.element('.sidebar--flex [href="/admin/permissions"]'); }
get flexNav() { return browser.element('.flex-nav'); }
get flexNavContent() { return browser.element('.flex-nav'); }
get layoutLink() { return browser.element('.flex-nav [href="/admin/Layout"]'); }
get infoLink() { return browser.element('.flex-nav [href="/admin/info"]'); }
get roomsLink() { return browser.element('.flex-nav [href="/admin/rooms"]'); }
get usersLink() { return browser.element('.flex-nav [href="/admin/users"]'); }
get generalLink() { return browser.element('.flex-nav [href="/admin/General"]'); }
get permissionsLink() { return browser.element('.flex-nav [href="/admin/permissions"]'); }
get customScriptBtn() { return browser.element('.section:nth-of-type(6) .collapse'); }
get customScriptLoggedOutTextArea() { return browser.element('.section:nth-of-type(6) .CodeMirror-scroll'); }
get customScriptLoggedInTextArea() { return browser.element('.CodeMirror.cm-s-default:nth-of-type(2)'); }

@ -8,7 +8,7 @@ class SideNav extends Page {
get saveChannelBtn() { return browser.element('.create-channel__content button[data-button="create"]'); }
// Account box
get accountBoxUserName() { return browser.element('.sidebar__account-name'); }
get accountBoxUserName() { return browser.element('.sidebar__account-username'); }
get accountBoxUserAvatar() { return browser.element('.sidebar__account .avatar-image'); }
get accountStatus() { return browser.element('.sidebar__account-status'); }
get popOverContent() { return browser.element('.rc-popover__content'); }

Loading…
Cancel
Save