-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from RocketChat/develop
asd
- Loading branch information
Showing
161 changed files
with
4,041 additions
and
3,276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,7 +95,7 @@ mystor:[email protected] | |
nimble:[email protected] | ||
nooitaf:[email protected]_1 | ||
[email protected] | ||
[email protected].11_2 | ||
[email protected].16_1 | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/bash | ||
set -x | ||
|
||
set -euvo pipefail | ||
IFS=$'\n\t' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* globals updateAvatarOfUsername */ | ||
|
||
Meteor.startup(function() { | ||
RocketChat.Notifications.onAll('updateAvatar', function(data) { | ||
RocketChat.Notifications.onLogged('updateAvatar', function(data) { | ||
updateAvatarOfUsername(data.username); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,79 @@ | ||
{ | ||
"name": "Rocket.Chat", | ||
"description": "The Ultimate Open Source WebChat Platform", | ||
"version": "0.49.0-develop", | ||
"author": { | ||
"name": "Rocket.Chat", | ||
"url": "https://rocket.chat/" | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "Aaron Ogle", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Bradley Hilton", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Diego Sampaio", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Gabriel Engel", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Marcelo Schmidt", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Rodrigo Nascimento", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Sing Li", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"keywords": [ | ||
"rocketchat", | ||
"rocket", | ||
"chat" | ||
], | ||
"scripts": { | ||
"start": "meteor npm i && meteor", | ||
"lint": "eslint .", | ||
"stylelint": "stylelint **/*.less", | ||
"test": "node .scripts/start.js", | ||
"deploy": "npm run build && pm2 startOrRestart pm2.json", | ||
"chimp-watch": "chimp --ddp=http://localhost:3000 --watch --mocha --path=tests/steps", | ||
"chimp-test": "chimp tests/chimp-config.js" | ||
}, | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/RocketChat/Rocket.Chat.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/RocketChat/Rocket.Chat/issues", | ||
"email": "[email protected]" | ||
}, | ||
"devDependencies": { | ||
"chimp": "^0.45.1", | ||
"eslint": "^3.12.2", | ||
"stylelint": "^7.7.1", | ||
"supertest": "^2.0.1" | ||
}, | ||
"dependencies": { | ||
"jquery": "^2.1.0", | ||
"babel-runtime": "^6.20.0", | ||
"bcrypt": "^1.0.2", | ||
"moment": "^2.17.1", | ||
"moment-timezone": "^0.5.11", | ||
"toastr": "^2.1.2", | ||
"mime-types": "2.1.13", | ||
"file-type": "4.0.0", | ||
"codemirror": "5.22.0" | ||
} | ||
"name": "Rocket.Chat", | ||
"description": "The Ultimate Open Source WebChat Platform", | ||
"version": "0.50.0-develop", | ||
"author": { | ||
"name": "Rocket.Chat", | ||
"url": "https://rocket.chat/" | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "Aaron Ogle", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Bradley Hilton", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Diego Sampaio", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Gabriel Engel", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Marcelo Schmidt", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Rodrigo Nascimento", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Sing Li", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"keywords": [ | ||
"rocketchat", | ||
"rocket", | ||
"chat" | ||
], | ||
"scripts": { | ||
"start": "meteor npm i && meteor", | ||
"lint": "eslint .", | ||
"stylelint": "stylelint **/*.less", | ||
"test": "node .scripts/start.js", | ||
"deploy": "npm run build && pm2 startOrRestart pm2.json", | ||
"chimp-watch": "chimp --ddp=http://localhost:3000 --watch --mocha --path=tests/steps", | ||
"chimp-test": "chimp tests/chimp-config.js" | ||
}, | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/RocketChat/Rocket.Chat.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/RocketChat/Rocket.Chat/issues", | ||
"email": "[email protected]" | ||
}, | ||
"devDependencies": { | ||
"chimp": "^0.45.1", | ||
"eslint": "^3.13.1", | ||
"stylelint": "^7.7.1", | ||
"supertest": "^2.0.1" | ||
}, | ||
"dependencies": { | ||
"jquery": "^2.1.0", | ||
"babel-runtime": "^6.20.0", | ||
"bcrypt": "^1.0.2", | ||
"moment": "^2.17.1", | ||
"moment-timezone": "^0.5.11", | ||
"toastr": "^2.1.2", | ||
"mime-types": "2.1.13", | ||
"file-type": "4.0.0", | ||
"codemirror": "5.22.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//Action Links namespace creation. | ||
RocketChat.actionLinks = { | ||
actions: {}, | ||
register: function(name, funct) { | ||
RocketChat.actionLinks.actions[name] = funct; | ||
}, | ||
getMessage: function(name, messageId) { | ||
if (!Meteor.userId()) { | ||
throw new Meteor.Error('error-invalid-user', 'Invalid user', { function: 'actionLinks.getMessage' }); | ||
} | ||
|
||
var message = RocketChat.models.Messages.findOne({ _id: messageId }); | ||
if (!message) { | ||
throw new Meteor.Error('error-invalid-message', 'Invalid message', { function: 'actionLinks.getMessage' }); | ||
} | ||
|
||
var room = RocketChat.models.Rooms.findOne({ _id: message.rid }); | ||
if (Array.isArray(room.usernames) && room.usernames.indexOf(Meteor.user().username) === -1) { | ||
throw new Meteor.Error('error-not-allowed', 'Not allowed', { function: 'actionLinks.getMessage' }); | ||
} | ||
|
||
if (!message.actionLinks || !message.actionLinks[name]) { | ||
throw new Meteor.Error('error-invalid-actionlink', 'Invalid action link', { function: 'actionLinks.getMessage' }); | ||
} | ||
|
||
return message; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/rocketchat-action-links/client/lib/actionLinks.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//Action Links Handler. This method will be called off the client. | ||
|
||
RocketChat.actionLinks.run = (name, messageId, instance) => { | ||
var message = RocketChat.actionLinks.getMessage(name, messageId); | ||
|
||
var actionLink = message.actionLinks[name]; | ||
|
||
var ranClient = false; | ||
|
||
if (RocketChat.actionLinks && RocketChat.actionLinks.actions && RocketChat.actionLinks.actions[actionLink.method_id]) { | ||
// run just on client side | ||
RocketChat.actionLinks.actions[actionLink.method_id](message, actionLink.params, instance); | ||
|
||
ranClient = true; | ||
} | ||
|
||
// and run on server side | ||
Meteor.call('actionLinkHandler', name, messageId, (err) => { | ||
if (err && !ranClient) { | ||
handleError(err); | ||
} | ||
}); | ||
}; |
Oops, something went wrong.