Skip to content

Commit

Permalink
Merge branch 'develop' into fix/audio-message
Browse files Browse the repository at this point in the history
  • Loading branch information
tassoevan committed Mar 8, 2019
2 parents ace849c + b93b31b commit 776c501
Show file tree
Hide file tree
Showing 862 changed files with 17,432 additions and 9,994 deletions.
12 changes: 1 addition & 11 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,8 @@
"globals": {
"__meteor_bootstrap__" : false,
"__meteor_runtime_config__" : false,
"Apps" : false,
"Assets" : false,
"chrome" : false,
"DynamicCss" : false,
"handleError" : false,
"getAvatarSuggestionForUser" : false,
"JitsiMeetExternalAPI" : false,
"jscolor" : false,
"msgStream" : false,
"openRoom" : false,
"RocketChat" : true,
"roomExit" : true,
"Settings" : false
"jscolor" : false
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,5 @@ settings.json
build.sh
/public/livechat
packages/rocketchat-i18n/i18n/livechat.*
tests/end-to-end/temporary_staged_test
.screenshots
8 changes: 5 additions & 3 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.

rocketchat:mongo-config
rocketchat:cors

accounts-facebook@1.3.2
Expand All @@ -16,7 +17,7 @@ check@1.3.1
ddp-rate-limiter@1.0.7
ddp-common@1.4.0
dynamic-import@0.5.0
ecmascript@0.12.3
ecmascript@0.12.4
ejson@1.1.0
email@1.2.3
fastclick@1.0.13
Expand Down Expand Up @@ -63,6 +64,7 @@ rocketchat:emoji-custom
rocketchat:emoji-emojione
rocketchat:error-handler
rocketchat:favico
rocketchat:federation
rocketchat:file
rocketchat:file-upload
rocketchat:github-enterprise
Expand Down Expand Up @@ -186,7 +188,6 @@ rocketchat:push
raix:ui-dropped-event
steffo:meteor-accounts-saml
todda00:friendly-slugs
yasaricli:slugify
yasinuslu:blaze-meta
rocketchat:e2e

Expand All @@ -196,6 +197,7 @@ rocketchat:search
chatpal:search
rocketchat:lazy-load
tap:i18n
assistify:threading
underscore@1.0.10
rocketchat:bigbluebutton
rocketchat:mailmessages
Expand All @@ -209,4 +211,4 @@ rocketchat:callbacks
rocketchat:notifications
rocketchat:promises
rocketchat:ui-utils
rocketchat:ui-cached-collection
rocketchat:ui-cached-collection
2 changes: 1 addition & 1 deletion .meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
METEOR@1.8.0.1
METEOR@1.8.0.2
12 changes: 7 additions & 5 deletions .meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ accounts-password@1.5.1
accounts-twitter@1.4.2
aldeed:simple-schema@1.5.4
allow-deny@1.1.0
assistify:threading@0.1.0
autoupdate@1.5.0
babel-compiler@7.2.3
babel-compiler@7.2.4
babel-runtime@1.3.0
base64@1.0.11
binary-heap@1.0.11
Expand All @@ -35,7 +36,7 @@ deps@1.0.12
diff-sequence@1.1.1
dispatch:run-as-user@1.1.1
dynamic-import@0.5.1
ecmascript@0.12.3
ecmascript@0.12.4
ecmascript-runtime@0.7.0
ecmascript-runtime-client@0.8.0
ecmascript-runtime-server@0.7.1
Expand Down Expand Up @@ -117,7 +118,7 @@ ordered-dict@1.1.0
ostrio:cookies@2.3.0
pauli:accounts-linkedin@2.1.5
pauli:linkedin-oauth@1.2.0
promise@0.11.1
promise@0.11.2
raix:eventemitter@0.1.3
raix:eventstate@0.0.4
raix:handlebar-helpers@0.2.5
Expand Down Expand Up @@ -159,6 +160,7 @@ rocketchat:emoji-custom@1.0.0
rocketchat:emoji-emojione@0.0.1
rocketchat:error-handler@1.0.0
rocketchat:favico@0.0.1
rocketchat:federation@0.0.1
rocketchat:file@0.0.1
rocketchat:file-upload@0.0.1
rocketchat:github-enterprise@0.0.1
Expand Down Expand Up @@ -193,7 +195,6 @@ rocketchat:mailer@0.0.1
rocketchat:mailmessages@0.0.1
rocketchat:mapview@0.0.1
rocketchat:markdown@0.0.2
rocketchat:metrics@0.0.1
rocketchat:mentions@0.0.1
rocketchat:mentions-flextab@0.0.1
rocketchat:message-action@0.0.1
Expand All @@ -202,8 +203,10 @@ rocketchat:message-mark-as-unread@0.0.1
rocketchat:message-pin@0.0.1
rocketchat:message-snippet@0.0.1
rocketchat:message-star@0.0.1
rocketchat:metrics@0.0.1
rocketchat:migrations@0.0.1
rocketchat:models@1.0.0
rocketchat:mongo-config@0.0.1
rocketchat:monitoring@2.30.2_3
rocketchat:notifications@0.0.1
rocketchat:nrr@1.0.0
Expand Down Expand Up @@ -293,5 +296,4 @@ underscore@1.0.10
url@1.2.0
webapp@1.7.2
webapp-hashing@1.0.9
yasaricli:slugify@0.0.7
yasinuslu:blaze-meta@0.3.3
6 changes: 6 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"version": "0.2.0",
"configurations": [

{
"name": "Attach to meteor debug",
"type": "node",
Expand All @@ -13,6 +14,7 @@
"meteor://💻app/*": "${workspaceFolder}/*",
"meteor://💻app/packages/rocketchat:*": "${workspaceFolder}/packages/rocketchat-*",
"meteor://💻app/packages/chatpal:*": "${workspaceFolder}/packages/chatpal-*",
"meteor://💻app/packages/assistify:*": "${workspaceFolder}/packages/assistify-*"
},
"protocol": "inspector"
},
Expand All @@ -26,6 +28,7 @@
"meteor://💻app/*": "${workspaceFolder}/*",
"meteor://💻app/packages/rocketchat:*": "${workspaceFolder}/packages/rocketchat-*",
"meteor://💻app/packages/chatpal:*": "${workspaceFolder}/packages/chatpal-*",
"meteor://💻app/packages/assistify:*": "${workspaceFolder}/packages/assistify-*"
}
},
{
Expand All @@ -43,6 +46,7 @@
"meteor://💻app/*": "${workspaceFolder}/*",
"meteor://💻app/packages/rocketchat:*": "${workspaceFolder}/packages/rocketchat-*",
"meteor://💻app/packages/chatpal:*": "${workspaceFolder}/packages/chatpal-*",
"meteor://💻app/packages/assistify:*": "${workspaceFolder}/packages/assistify-*"
},
"protocol": "inspector"
},
Expand All @@ -61,6 +65,7 @@
"meteor://💻app/*": "${workspaceFolder}/*",
"meteor://💻app/packages/rocketchat:*": "${workspaceFolder}/packages/rocketchat-*",
"meteor://💻app/packages/chatpal:*": "${workspaceFolder}/packages/chatpal-*",
"meteor://💻app/packages/assistify:*": "${workspaceFolder}/packages/assistify-*"
},
"protocol": "inspector"
},
Expand All @@ -79,6 +84,7 @@
"meteor://💻app/*": "${workspaceFolder}/*",
"meteor://💻app/packages/rocketchat:*": "${workspaceFolder}/packages/rocketchat-*",
"meteor://💻app/packages/chatpal:*": "${workspaceFolder}/packages/chatpal-*",
"meteor://💻app/packages/assistify:*": "${workspaceFolder}/packages/assistify-*"
},
"env": {
"TEST_MODE": "true"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Host your own Rocket.Chat server for **FREE** with [One-Click Deploy](https://he
[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/RocketChat/Rocket.Chat/tree/master)

## Helm Kubernetes
Deploy on Kubernetes using the official [helm chart](https://github.com/kubernetes/charts/pull/752).
Deploy on Kubernetes using the official [helm chart](https://github.com/helm/charts/tree/master/stable/rocketchat).

## Scalingo
Deploy your own Rocket.Chat server instantly on [Scalingo](https://scalingo.com).
Expand Down
21 changes: 21 additions & 0 deletions client/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="expires" content="-1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="fragment" content="!" />
<meta name="distribution" content="global" />
<meta name="rating" content="general" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="msapplication-TileImage" content="assets/tile_144.png" />
<meta name="msapplication-config" content="images/browserconfig.xml" />
<meta property="og:image" content="assets/favicon_512.png" />
<meta property="twitter:image" content="assets/favicon_512.png" />
<link rel="manifest" href="images/manifest.json" />
<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/nocfbnnmjnndkbipkabodnheejiegccf" />
<link rel="mask-icon" href="assets/safari_pinned.svg" color="#04436a">
<link rel="apple-touch-icon" sizes="180x180" href="assets/touchicon_180.png" />
<link rel="apple-touch-icon-precomposed" href="assets/touchicon_180_pre.png" />
</head>
32 changes: 31 additions & 1 deletion client/main.js
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
import '/imports/startup/client';
import '../imports/startup/client';

import '../lib/RegExp';
import '../lib/francocatena_fix';

import './lib/toastr';
import './helpers/escapeCssUrl';
import './helpers/log';
import './helpers/not';
import './methods/deleteMessage';
import './methods/hideRoom';
import './methods/openRoom';
import './methods/setUserActiveStatus';
import './methods/toggleFavorite';
import './methods/updateMessage';
import './notifications/notification';
import './notifications/updateAvatar';
import './notifications/updateUserState';
import './notifications/UsersNameChanged';
import './routes/adminRouter';
import './routes/pageNotFound.html';
import './routes/roomRoute';
import './routes/router';
import './startup/emailVerification';
import './startup/i18n';
import './startup/loginViaQuery';
import './startup/roomObserve';
import './startup/startup';
import './startup/unread';
import './startup/userSetUtcOffset';
import './startup/usersObserve';
10 changes: 6 additions & 4 deletions client/methods/deleteMessage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';
import { ChatMessage } from 'meteor/rocketchat:models';
import { hasAtLeastOnePermission } from 'meteor/rocketchat:authorization';
import { settings } from 'meteor/rocketchat:settings';
import _ from 'underscore';
import moment from 'moment';

Expand All @@ -13,9 +15,9 @@ Meteor.methods({
// We're now only passed in the `_id` property to lower the amount of data sent to the server
message = ChatMessage.findOne({ _id: message._id });

const hasPermission = RocketChat.authz.hasAtLeastOnePermission('delete-message', message.rid);
const forceDelete = RocketChat.authz.hasAtLeastOnePermission('force-delete-message', message.rid);
const deleteAllowed = RocketChat.settings.get('Message_AllowDeleting');
const hasPermission = hasAtLeastOnePermission('delete-message', message.rid);
const forceDelete = hasAtLeastOnePermission('force-delete-message', message.rid);
const deleteAllowed = settings.get('Message_AllowDeleting');
let deleteOwn = false;

if (message && message.u && message.u._id) {
Expand All @@ -24,7 +26,7 @@ Meteor.methods({
if (!(forceDelete || hasPermission || (deleteAllowed && deleteOwn))) {
return false;
}
const blockDeleteInMinutes = RocketChat.settings.get('Message_AllowDeleting_BlockDeleteInMinutes');
const blockDeleteInMinutes = settings.get('Message_AllowDeleting_BlockDeleteInMinutes');
if (!forceDelete && _.isNumber(blockDeleteInMinutes) && blockDeleteInMinutes !== 0) {
const msgTs = moment(message.ts);
const currentTsDiff = moment().diff(msgTs, 'minutes');
Expand Down
11 changes: 7 additions & 4 deletions client/methods/updateMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { Tracker } from 'meteor/tracker';
import { TimeSync } from 'meteor/mizzao:timesync';
import { t } from 'meteor/rocketchat:utils';
import { ChatMessage } from 'meteor/rocketchat:models';
import { hasAtLeastOnePermission } from 'meteor/rocketchat:authorization';
import { settings } from 'meteor/rocketchat:settings';
import { callbacks } from 'meteor/rocketchat:callbacks';
import _ from 'underscore';
import moment from 'moment';
import toastr from 'toastr';
Expand All @@ -15,8 +18,8 @@ Meteor.methods({

const originalMessage = ChatMessage.findOne(message._id);

const hasPermission = RocketChat.authz.hasAtLeastOnePermission('edit-message', message.rid);
const editAllowed = RocketChat.settings.get('Message_AllowEditing');
const hasPermission = hasAtLeastOnePermission('edit-message', message.rid);
const editAllowed = settings.get('Message_AllowEditing');
let editOwn = false;
if (originalMessage.msg === message.msg) {
return;
Expand All @@ -32,7 +35,7 @@ Meteor.methods({
return false;
}

const blockEditInMinutes = RocketChat.settings.get('Message_AllowEditing_BlockEditInMinutes');
const blockEditInMinutes = settings.get('Message_AllowEditing_BlockEditInMinutes');
if (_.isNumber(blockEditInMinutes) && blockEditInMinutes !== 0) {
if (originalMessage.ts) {
const msgTs = moment(originalMessage.ts);
Expand All @@ -59,7 +62,7 @@ Meteor.methods({
username: me.username,
};

message = RocketChat.callbacks.run('beforeSaveMessage', message);
message = callbacks.run('beforeSaveMessage', message);
const messageObject = { editedAt: message.editedAt, editedBy: message.editedBy, msg: message.msg };

if (originalMessage.attachments) {
Expand Down
10 changes: 6 additions & 4 deletions client/notifications/UsersNameChanged.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Meteor } from 'meteor/meteor';
import { Notifications } from 'meteor/rocketchat:notifications';
import { Messages, Subscriptions } from 'meteor/rocketchat:models';

Meteor.startup(function() {
RocketChat.Notifications.onLogged('Users:NameChanged', function({ _id, name, username }) {
RocketChat.models.Messages.update({
Notifications.onLogged('Users:NameChanged', function({ _id, name, username }) {
Messages.update({
'u._id': _id,
}, {
$set: {
Expand All @@ -12,7 +14,7 @@ Meteor.startup(function() {
multi: true,
});

RocketChat.models.Messages.update({
Messages.update({
mentions: {
$elemMatch: { _id },
},
Expand All @@ -24,7 +26,7 @@ Meteor.startup(function() {
multi: true,
});

RocketChat.models.Subscriptions.update({
Subscriptions.update({
name: username,
t: 'd',
}, {
Expand Down
Loading

0 comments on commit 776c501

Please sign in to comment.