Skip to content

Commit

Permalink
Merge pull request RocketChat#9989 from RocketChat/release-0.62.1
Browse files Browse the repository at this point in the history
Release 0.62.1
  • Loading branch information
rodrigok authored Mar 3, 2018
2 parents 33cf10b + 3dc7f22 commit 6cf49c0
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM rocketchat/base:8

ENV RC_VERSION 0.62.0
ENV RC_VERSION 0.62.1

MAINTAINER [email protected]

Expand Down
2 changes: 1 addition & 1 deletion .sandstorm/sandstorm-pkgdef.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const pkgdef :Spk.PackageDefinition = (

appVersion = 62, # Increment this for every release.

appMarketingVersion = (defaultText = "0.62.0"),
appMarketingVersion = (defaultText = "0.62.1"),
# Human-readable representation of appVersion. Should match the way you
# identify versions of your app in documentation and marketing.

Expand Down
2 changes: 1 addition & 1 deletion .travis/snap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ elif [[ $TRAVIS_TAG ]]; then
RC_VERSION=$TRAVIS_TAG
else
CHANNEL=edge
RC_VERSION=0.62.0
RC_VERSION=0.62.1
fi

echo "Preparing to trigger a snap release for $CHANNEL channel"
Expand Down
13 changes: 13 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
<a name="0.62.1"></a>
## 0.62.1 (2018-03-03)


### Bug Fixes

- [#9986](https://github.com/RocketChat/Rocket.Chat/pull/9986) Delete user without username was removing direct rooms of all users
- [#9960](https://github.com/RocketChat/Rocket.Chat/pull/9960) Empty sidenav when sorting by activity and there is a subscription without room
- [#9988](https://github.com/RocketChat/Rocket.Chat/pull/9988) New channel page on medium size screens
- [#9982](https://github.com/RocketChat/Rocket.Chat/pull/9982) Two factor authentication modal was not showing



<a name="0.62.0"></a>
# 0.62.0 (2018-02-28)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Rocket.Chat",
"description": "The Ultimate Open Source WebChat Platform",
"version": "0.62.0",
"version": "0.62.1",
"author": {
"name": "Rocket.Chat",
"url": "https://rocket.chat/"
Expand Down
7 changes: 7 additions & 0 deletions packages/rocketchat-cors/cors.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@ import _ from 'underscore';

import url from 'url';

import { Mongo } from 'meteor/mongo';
import tls from 'tls';
// FIX For TLS error see more here https://github.com/RocketChat/Rocket.Chat/issues/9316
// TODO: Remove after NodeJS fix it, more information https://github.com/nodejs/node/issues/16196 https://github.com/nodejs/node/pull/16853
tls.DEFAULT_ECDH_CURVE = 'auto';

// Revert change from Meteor 1.6.1 who set ignoreUndefined: true
// more information https://github.com/meteor/meteor/pull/9444
Mongo.setConnectionOptions({
ignoreUndefined: false
});

WebApp.rawConnectHandlers.use(Meteor.bindEnvironment(function(req, res, next) {
if (req._body) {
return next();
Expand Down
3 changes: 2 additions & 1 deletion packages/rocketchat-cors/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Package.describe({
Package.onUse(function(api) {
api.use([
'ecmascript',
'webapp'
'webapp',
'mongo'
]);

api.addFiles('cors.js', 'server');
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-lib/client/lib/cachedCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class CachedCollection {
useSync = true,
useCache = true,
debug = false,
version = 6,
version = 7,
maxCacheTime = 60*60*24*30,
onSyncData = (/* action, record */) => {}
}) {
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-lib/rocketchat.info
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.62.0"
"version": "0.62.1"
}
43 changes: 23 additions & 20 deletions packages/rocketchat-lib/server/functions/deleteUser.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
RocketChat.deleteUser = function(userId) {
const user = RocketChat.models.Users.findOneById(userId);

RocketChat.models.Messages.removeByUserId(userId); // Remove user messages
RocketChat.models.Subscriptions.db.findByUserId(userId).forEach((subscription) => {
const room = RocketChat.models.Rooms.findOneById(subscription.rid);
if (room) {
if (room.t !== 'c' && room.usernames.length === 1) {
RocketChat.models.Rooms.removeById(subscription.rid); // Remove non-channel rooms with only 1 user (the one being deleted)
// Users without username can't do anything, so there is nothing to remove
if (user.username != null) {
RocketChat.models.Messages.removeByUserId(userId); // Remove user messages
RocketChat.models.Subscriptions.db.findByUserId(userId).forEach((subscription) => {
const room = RocketChat.models.Rooms.findOneById(subscription.rid);
if (room) {
if (room.t !== 'c' && room.usernames.length === 1) {
RocketChat.models.Rooms.removeById(subscription.rid); // Remove non-channel rooms with only 1 user (the one being deleted)
}
if (room.t === 'd') {
RocketChat.models.Subscriptions.removeByRoomId(subscription.rid);
RocketChat.models.Messages.removeByRoomId(subscription.rid);
}
}
if (room.t === 'd') {
RocketChat.models.Subscriptions.removeByRoomId(subscription.rid);
RocketChat.models.Messages.removeByRoomId(subscription.rid);
}
}
});
});

RocketChat.models.Subscriptions.removeByUserId(userId); // Remove user subscriptions
RocketChat.models.Rooms.removeByTypeContainingUsername('d', user.username); // Remove direct rooms with the user
RocketChat.models.Rooms.removeUsernameFromAll(user.username); // Remove user from all other rooms
RocketChat.models.Subscriptions.removeByUserId(userId); // Remove user subscriptions
RocketChat.models.Rooms.removeByTypeContainingUsername('d', user.username); // Remove direct rooms with the user
RocketChat.models.Rooms.removeUsernameFromAll(user.username); // Remove user from all other rooms

// removes user's avatar
if (user.avatarOrigin === 'upload' || user.avatarOrigin === 'url') {
FileUpload.getStore('Avatars').deleteByName(user.username);
}
// removes user's avatar
if (user.avatarOrigin === 'upload' || user.avatarOrigin === 'url') {
FileUpload.getStore('Avatars').deleteByName(user.username);
}

RocketChat.models.Integrations.disableByUserId(userId); // Disables all the integrations which rely on the user being deleted.
RocketChat.models.Integrations.disableByUserId(userId); // Disables all the integrations which rely on the user being deleted.
}

RocketChat.models.Users.removeById(userId); // Remove user from users database
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
width: 1vw;

height: 100%;

position: relative;
}

.messages-container .room-icon {
Expand Down
2 changes: 0 additions & 2 deletions packages/rocketchat-theme/client/imports/general/base_old.css
Original file line number Diff line number Diff line change
Expand Up @@ -4558,8 +4558,6 @@ body:not(.is-cordova) {
}

.rc-old.full-page {
z-index: 101;

display: flex;

width: 100%;
Expand Down
24 changes: 7 additions & 17 deletions packages/rocketchat-ui-sidenav/client/roomList.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,15 @@ Template.roomList.helpers({
}

if (sortBy === 'activity') {
const list = ChatSubscription.find(query, {sort: {rid : 1}}).fetch();
const ids = list.map(sub => sub.rid);
const rooms = RocketChat.models.Rooms.find({
_id: { $in : ids}
},
{
sort : {
_id: 1
},
fields: {_updatedAt: 1}
}).fetch();


return _.sortBy(list.map((sub, i) => {
const lm = rooms[i]._updatedAt;
const list = ChatSubscription.find(query).fetch();
RocketChat.models.Rooms.find();
const rooms = RocketChat.models.Rooms._collection._docs._map;

return _.sortBy(list.map(sub => {
const lm = rooms[sub.rid] && rooms[sub.rid]._updatedAt;
return {
...sub,
lm: lm && lm.toISOString()
lm: lm && lm.toISOString && lm.toISOString()
};
}), 'lm').reverse();
}
Expand Down Expand Up @@ -124,4 +115,3 @@ Template.roomList.helpers({
return RocketChat.getUserPreference(Meteor.user(), 'roomCounterSidebar');
}
});

0 comments on commit 6cf49c0

Please sign in to comment.