Merge branch 'develop' into minimalistic-view

pull/4319/head
Diego Sampaio 9 years ago
commit ea21ee7827
No known key found for this signature in database
GPG Key ID: E060152B30502562
  1. 30
      .meteor/versions
  2. 22
      .snapcraft/edge/snapcraft.yaml
  3. 22
      .snapcraft/stable/snapcraft.yaml
  4. 1
      .travis.yml
  5. 1
      .travis/docker.sh
  6. 47
      docker-compose.yml
  7. 52
      package.json
  8. 1
      packages/rocketchat-autolinker/.npm/package/.gitignore
  9. 7
      packages/rocketchat-autolinker/.npm/package/README
  10. 503
      packages/rocketchat-autolinker/.npm/package/npm-shrinkwrap.json
  11. 49
      packages/rocketchat-autolinker/autolinker.coffee
  12. 64
      packages/rocketchat-autolinker/client.js
  13. 10
      packages/rocketchat-autolinker/lib/Autolinker.min.js
  14. 17
      packages/rocketchat-autolinker/package.js
  15. 8
      packages/rocketchat-autolinker/settings.coffee
  16. 9
      packages/rocketchat-autolinker/settings.js
  17. 17
      packages/rocketchat-colors/client.coffee
  18. 18
      packages/rocketchat-colors/client.js
  19. 7
      packages/rocketchat-colors/package.js
  20. 7
      packages/rocketchat-colors/settings.js
  21. 24
      packages/rocketchat-colors/style.css
  22. 3
      packages/rocketchat-cors/cors.coffee
  23. 3
      packages/rocketchat-emoji-custom/client/lib/emojiCustom.js
  24. 15
      packages/rocketchat-file-upload/client/lib/FileUploadAmazonS3.js
  25. 15
      packages/rocketchat-file-upload/client/lib/FileUploadFileSystem.js
  26. 15
      packages/rocketchat-file-upload/client/lib/FileUploadGridFS.js
  27. 4
      packages/rocketchat-file-upload/client/lib/fileUploadHandler.js
  28. 2
      packages/rocketchat-file-upload/lib/FileUploadBase.js
  29. 4
      packages/rocketchat-internal-hubot/hubot.coffee
  30. 8
      packages/rocketchat-internal-hubot/package.js
  31. 11
      packages/rocketchat-ldap/server/loginHandler.js
  32. 21
      packages/rocketchat-ldap/server/sync.js
  33. 7
      packages/rocketchat-lib/client/lib/roomTypes.coffee
  34. 11
      packages/rocketchat-lib/server/lib/sendNotificationsOnMessage.js
  35. 15
      packages/rocketchat-lib/server/models/Subscriptions.coffee
  36. 22
      packages/rocketchat-livechat/app/.meteor/versions
  37. 111
      packages/rocketchat-theme/assets/stylesheets/base.less
  38. 22
      packages/rocketchat-theme/assets/stylesheets/utils/_colors.import.less
  39. 4
      packages/rocketchat-ui-flextab/flex-tab/tabs/userInfo.html
  40. 3
      packages/rocketchat-ui-message/message/message.html
  41. 14
      packages/rocketchat-ui-message/message/messageBox.coffee
  42. 6
      packages/rocketchat-ui-sidenav/side-nav/chatRoomItem.coffee
  43. 2
      packages/rocketchat-ui-sidenav/side-nav/chatRoomItem.html
  44. 76
      packages/rocketchat-ui/lib/fileUpload.coffee
  45. 18
      packages/rocketchat-ui/views/app/room.coffee
  46. 2
      packages/rocketchat-ui/views/app/room.html
  47. 13
      server/methods/createDirectMessage.coffee
  48. 6
      server/methods/removeUserFromRoom.coffee
  49. 3
      server/methods/setUserActiveStatus.coffee
  50. 2
      server/publications/fullUserData.coffee
  51. 18
      server/publications/spotlight.coffee
  52. 1
      server/publications/userData.coffee
  53. 8
      server/startup/migrations/v061.js

@ -13,12 +13,12 @@ babel-compiler@6.9.1
babel-runtime@0.1.11
base64@1.0.9
binary-heap@1.0.9
blaze@2.1.8
blaze-html-templates@1.0.4
blaze-tools@1.0.9
blaze@2.1.9
blaze-html-templates@1.0.5
blaze-tools@1.0.10
boilerplate-generator@1.0.9
caching-compiler@1.1.7
caching-html-compiler@1.0.6
caching-html-compiler@1.0.7
callback-hook@1.0.9
cfs:http-methods@0.0.32
check@1.2.3
@ -47,13 +47,13 @@ geojson-utils@1.0.9
github@1.1.8
google@1.1.14
hot-code-push@1.0.4
html-tools@1.0.10
htmljs@1.0.10
html-tools@1.0.11
htmljs@1.0.11
http@1.2.9
id-map@1.0.8
jalik:ufs@0.6.7
jalik:ufs-gridfs@0.1.1
jalik:ufs-local@0.2.5
jalik:ufs@0.6.8
jalik:ufs-gridfs@0.1.2
jalik:ufs-local@0.2.6
jparker:crypto-core@0.1.0
jparker:crypto-md5@0.1.1
jparker:gravatar@0.5.1
@ -223,21 +223,23 @@ shell-server@0.2.1
simple:highlight.js@1.2.0
simple:json-routes@2.1.0
smoral:sweetalert@1.1.1
spacebars@1.0.12
spacebars-compiler@1.0.12
spacebars@1.0.13
spacebars-compiler@1.0.13
srp@1.0.9
standard-minifier-css@1.2.0
standard-minifier-js@1.2.0
steffo:meteor-accounts-saml@0.0.1
tap:i18n@1.8.2
templating@1.2.14
templating-tools@1.0.4
templating@1.2.15
templating-compiler@1.2.15
templating-runtime@1.2.15
templating-tools@1.0.5
tmeasday:crypto-base@3.1.2
tmeasday:crypto-md5@3.1.2
todda00:friendly-slugs@0.6.0
tracker@1.1.0
twitter@1.1.12
ui@1.0.11
ui@1.0.12
underscore@1.0.9
underscorestring:underscore.string@3.3.4
url@1.0.10

@ -25,25 +25,11 @@ parts:
plugin: nodejs
node-engine: 4.5.0
node-packages:
- amdefine
- ansi-regex
- ansi-styles
- asap
- chalk
- eachline
- escape-string-regexp
- has-ansi
- promise
- fibers
- underscore
- strip-ansi
- source-map
- source-map-support
- semver
- supports-color
- type-of
- babel-compiler
- meteor-promise
build-packages:
# For fibers
- python
@ -55,12 +41,20 @@ parts:
plugin: dump
after: [mongodb]
source: https://cdn-download.rocket.chat/build/rocket.chat-develop.tgz
stage-packages:
- imagemagick
organize:
usr/bin/convert-im6: usr/bin/convert
stage:
- programs
- main.js
- usr
- lib
snap:
- programs
- main.js
- usr
- lib
mongodb:
source: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-3.2.7.tgz
plugin: dump

@ -17,25 +17,11 @@ parts:
plugin: nodejs
node-engine: 4.5.0
node-packages:
- amdefine
- ansi-regex
- ansi-styles
- asap
- chalk
- eachline
- escape-string-regexp
- has-ansi
- promise
- fibers
- underscore
- strip-ansi
- source-map
- source-map-support
- semver
- supports-color
- type-of
- babel-compiler
- meteor-promise
build-packages:
# For fibers
- python
@ -47,12 +33,20 @@ parts:
plugin: dump
after: [mongodb]
source: https://rocket.chat/releases/latest/download
stage-packages:
- imagemagick
organize:
usr/bin/convert-im6: usr/bin/convert
stage:
- programs
- main.js
- usr
- lib
snap:
- programs
- main.js
- usr
- lib
mongodb:
source: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-3.2.7.tgz
plugin: dump

@ -48,6 +48,7 @@ deploy:
after_deploy:
- ".travis/docker.sh"
- ".travis/update-releases.sh"
- ".travis/snap.sh"
env:
global:
- CXX=g++-4.8

@ -1,5 +1,4 @@
#!/bin/bash
set -x
set -euvo pipefail
IFS=$'\n\t'

@ -1,18 +1,12 @@
mongo:
image: mongo
# volumes:
# - ./data/runtime/db:/data/db
# - ./data/dump:/dump
command: mongod --smallfiles --oplogSize 128
rocketchat:
image: rocketchat/rocket.chat:latest
# volumes:
# - ./uploads:/app/uploads
volumes:
- ./uploads:/app/uploads
environment:
- PORT=3000
- ROOT_URL=http://yourhost:3000
- ROOT_URL=http://localhost:3000
- MONGO_URL=mongodb://mongo:27017/rocketchat
- MONGO_OPLOG_URL=mongodb://mongo:27017/local
- MAIL_URL=smtp://smtp.email
- HTTP_PROXY=http://proxy.domain.com
- HTTPS_PROXY=http://proxy.domain.com
@ -20,10 +14,28 @@ rocketchat:
- mongo:mongo
ports:
- 3000:3000
labels:
- "traefik.backend=rocketchat"
- "traefik.frontend.rule=Host: your.domain.tld"
mongo:
image: mongo:3.0
volumes:
- ./data/db:/data/db
# - ./data/dump:/dump
command: mongod --smallfiles --oplogSize 128 --replSet rs0
labels:
- "traefik.enable=false"
mongo-init-replica:
image: mongo:3.0
command: 'mongo mongo/rocketchat --eval "rs.initiate({ _id: ''rs0'', members: [ { _id: 0, host: ''localhost:27017'' } ]})"'
links:
- mongo:mongo
# hubot, the popular chatbot (add the bot user first and change the password before starting this image)
hubot:
image: rocketchat/hubot-rocketchat:v0.1.4
image: rocketchat/hubot-rocketchat:latest
environment:
- ROCKETCHAT_URL=rocketchat:3000
- ROCKETCHAT_ROOM=GENERAL
@ -34,6 +46,19 @@ hubot:
- EXTERNAL_SCRIPTS=hubot-help,hubot-seen,hubot-links,hubot-diagnostics
links:
- rocketchat:rocketchat
labels:
- "traefik.enable=false"
volumes:
- ./scripts:/home/hubot/scripts
# this is used to expose the hubot port for notifications on the host on port 3001, e.g. for hubot-jenkins-notifier
ports:
- 3001:8080
#traefik:
# image: traefik:latest
# command: traefik --docker --acme=true --acme.domains='your.domain.tld' --acme.email='your@email.tld' --acme.entrypoint=https --acme.storagefile=acme.json --defaultentrypoints=http --defaultentrypoints=https --entryPoints='Name:http Address::80 Redirect.EntryPoint:https' --entryPoints='Name:https Address::443 TLS.Certificates:'
# ports:
# - 80:80
# - 443:443
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock

@ -6,28 +6,36 @@
"name": "Rocket.Chat",
"url": "http://rocket.chat/"
},
"contributors": [{
"name": "Aaron Ogle",
"email": "aaron.olge@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"
}],
"contributors": [
{
"name": "Aaron Ogle",
"email": "aaron.olge@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"
}
],
"keywords": [
"rocketchat",
"rocket",

@ -0,0 +1,7 @@
This directory and the files immediately inside it are automatically generated
when you change this package's NPM dependencies. Commit the files in this
directory (npm-shrinkwrap.json, .gitignore, and this README) to source control
so that others run the same versions of sub-dependencies.
You should NOT check in the node_modules directory that Meteor automatically
creates; if you are using git, the .gitignore file tells git to ignore it.

@ -0,0 +1,503 @@
{
"dependencies": {
"ansi-regex": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz",
"from": "ansi-regex@>=2.0.0 <3.0.0"
},
"ansi-styles": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
"from": "ansi-styles@>=2.2.1 <3.0.0"
},
"array-differ": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz",
"from": "array-differ@>=1.0.0 <2.0.0"
},
"array-find-index": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.1.tgz",
"from": "array-find-index@>=1.0.1 <2.0.0"
},
"array-uniq": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz",
"from": "array-uniq@>=1.0.2 <2.0.0"
},
"autolinker": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/autolinker/-/autolinker-1.1.0.tgz",
"from": "autolinker@1.1.0"
},
"beeper": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/beeper/-/beeper-1.1.0.tgz",
"from": "beeper@>=1.0.0 <2.0.0"
},
"builtin-modules": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
"from": "builtin-modules@>=1.0.0 <2.0.0"
},
"camelcase": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz",
"from": "camelcase@>=2.0.0 <3.0.0"
},
"camelcase-keys": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz",
"from": "camelcase-keys@>=2.0.0 <3.0.0"
},
"chalk": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"from": "chalk@>=1.0.0 <2.0.0"
},
"clone": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz",
"from": "clone@>=1.0.0 <2.0.0"
},
"clone-stats": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz",
"from": "clone-stats@>=0.0.1 <0.0.2"
},
"concat-with-sourcemaps": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.0.4.tgz",
"from": "concat-with-sourcemaps@*"
},
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"from": "core-util-is@>=1.0.0 <1.1.0"
},
"currently-unhandled": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz",
"from": "currently-unhandled@>=0.4.1 <0.5.0"
},
"dateformat": {
"version": "1.0.12",
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz",
"from": "dateformat@>=1.0.11 <2.0.0"
},
"decamelize": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
"from": "decamelize@>=1.1.2 <2.0.0"
},
"duplexer2": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz",
"from": "duplexer2@0.0.2"
},
"error-ex": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.0.tgz",
"from": "error-ex@>=1.2.0 <2.0.0"
},
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"from": "escape-string-regexp@>=1.0.2 <2.0.0"
},
"fancy-log": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.2.0.tgz",
"from": "fancy-log@>=1.1.0 <2.0.0"
},
"find-up": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
"from": "find-up@>=1.0.0 <2.0.0"
},
"get-stdin": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",
"from": "get-stdin@>=4.0.1 <5.0.0"
},
"glogg": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.0.tgz",
"from": "glogg@>=1.0.0 <2.0.0"
},
"graceful-fs": {
"version": "4.1.6",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.6.tgz",
"from": "graceful-fs@>=4.1.2 <5.0.0"
},
"gulp-header": {
"version": "1.8.8",
"resolved": "https://registry.npmjs.org/gulp-header/-/gulp-header-1.8.8.tgz",
"from": "gulp-header@>=1.7.1 <2.0.0"
},
"gulp-util": {
"version": "3.0.7",
"resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.7.tgz",
"from": "gulp-util@*",
"dependencies": {
"object-assign": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz",
"from": "object-assign@>=3.0.0 <4.0.0"
}
}
},
"gulplog": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz",
"from": "gulplog@>=1.0.0 <2.0.0"
},
"has-ansi": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
"from": "has-ansi@>=2.0.0 <3.0.0"
},
"has-gulplog": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz",
"from": "has-gulplog@>=0.1.0 <0.2.0"
},
"hosted-git-info": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.1.5.tgz",
"from": "hosted-git-info@>=2.1.4 <3.0.0"
},
"indent-string": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz",
"from": "indent-string@>=2.1.0 <3.0.0"
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"from": "inherits@>=2.0.1 <2.1.0"
},
"is-arrayish": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
"from": "is-arrayish@>=0.2.1 <0.3.0"
},
"is-builtin-module": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
"from": "is-builtin-module@>=1.0.0 <2.0.0"
},
"is-finite": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.1.tgz",
"from": "is-finite@>=1.0.0 <2.0.0"
},
"is-utf8": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
"from": "is-utf8@>=0.2.0 <0.3.0"
},
"isarray": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
"from": "isarray@0.0.1"
},
"load-json-file": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
"from": "load-json-file@>=1.0.0 <2.0.0"
},
"lodash._basecopy": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz",
"from": "lodash._basecopy@>=3.0.0 <4.0.0"
},
"lodash._basetostring": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz",
"from": "lodash._basetostring@>=3.0.0 <4.0.0"
},
"lodash._basevalues": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz",
"from": "lodash._basevalues@>=3.0.0 <4.0.0"
},
"lodash._getnative": {
"version": "3.9.1",
"resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz",
"from": "lodash._getnative@>=3.0.0 <4.0.0"
},
"lodash._isiterateecall": {
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz",
"from": "lodash._isiterateecall@>=3.0.0 <4.0.0"
},
"lodash._reescape": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/lodash._reescape/-/lodash._reescape-3.0.0.tgz",
"from": "lodash._reescape@>=3.0.0 <4.0.0"
},
"lodash._reevaluate": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz",
"from": "lodash._reevaluate@>=3.0.0 <4.0.0"
},
"lodash._reinterpolate": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz",
"from": "lodash._reinterpolate@>=3.0.0 <4.0.0"
},
"lodash._root": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz",
"from": "lodash._root@>=3.0.0 <4.0.0"
},
"lodash.escape": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-3.2.0.tgz",
"from": "lodash.escape@>=3.0.0 <4.0.0"
},
"lodash.isarguments": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz",
"from": "lodash.isarguments@>=3.0.0 <4.0.0"
},
"lodash.isarray": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz",
"from": "lodash.isarray@>=3.0.0 <4.0.0"
},
"lodash.keys": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz",
"from": "lodash.keys@>=3.0.0 <4.0.0"
},
"lodash.restparam": {
"version": "3.6.1",
"resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz",
"from": "lodash.restparam@>=3.0.0 <4.0.0"
},
"lodash.template": {
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-3.6.2.tgz",
"from": "lodash.template@>=3.0.0 <4.0.0"
},
"lodash.templatesettings": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz",
"from": "lodash.templatesettings@>=3.0.0 <4.0.0"
},
"loud-rejection": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz",
"from": "loud-rejection@>=1.0.0 <2.0.0"
},
"map-obj": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz",
"from": "map-obj@>=1.0.1 <2.0.0"
},
"meow": {
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
"from": "meow@>=3.3.0 <4.0.0"
},
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"from": "minimist@>=1.1.0 <2.0.0"
},
"multipipe": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz",
"from": "multipipe@>=0.1.2 <0.2.0"
},
"normalize-package-data": {
"version": "2.3.5",
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.3.5.tgz",
"from": "normalize-package-data@>=2.3.4 <3.0.0"
},
"number-is-nan": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz",
"from": "number-is-nan@>=1.0.0 <2.0.0"
},
"object-assign": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz",
"from": "object-assign@*"
},
"parse-json": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
"from": "parse-json@>=2.2.0 <3.0.0"
},
"path-exists": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
"from": "path-exists@>=2.0.0 <3.0.0"
},
"path-type": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
"from": "path-type@>=1.0.0 <2.0.0"
},
"pify": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"from": "pify@>=2.0.0 <3.0.0"
},
"pinkie": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
"from": "pinkie@>=2.0.0 <3.0.0"
},
"pinkie-promise": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
"from": "pinkie-promise@>=2.0.0 <3.0.0"
},
"process-nextick-args": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
"from": "process-nextick-args@>=1.0.6 <1.1.0"
},
"read-pkg": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
"from": "read-pkg@>=1.0.0 <2.0.0"
},
"read-pkg-up": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz",
"from": "read-pkg-up@>=1.0.1 <2.0.0"
},
"readable-stream": {
"version": "1.1.14",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
"from": "readable-stream@>=1.1.9 <1.2.0"
},
"redent": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz",
"from": "redent@>=1.0.0 <2.0.0"
},
"repeating": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz",
"from": "repeating@>=2.0.0 <3.0.0"
},
"replace-ext": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz",
"from": "replace-ext@0.0.1"
},
"semver": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz",
"from": "semver@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0||>=4.0.0 <5.0.0||>=5.0.0 <6.0.0"
},
"signal-exit": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.1.tgz",
"from": "signal-exit@>=3.0.0 <4.0.0"
},
"source-map": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz",
"from": "source-map@>=0.5.1 <0.6.0"
},
"sparkles": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.0.tgz",
"from": "sparkles@>=1.0.0 <2.0.0"
},
"spdx-correct": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz",
"from": "spdx-correct@>=1.0.0 <1.1.0"
},
"spdx-expression-parse": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.3.tgz",
"from": "spdx-expression-parse@>=1.0.0 <1.1.0"
},
"spdx-license-ids": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz",
"from": "spdx-license-ids@>=1.0.2 <2.0.0"
},
"string_decoder": {
"version": "0.10.31",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
"from": "string_decoder@>=0.10.0 <0.11.0"
},
"strip-ansi": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"from": "strip-ansi@>=3.0.0 <4.0.0"
},
"strip-bom": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
"from": "strip-bom@>=2.0.0 <3.0.0"
},
"strip-indent": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz",
"from": "strip-indent@>=1.0.1 <2.0.0"
},
"supports-color": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"from": "supports-color@>=2.0.0 <3.0.0"
},
"through2": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/through2/-/through2-2.0.1.tgz",
"from": "through2@>=2.0.0 <3.0.0",
"dependencies": {
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"from": "isarray@>=1.0.0 <1.1.0"
},
"readable-stream": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz",
"from": "readable-stream@>=2.0.0 <2.1.0"
}
}
},
"time-stamp": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.0.1.tgz",
"from": "time-stamp@>=1.0.0 <2.0.0"
},
"trim-newlines": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz",
"from": "trim-newlines@>=1.0.0 <2.0.0"
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"from": "util-deprecate@>=1.0.1 <1.1.0"
},
"validate-npm-package-license": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz",
"from": "validate-npm-package-license@>=3.0.1 <4.0.0"
},
"vinyl": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz",
"from": "vinyl@>=0.5.0 <0.6.0"
},
"xtend": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
"from": "xtend@>=4.0.0 <4.1.0"
}
}
}

@ -1,49 +0,0 @@
###
# AutoLinker is a named function that will replace links on messages
# @param {Object} message - The message object
###
class AutoLinker
constructor: (message) ->
if _.trim message.html
regUrls = new RegExp(RocketChat.settings.get 'AutoLinker_UrlsRegExp')
autolinker = new Autolinker
stripPrefix: RocketChat.settings.get 'AutoLinker_StripPrefix'
urls:
schemeMatches: RocketChat.settings.get 'AutoLinker_Urls_Scheme'
wwwMatches: RocketChat.settings.get 'AutoLinker_Urls_www'
tldMatches: RocketChat.settings.get 'AutoLinker_Urls_TLD'
email: RocketChat.settings.get 'AutoLinker_Email'
phone: RocketChat.settings.get 'AutoLinker_Phone'
twitter: false
replaceFn: (autolinker, match) ->
if match.getType() is 'url'
if regUrls.test match.matchedText
if match.matchedText.indexOf(Meteor.absoluteUrl()) is 0
tag = match.buildTag() # returns an `Autolinker.HtmlTag` instance for an <a> tag
tag.setAttr('target', '' ); # sets target to empty, instead of _blank
return tag
return true
return null
regNonAutoLink = /(```\w*[\n ]?[\s\S]*?```+?)|(`(?:[^`]+)`)/
if RocketChat.settings.get 'Katex_Enabled'
regNonAutoLink = /(```\w*[\n ]?[\s\S]*?```+?)|(`(?:[^`]+)`)|(\\\(\w*[\n ]?[\s\S]*?\\\)+?)/
# Separate text in code blocks and non code blocks
msgParts = message.html.split regNonAutoLink
for part, index in msgParts
if part?.length? > 0
# Verify if this part is code
codeMatch = part.match regNonAutoLink
if not codeMatch?
msgParts[index] = autolinker.link part
# Re-mount message
message.html = msgParts.join('')
return message
RocketChat.callbacks.add 'renderMessage', AutoLinker

@ -0,0 +1,64 @@
//
// AutoLinker is a named function that will replace links on messages
// @param {Object} message - The message object
//
import Autolinker from 'autolinker';
function AutoLinker(message) {
if (_.trim(message.html)) {
const regUrls = new RegExp(RocketChat.settings.get('AutoLinker_UrlsRegExp'));
const autolinker = new Autolinker({
stripPrefix: RocketChat.settings.get('AutoLinker_StripPrefix'),
urls: {
schemeMatches: RocketChat.settings.get('AutoLinker_Urls_Scheme'),
wwwMatches: RocketChat.settings.get('AutoLinker_Urls_www'),
tldMatches: RocketChat.settings.get('AutoLinker_Urls_TLD')
},
email: RocketChat.settings.get('AutoLinker_Email'),
phone: RocketChat.settings.get('AutoLinker_Phone'),
twitter: false,
replaceFn(match) {
if (match.getType() === 'url') {
if (regUrls.test(match.matchedText)) {
if (match.matchedText.indexOf(Meteor.absoluteUrl()) === 0) {
const tag = match.buildTag(); // returns an `Autolinker.HtmlTag` instance for an <a> tag
tag.setAttr('target', ''); // sets target to empty, instead of _blank
return tag;
}
return true;
}
}
return null;
}
});
let regNonAutoLink = /(```\w*[\n ]?[\s\S]*?```+?)|(`(?:[^`]+)`)/;
if (RocketChat.settings.get('Katex_Enabled')) {
regNonAutoLink = /(```\w*[\n ]?[\s\S]*?```+?)|(`(?:[^`]+)`)|(\\\(\w*[\n ]?[\s\S]*?\\\)+?)/;
}
// Separate text in code blocks and non code blocks
const msgParts = message.html.split(regNonAutoLink);
msgParts.forEach((part, index) => {
if (part && part.length > 0) {
// Verify if this part is code
const codeMatch = part.match(regNonAutoLink);
if (!codeMatch) {
msgParts[index] = autolinker.link(part);
}
}
});
// Re-mount message
message.html = msgParts.join('');
}
return message;
}
RocketChat.callbacks.add('renderMessage', AutoLinker);

File diff suppressed because one or more lines are too long

@ -5,16 +5,15 @@ Package.describe({
git: ''
});
Npm.depends({
autolinker: '1.1.0'
});
Package.onUse(function(api) {
api.use([
'coffeescript',
'rocketchat:lib'
]);
api.use('ecmascript');
api.use('rocketchat:lib');
api.addFiles([
'autolinker.coffee',
'lib/Autolinker.min.js'
], ['client']);
api.addFiles('client.js', 'client');
api.addFiles('settings.coffee', ['server']);
api.addFiles('settings.js', 'server');
});

@ -1,8 +0,0 @@
Meteor.startup ->
RocketChat.settings.add 'AutoLinker_StripPrefix', false, {type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, i18nDescription: 'AutoLinker_StripPrefix_Description'}
RocketChat.settings.add 'AutoLinker_Urls_Scheme', true, {type: 'boolean', group: 'Message', section: 'AutoLinker', public: true}
RocketChat.settings.add 'AutoLinker_Urls_www', true, {type: 'boolean', group: 'Message', section: 'AutoLinker', public: true}
RocketChat.settings.add 'AutoLinker_Urls_TLD', true, {type: 'boolean', group: 'Message', section: 'AutoLinker', public: true}
RocketChat.settings.add 'AutoLinker_UrlsRegExp', '(://|www\\.).+', {type: 'string', group: 'Message', section: 'AutoLinker', public: true}
RocketChat.settings.add 'AutoLinker_Email', true, {type: 'boolean', group: 'Message', section: 'AutoLinker', public: true}
RocketChat.settings.add 'AutoLinker_Phone', true, {type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, i18nDescription: 'AutoLinker_Phone_Description'}

@ -0,0 +1,9 @@
Meteor.startup(function() {
RocketChat.settings.add('AutoLinker_StripPrefix', false, {type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, i18nDescription: 'AutoLinker_StripPrefix_Description'});
RocketChat.settings.add('AutoLinker_Urls_Scheme', true, {type: 'boolean', group: 'Message', section: 'AutoLinker', public: true});
RocketChat.settings.add('AutoLinker_Urls_www', true, {type: 'boolean', group: 'Message', section: 'AutoLinker', public: true});
RocketChat.settings.add('AutoLinker_Urls_TLD', true, {type: 'boolean', group: 'Message', section: 'AutoLinker', public: true});
RocketChat.settings.add('AutoLinker_UrlsRegExp', '(://|www\\.).+', {type: 'string', group: 'Message', section: 'AutoLinker', public: true});
RocketChat.settings.add('AutoLinker_Email', true, {type: 'boolean', group: 'Message', section: 'AutoLinker', public: true});
RocketChat.settings.add('AutoLinker_Phone', true, {type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, i18nDescription: 'AutoLinker_Phone_Description'});
});

@ -1,17 +0,0 @@
###
# Colors is a named function that will process Colors
# @param {Object} message - The message object
###
class ColorsClient
constructor: (message) ->
if _.trim message.html
msg = message.html
msg = msg.replace /(?:^|\s|\n)(#[A-Fa-f0-9]{3}([A-Fa-f0-9]{3})?)\b/g, (match, completeColor) ->
return match.replace completeColor, "<div class=\"message-color\"><div class=\"message-color-sample\" style=\"background-color:#{completeColor}\"></div>#{completeColor.toUpperCase()}</div>"
message.html = msg
return message
RocketChat.callbacks.add 'renderMessage', ColorsClient, RocketChat.callbacks.priority.MEDIUM

@ -0,0 +1,18 @@
//
// HexColorPreview is a named function that will process Colors
// @param {Object} message - The message object
//
function HexColorPreview(message) {
var msg;
if (_.trim(message.html) && RocketChat.settings.get('HexColorPreview_Enabled')) {
msg = message.html;
msg = msg.replace(/(?:^|\s|\n)(#[A-Fa-f0-9]{3}([A-Fa-f0-9]{3})?)\b/g, function(match, completeColor) {
return match.replace(completeColor, '<div class="message-color"><div class="message-color-sample" style="background-color:' + completeColor + '"></div>' + (completeColor.toUpperCase()) + '</div>');
});
message.html = msg;
}
return message;
}
RocketChat.callbacks.add('renderMessage', HexColorPreview, RocketChat.callbacks.priority.MEDIUM);

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

@ -0,0 +1,7 @@
RocketChat.settings.add('HexColorPreview_Enabled', true, {
type: 'boolean',
i18nLabel: 'Enabled',
group: 'Message',
section: 'Hex Color Preview',
public: true
});

@ -1,16 +1,16 @@
.message-color {
display: inline-block;
font-weight: 100;
display: inline-block;
font-weight: 100;
}
.message-color-sample {
width: 14px;
height: 14px;
display: inline-block;
border-radius: 3px;
margin-right: 3px;
margin-left: 2px;
border: 1px solid rgba(0,0,0,.2);
position: relative;
top: 2px;
}
width: 14px;
height: 14px;
display: inline-block;
border-radius: 3px;
margin-right: 3px;
margin-left: 2px;
border: 1px solid rgba(0, 0, 0, .2);
position: relative;
top: 2px;
}

@ -11,6 +11,9 @@ WebApp.rawConnectHandlers.use (req, res, next) ->
if req.headers['content-type'] not in ['', undefined]
return next()
if req.url.indexOf('/ufs/') is 0
return next()
buf = ''
req.setEncoding('utf8')
req.on 'data', (chunk) -> buf += chunk

@ -144,10 +144,11 @@ Meteor.startup(() =>
Meteor.call('listEmojiCustom', (error, result) => {
RocketChat.emoji.packages.emojiCustom.emojisByCategory = { rocket: [] };
for (let emoji of result) {
RocketChat.emoji.packages.emojiCustom.emojisByCategory.rocket.push(`${emoji.name}`);
RocketChat.emoji.packages.emojiCustom.emojisByCategory.rocket.push(emoji.name);
RocketChat.emoji.list[`:${emoji.name}:`] = emoji;
RocketChat.emoji.list[`:${emoji.name}:`].emojiPackage = 'emojiCustom';
for (let alias of emoji['aliases']) {
RocketChat.emoji.packages.emojiCustom.emojisByCategory.rocket.push(alias);
RocketChat.emoji.list[`:${alias}:`] = {};
RocketChat.emoji.list[`:${alias}:`].emojiPackage = 'emojiCustom';
RocketChat.emoji.list[`:${alias}:`].aliasOf = emoji.name;

@ -1,14 +1,17 @@
/* globals FileUpload, FileUploadBase, Slingshot */
FileUpload.AmazonS3 = class FileUploadAmazonS3 extends FileUploadBase {
constructor(meta, file, data) {
super(meta, file, data);
constructor(meta, file) {
super(meta, file);
this.uploader = new Slingshot.Upload('rocketchat-uploads', { rid: meta.rid });
}
start() {
this.uploader.send(this.file, (error, downloadUrl) => {
var file, item, uploading;
this.computation.stop();
if (error) {
uploading = Session.get('uploading');
if (uploading !== null) {
@ -39,12 +42,14 @@ FileUpload.AmazonS3 = class FileUploadAmazonS3 extends FileUploadBase {
});
}
});
}
getProgress() {
return this.uploader.progress();
this.computation = Tracker.autorun(() => {
this.onProgress(this.uploader.progress());
});
}
onProgress() {}
stop() {
if (this.uploader && this.uploader.xhr) {
this.uploader.xhr.abort();

@ -9,11 +9,11 @@ FileSystemStore = new UploadFS.store.Local({
});
FileUpload.FileSystem = class FileUploadFileSystem extends FileUploadBase {
constructor(meta, file, data) {
super(meta, file, data);
constructor(meta, file) {
super(meta, file);
this.handler = new UploadFS.Uploader({
store: FileSystemStore,
data: data,
data: file,
file: meta,
onError: (err) => {
var uploading = Session.get('uploading');
@ -46,14 +46,17 @@ FileUpload.FileSystem = class FileUploadFileSystem extends FileUploadBase {
});
}
});
this.handler.onProgress = (file, progress) => {
this.onProgress(progress);
};
}
start() {
return this.handler.start();
}
getProgress() {
return this.handler.getProgress();
}
onProgress() {}
stop() {
return this.handler.stop();

@ -1,10 +1,10 @@
/* globals FileUploadBase, UploadFS, FileUpload:true */
FileUpload.GridFS = class FileUploadGridFS extends FileUploadBase {
constructor(meta, file, data) {
super(meta, file, data);
constructor(meta, file) {
super(meta, file);
this.handler = new UploadFS.Uploader({
store: Meteor.fileStore,
data: data,
data: file,
file: meta,
onError: (err) => {
var uploading = Session.get('uploading');
@ -37,14 +37,17 @@ FileUpload.GridFS = class FileUploadGridFS extends FileUploadBase {
});
}
});
this.handler.onProgress = (file, progress) => {
this.onProgress(progress);
};
}
start() {
return this.handler.start();
}
getProgress() {
return this.handler.getProgress();
}
onProgress() {}
stop() {
return this.handler.stop();

@ -1,10 +1,10 @@
/* globals FileUpload, fileUploadHandler:true */
/* exported fileUploadHandler */
fileUploadHandler = (meta, file, data) => {
fileUploadHandler = (meta, file) => {
var storageType = RocketChat.settings.get('FileUpload_Storage_Type');
if (FileUpload[storageType] !== undefined) {
return new FileUpload[storageType](meta, file, data);
return new FileUpload[storageType](meta, file);
}
};

@ -2,7 +2,7 @@
/* exported FileUploadBase */
FileUploadBase = class FileUploadBase {
constructor(meta, file/*, data*/) {
constructor(meta, file) {
this.id = Random.id();
this.meta = meta;
this.file = file;

@ -167,8 +167,8 @@ class HubotScripts
scriptFile = s.trim(scriptFile)
Npm.require('hubot-scripts/src/scripts/'+scriptFile)(robot)
# robot.loadFile __meteor_bootstrap__.serverDir+'/npm/rocketchat_internal-hubot/node_modules/hubot-scripts/src/scripts', scriptFile
robot.parseHelp __meteor_bootstrap__.serverDir+'/npm/rocketchat_internal-hubot/node_modules/hubot-scripts/src/scripts/'+scriptFile
# robot.loadFile __meteor_bootstrap__.serverDir+'/npm/node_modules/meteor/rocketchat_internal-hubot/node_modules/hubot-scripts/src/scripts', scriptFile
robot.parseHelp __meteor_bootstrap__.serverDir+'/npm/node_modules/meteor/rocketchat_internal-hubot/node_modules/hubot-scripts/src/scripts/'+scriptFile
console.log "Loaded #{scriptFile}".green
catch e
console.log "can't load #{scriptFile}".red

@ -29,8 +29,8 @@ Package.onUse(function(api) {
});
Npm.depends({
'coffee-script': '1.9.3',
'hubot': '2.13.1',
'hubot-scripts': '2.16.2',
'hubot-help': '0.1.2'
'coffee-script': '1.10.0',
'hubot': '2.19.0',
'hubot-scripts': '2.17.1',
'hubot-help': '0.2.0'
});

@ -60,8 +60,12 @@ Accounts.registerLoginHandler('ldap', function(loginRequest) {
ldap.disconnect();
if (ldapUser === undefined && RocketChat.settings.get('LDAP_Login_Fallback') === true) {
return fallbackDefaultAccountSystem(self, loginRequest.username, loginRequest.ldapPass);
if (ldapUser === undefined) {
if (RocketChat.settings.get('LDAP_Login_Fallback') === true) {
return fallbackDefaultAccountSystem(self, loginRequest.username, loginRequest.ldapPass);
}
throw new Meteor.Error('LDAP-login-error', 'LDAP Authentication failed with provided username ['+loginRequest.username+']');
}
let username;
@ -125,6 +129,7 @@ Accounts.registerLoginHandler('ldap', function(loginRequest) {
}
logger.info('User does not exist, creating', username);
// Create new user
return addLdapUser(ldapUser);
return addLdapUser(ldapUser, username, loginRequest.ldapPass);
});

@ -127,10 +127,12 @@ syncUserData = function syncUserData(user, ldapUser) {
logger.debug('setting', JSON.stringify(userData, null, 2));
}
const username = slug(getLdapUsername(ldapUser));
if (user && user._id && username !== user.username) {
logger.info('Syncing user username', user.username, '->', username);
RocketChat._setUsername(user._id, username);
if (RocketChat.settings.get('LDAP_Username_Field') !== '') {
const username = slug(getLdapUsername(ldapUser));
if (user && user._id && username !== user.username) {
logger.info('Syncing user username', user.username, '->', username);
RocketChat._setUsername(user._id, username);
}
}
if (user && user._id && RocketChat.settings.get('LDAP_Sync_User_Avatar') === true) {
@ -151,8 +153,7 @@ syncUserData = function syncUserData(user, ldapUser) {
}
};
addLdapUser = function addLdapUser(ldapUser) {
const username = slug(getLdapUsername(ldapUser));
addLdapUser = function addLdapUser(ldapUser, username, password) {
var userObject = {
username: username
};
@ -173,6 +174,10 @@ addLdapUser = function addLdapUser(ldapUser) {
logger.debug('New user data', userObject);
if (password) {
userObject.password = password;
}
try {
userObject._id = Accounts.createUser(userObject);
} catch (error) {
@ -204,7 +209,7 @@ sync = function sync() {
const users = RocketChat.models.Users.findLDAPUsers();
if (RocketChat.settings.get('LDAP_Import_Users') === true) {
if (RocketChat.settings.get('LDAP_Import_Users') === true && RocketChat.settings.get('LDAP_Username_Field') !== '') {
const ldapUsers = ldap.searchUsersSync('*');
ldapUsers.forEach(function(ldapUser) {
const username = slug(getLdapUsername(ldapUser));
@ -220,7 +225,7 @@ sync = function sync() {
user = Meteor.users.findOne(userQuery);
if (!user) {
addLdapUser(ldapUser);
addLdapUser(ldapUser, username);
}
});
}

@ -42,6 +42,13 @@ RocketChat.roomTypes = new class roomTypesClient extends roomTypesCommon
return room?.ro is true and Array.isArray(room?.muted) and room?.muted.indexOf(user.username) != -1
archived: (roomId) ->
fields = { archived: 1 }
room = ChatRoom.findOne({ _id: roomId }, fields : fields)
return room?.archived is true
verifyCanSendMessage: (roomId) ->
room = ChatRoom.findOne({ _id: roomId }, { fields: { t: 1 } })
return if not room?.t?

@ -192,14 +192,17 @@ RocketChat.callbacks.add('afterSaveMessage', function(message, room) {
}, {
fields: {
_id: 1,
username: 1
username: 1,
active: 1
}
}).fetch();
if (room.t === 'c' && !toAll) {
const callJoin = function(usersOfMentionItem) {
Meteor.runAsUser(usersOfMentionItem._id, function() {
return Meteor.call('joinRoom', room._id);
});
if (usersOfMentionItem.active) {
Meteor.runAsUser(usersOfMentionItem._id, function() {
return Meteor.call('joinRoom', room._id);
});
}
};
for (i = 0, len = usersOfDesktopMentions.length; i < len; i++) {
usersOfMentionItem = usersOfDesktopMentions[i];

@ -97,7 +97,7 @@ RocketChat.models.Subscriptions = new class extends RocketChat.models._Base
open: false
archived: true
return @update query, update
return @update query, update, { multi: true }
unarchiveByRoomId: (roomId) ->
query =
@ -109,7 +109,7 @@ RocketChat.models.Subscriptions = new class extends RocketChat.models._Base
open: true
archived: false
return @update query, update
return @update query, update, { multi: true }
hideByRoomIdAndUserId: (roomId, userId) ->
query =
@ -307,6 +307,17 @@ RocketChat.models.Subscriptions = new class extends RocketChat.models._Base
return @update query, update
setArchivedByUsername: (username, archived) ->
query =
t: 'd'
name: username
update =
$set:
archived: archived
return @update query, update, { multi: true }
# INSERT
createWithRoomAndUser: (room, user, extraData) ->
subscription =

@ -6,11 +6,11 @@ babel-compiler@6.9.1
babel-runtime@0.1.11
base64@1.0.9
binary-heap@1.0.9
blaze@2.1.8
blaze-tools@1.0.9
blaze@2.1.9
blaze-tools@1.0.10
boilerplate-generator@1.0.9
caching-compiler@1.1.7
caching-html-compiler@1.0.6
caching-html-compiler@1.0.7
callback-hook@1.0.9
cfs:http-methods@0.0.32
check@1.2.3
@ -28,8 +28,8 @@ ejson@1.0.12
email@1.1.17
es5-shim@4.6.14
geojson-utils@1.0.9
html-tools@1.0.10
htmljs@1.0.10
html-tools@1.0.11
htmljs@1.0.11
http@1.2.9
id-map@1.0.8
jquery@1.11.9
@ -70,16 +70,18 @@ service-configuration@1.0.10
session@1.1.6
sha@1.0.8
shell-server@0.2.1
spacebars@1.0.12
spacebars-compiler@1.0.12
spacebars@1.0.13
spacebars-compiler@1.0.13
srp@1.0.9
standard-minifier-css@1.2.0
standard-minifier-js@1.2.0
tap:i18n@1.8.2
templating@1.2.14
templating-tools@1.0.4
templating@1.2.15
templating-compiler@1.2.15
templating-runtime@1.2.15
templating-tools@1.0.5
tracker@1.1.0
ui@1.0.11
ui@1.0.12
underscore@1.0.9
underscorestring:underscore.string@3.3.4
url@1.0.10

@ -1383,6 +1383,10 @@ label.required:after {
&:hover {
text-decoration: none;
}
.archived {
font-style: italic;
}
}
.opt {
position: absolute;
@ -2001,23 +2005,36 @@ label.required:after {
.container-bars {
position: absolute;
top: 60px;
width: 100%;
z-index: 11;
top: 55px;
z-index: 100;
font-weight: bold;
display: flex;
flex-direction: column;
border-radius: 4px;
overflow: hidden;
font-size: 1em;
left: 10px;
right: 10px;
box-shadow: 0px 1px 1px 0 rgba(0,0,0,0.2), 0 2px 10px 0 rgba(0,0,0,.16);
.transition(transform 0.4s ease, visibility 0.3s ease, opacity 0.3s ease);
.transform(translateY(-10px));
opacity: 0;
visibility: hidden;
&.show {
opacity: 1;
visibility: visible;
.transform(translateY(0px));
}
> div {
line-height: 24px;
line-height: 28px;
padding: 0 10px;
border-top: 1px solid;
&:last-child {
box-shadow: 0px 1px 2px rgba(0, 0, 0, .2);
}
}
font-size: 12px;
.upload-progress {
height: 24px;
height: 28px;
position: relative;
.upload-progress-progress {
position: absolute;
@ -2040,6 +2057,11 @@ label.required:after {
cursor: pointer;
}
}
button {
float: right;
font-weight: bold;
text-transform: uppercase;
}
}
.unread-bar {
background-color: #E6F4FD;
@ -2444,30 +2466,38 @@ label.required:after {
&:hover {
background-color: @message-hover-background-color;
}
&.new-day {
margin-top: 60px;
&:before {
content: attr(data-date);
display: block;
position: absolute;
top: -30px;
left: 0;
.day-divider {
height: 50px;
display: none;
text-align: center;
left: 0;
position: absolute;
top: 0px;
right: 0;
align-items: center;
justify-content: center;
span {
padding: 0 8px;
z-index: 1;
border-radius: 4px;
font-size: 12px;
font-weight: 600;
text-align: center;
.calc(left, ~"50% - 70px");
z-index: 10;
padding: 0 10px;
min-width: 140px;
}
&:after {
&:before {
position: absolute;
content: " ";
display: block;
position: absolute;
top: -20px;
border-bottom-width: 1px;
border-bottom-style: solid;
top: 25px;
left: 0;
border-top: 1px solid;
width: 100%;
right: 0;
}
}
&.new-day {
padding-top: 60px;
.day-divider {
display: flex;
}
}
.message-action {
@ -2744,6 +2774,15 @@ body:not(.is-cordova) {
.cozy {
.message {
padding: 4px 20px 4px 70px;
&.new-day {
padding-top: 45px;
.day-divider {
height: 40px;
&:before {
top: 20px;
}
}
}
.body {
margin-top: 0;
}
@ -2754,6 +2793,15 @@ body:not(.is-cordova) {
.message {
min-height: 26px;
padding: 5px 15px 0 37px;
&.new-day {
padding-top: 31px;
.day-divider {
height: 26px;
&:before {
top: 13px;
}
}
}
.body {
display: inline;
.inline-image img {
@ -4095,7 +4143,7 @@ body:not(.is-cordova) {
display: flex;
align-items: center;
justify-content: center;
margin: 0 51px 0 12px;
margin: 0 40px 0 0;
> div {
padding: 40px;
border-radius: 10px;
@ -4108,7 +4156,7 @@ body:not(.is-cordova) {
@media (min-width: 780px) {
.dropzone.over .dropzone-overlay {
margin: 0 51px 0 270px;
margin: 0 40px 0 260px;
}
}
@ -4491,6 +4539,9 @@ body:not(.is-cordova) {
left: 0;
}
}
}
@media all and(max-width: 960px) {
.container-bars {
.unread-bar {
.unread-count {

@ -804,12 +804,15 @@ a.github-fork {
.message {
&.new-day {
&:before {
.day-divider {
color: @secondary-font-color;
background-color: @content-background-color;
}
&:after {
border-top-color: #ddd;
span {
background-color: @content-background-color;
}
&:before {
border-bottom-color: @tertiary-background-color;
}
}
}
.user {
@ -903,11 +906,14 @@ a.github-fork {
}
.message {
&.new-day {
&:before {
.day-divider {
background-color: @secondary-background-color;
}
&:after {
border-top-color: @tertiary-background-color;
span {
background-color: @secondary-background-color;
}
&:before {
border-bottom-color: @tertiary-background-color;
}
}
}
}

@ -41,7 +41,9 @@
</div>
{{/with}}
<nav>
{{> videoButtons}}
{{#if user.active}}
{{> videoButtons}}
{{/if}}
{{#if showAll}}
{{#if canDirectMessage user.username}}

@ -1,5 +1,8 @@
<template name="message">
<li id="{{_id}}" class="message {{isSequential}} {{system}} {{t}} {{own}} {{isTemp}} {{chatops}} {{customClass}}" data-username="{{u.username}}" data-groupable="{{isGroupable}}" data-date="{{date}}" data-timestamp="{{timestamp}}">
<div class="day-divider">
<span>{{date}}</span>
</div>
{{#if avatar}}
{{#if avatarFromUsername}}
<button class="thumb user-card-message" data-username="{{u.username}}" tabindex="1">{{> avatar username=avatarFromUsername}}</button>

@ -31,7 +31,19 @@ Template.messageBox.helpers
subscribed: ->
return RocketChat.roomTypes.verifyCanSendMessage @_id
allowedToSend: ->
return !RocketChat.roomTypes.readOnly @_id, Meteor.user()
if RocketChat.roomTypes.readOnly @_id, Meteor.user()
return false
if RocketChat.roomTypes.archived @_id
return false
roomData = Session.get('roomData' + this._id)
if roomData?.t is 'd'
if ChatSubscription.findOne({ rid: this._id }, { fields: { archived: 1 } })?.archived
return false
return true
getPopupConfig: ->
template = Template.instance()
return {

@ -34,6 +34,9 @@ Template.chatRoomItem.helpers
route: ->
return RocketChat.roomTypes.getRouteLink @t, @
archived: ->
return if this.archived then 'archived'
Template.chatRoomItem.rendered = ->
if not (FlowRouter.getParam('_id')? and FlowRouter.getParam('_id') is this.data.rid) and not this.data.ls and this.data.alert is true
KonchatNotification.newRoom(this.data.rid)
@ -72,6 +75,9 @@ Template.chatRoomItem.events
Meteor.call 'hideRoom', rid, (err) ->
if err
handleError(err)
else
if rid is Session.get('openedRoom')
Session.delete('openedRoom')
'click .leave-room': (e) ->
e.stopPropagation()

@ -5,7 +5,7 @@
<span class="unread">{{unread}}</span>
{{/if}}
<i class="{{roomIcon}} {{userStatus}}" aria-label=""></i>
<span class='name'>{{name}}</span>
<span class='name {{archived}}'>{{name}}</span>
{{#if $not unread}}
<span class='opt'>
<i class="icon-eye-off hide-room" title="{{_ "Hide_room"}}" aria-label="{{_ "Hide_room"}}"></i>

@ -81,61 +81,49 @@ readAsArrayBuffer = (file, callback) ->
if isConfirm isnt true
return
readAsArrayBuffer file.file, (data) ->
record =
name: file.name or file.file.name
size: file.file.size
type: file.file.type
rid: roomId
upload = fileUploadHandler record, file.file, data
# // Reactive method to get upload progress
Tracker.autorun (c) ->
uploading = undefined
cancel = undefined
Tracker.nonreactive ->
cancel = Session.get "uploading-cancel-#{upload.id}"
uploading = Session.get 'uploading'
record =
name: file.name or file.file.name
size: file.file.size
type: file.file.type
rid: roomId
upload = fileUploadHandler record, file.file
if cancel
return c.stop()
upload.onProgress = (progress) ->
uploading = Session.get('uploading') or []
uploading ?= []
item = _.findWhere(uploading, {id: upload.id})
item = _.findWhere(uploading, {id: upload.id})
if not item?
item =
id: upload.id
name: upload.getFileName()
if not item?
item =
id: upload.id
name: upload.getFileName()
uploading.push item
uploading.push item
item.percentage = Math.round(progress * 100) or 0
Session.set 'uploading', uploading
item.percentage = Math.round(upload.getProgress() * 100) or 0
Session.set 'uploading', uploading
upload.start()
upload.start();
Tracker.autorun (c) ->
cancel = Session.get "uploading-cancel-#{upload.id}"
if cancel
upload.stop()
c.stop()
Tracker.autorun (c) ->
cancel = Session.get "uploading-cancel-#{upload.id}"
if cancel
upload.stop()
c.stop()
uploading = Session.get 'uploading'
if uploading?
item = _.findWhere(uploading, {id: upload.id})
if item?
item.percentage = 0
Session.set 'uploading', uploading
Meteor.setTimeout ->
uploading = Session.get 'uploading'
if uploading?
item = _.findWhere(uploading, {id: upload.id})
if item?
item.percentage = 0
Session.set 'uploading', uploading
Meteor.setTimeout ->
uploading = Session.get 'uploading'
if uploading?
item = _.findWhere(uploading, {id: upload.id})
Session.set 'uploading', _.without(uploading, item)
, 1000
Session.set 'uploading', _.without(uploading, item)
, 1000
consume()

@ -89,6 +89,9 @@ Template.room.helpers
return data
containerBarsShow: (unreadData, uploading) ->
return 'show' if (unreadData?.count > 0 and unreadData.since?) or uploading?.length > 0
formatUnreadSince: ->
if not this.since? then return
@ -528,8 +531,7 @@ Template.room.onRendered ->
template = this
containerBars = $('.messages-container > .container-bars')
containerBarsOffset = containerBars.offset()
messageBox = $('.messages-box')
template.isAtBottom = ->
if wrapper.scrollTop >= wrapper.scrollHeight - wrapper.clientHeight
@ -601,12 +603,14 @@ Template.room.onRendered ->
, 50
updateUnreadCount = _.throttle ->
firstMessageOnScreen = document.elementFromPoint(containerBarsOffset.left+1, containerBarsOffset.top+containerBars.height()+1)
if firstMessageOnScreen?.id?
firstMessage = ChatMessage.findOne firstMessageOnScreen.id
if firstMessage?
messageBoxOffset = messageBox.offset()
lastInvisibleMessageOnScreen = document.elementFromPoint(messageBoxOffset.left+1, messageBoxOffset.top+1)
if lastInvisibleMessageOnScreen?.id?
lastMessage = ChatMessage.findOne lastInvisibleMessageOnScreen.id
if lastMessage?
subscription = ChatSubscription.findOne rid: template.data._id
count = ChatMessage.find({rid: template.data._id, ts: {$lt: firstMessage.ts, $gt: subscription?.ls}}).count()
count = ChatMessage.find({rid: template.data._id, ts: {$lte: lastMessage.ts, $gt: subscription?.ls}}).count()
template.unreadCount.set count
else
template.unreadCount.set 0

@ -19,7 +19,7 @@
</h2>
</header>
{{/unless}}
<div class="container-bars">
<div class="container-bars {{containerBarsShow unreadData uploading}}">
{{#with unreadData}}
{{#if since}}
{{#if count}}

@ -38,10 +38,7 @@ Meteor.methods
ts: now
# Make user I have a subcription to this room
RocketChat.models.Subscriptions.upsert
rid: rid
$and: [{'u._id': me._id}] # work around to solve problems with upsert and dot
,
upsertSubscription =
$set:
ts: now
ls: now
@ -54,6 +51,14 @@ Meteor.methods
u:
_id: me._id
username: me.username
if to.active is false
upsertSubscription.$set.archived = true
RocketChat.models.Subscriptions.upsert
rid: rid
$and: [{'u._id': me._id}] # work around to solve problems with upsert and dot
,
upsertSubscription
# Make user the target user has a subcription to this room
RocketChat.models.Subscriptions.upsert

@ -16,13 +16,13 @@ Meteor.methods
if data.username not in (room?.usernames or [])
throw new Meteor.Error 'error-user-not-in-room', 'User is not in this room', { method: 'removeUserFromRoom' }
if RocketChat.authz.hasRole(Meteor.user()._id, 'owner', room._id)
removedUser = RocketChat.models.Users.findOneByUsername data.username
if RocketChat.authz.hasRole(removedUser._id, 'owner', room._id)
numOwners = RocketChat.authz.getUsersInRole('owner', room._id).fetch().length
if numOwners is 1
throw new Meteor.Error 'error-you-are-last-owner', 'You are the last owner. Please set new owner before leaving the room.', { method: 'removeUserFromRoom' }
removedUser = RocketChat.models.Users.findOneByUsername data.username
RocketChat.models.Rooms.removeUsernameById data.rid, data.username
RocketChat.models.Subscriptions.removeByRoomIdAndUserId data.rid, removedUser._id

@ -10,7 +10,10 @@ Meteor.methods
unless RocketChat.authz.hasPermission( Meteor.userId(), 'edit-other-user-active-status') is true
throw new Meteor.Error 'error-not-allowed', 'Not allowed', { method: 'setUserActiveStatus' }
user = RocketChat.models.Users.findOneById userId
RocketChat.models.Users.setUserActive userId, active
RocketChat.models.Subscriptions.setArchivedByUsername user?.username, !active
if active is false
RocketChat.models.Users.unsetLoginTokens userId

@ -8,6 +8,7 @@ Meteor.publish 'fullUserData', (filter, limit) ->
status: 1
utcOffset: 1
type: 1
active: 1
if RocketChat.authz.hasPermission( @userId, 'view-full-other-user-info') is true
fields = _.extend fields,
@ -16,7 +17,6 @@ Meteor.publish 'fullUserData', (filter, limit) ->
statusConnection: 1
createdAt: 1
lastLogin: 1
active: 1
services: 1
requirePasswordChange: 1
requirePasswordChangeReason: 1

@ -1,21 +1,21 @@
Meteor.methods
spotlight: (text, username) ->
if not this.userId?
return {
result =
users: []
rooms: []
}
if not this.userId?
return result
regex = new RegExp s.trim(s.escapeRegExp(text)), "i"
users = RocketChat.models.Users.findByUsername(regex, { limit: 5, fields: { username: 1, status: 1 }, sort: { username: 1 } }).fetch()
if RocketChat.authz.hasPermission this.userId, 'view-d-room'
result.users = RocketChat.models.Users.findByActiveUsersUsernameExcept(text, [ username ], { limit: 5, fields: { username: 1, status: 1 }, sort: { username: 1 } }).fetch()
rooms = RocketChat.models.Rooms.findByNameAndTypeNotContainingUsername(regex, 'c', username, { limit: 5, fields: { t: 1, name: 1 }, sort: { name: 1 } }).fetch()
if RocketChat.authz.hasPermission this.userId, 'view-c-room'
result.rooms = RocketChat.models.Rooms.findByNameAndTypeNotContainingUsername(regex, 'c', username, { limit: 5, fields: { t: 1, name: 1 }, sort: { name: 1 } }).fetch()
return {
users: users
rooms: rooms
}
return result
DDPRateLimiter.addRule
type: 'method'

@ -14,6 +14,7 @@ Meteor.publish 'userData', ->
language: 1
settings: 1
roles: 1
active: 1
defaultRoom: 1
'services.github': 1
'services.gitlab': 1

@ -0,0 +1,8 @@
RocketChat.Migrations.add({
version: 61,
up: function() {
RocketChat.models.Users.find({ active: false }).forEach(function(user) {
RocketChat.models.Subscriptions.setArchivedByUsername(user.username, true);
});
}
});
Loading…
Cancel
Save