Skip to content

Commit 6a4f474

Browse files
authored
Merge pull request #18867 from RocketChat/release-3.6.1
Release 3.6.1
2 parents 94cb30f + c8c01bd commit 6a4f474

File tree

21 files changed

+190
-45
lines changed

21 files changed

+190
-45
lines changed

.docker/Dockerfile.rhel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM registry.access.redhat.com/rhscl/nodejs-8-rhel7
22

3-
ENV RC_VERSION 3.6.0
3+
ENV RC_VERSION 3.6.1
44

55
66

.github/history.json

Lines changed: 78 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15363,14 +15363,6 @@
1536315363
]
1536415364
},
1536515365
"HEAD": {
15366-
"node_version": "12.16.1",
15367-
"npm_version": "6.14.0",
15368-
"apps_engine_version": "1.17.0",
15369-
"mongo_versions": [
15370-
"3.4",
15371-
"3.6",
15372-
"4.0"
15373-
],
1537415366
"pull_requests": []
1537515367
},
1537615368
"0.66.0-rc.0": {
@@ -48026,8 +48018,8 @@
4802648018
]
4802748019
}
4802848020
]
48029-
},
48030-
"3.6.0-rc.0": {
48021+
},
48022+
"3.6.0-rc.0": {
4803148023
"node_version": "12.16.1",
4803248024
"npm_version": "6.14.0",
4803348025
"apps_engine_version": "1.17.0-beta.3629",
@@ -49197,6 +49189,81 @@
4919749189
]
4919849190
}
4919949191
]
49192+
},
49193+
"3.6.1": {
49194+
"node_version": "12.16.1",
49195+
"npm_version": "6.14.0",
49196+
"apps_engine_version": "1.17.0",
49197+
"mongo_versions": [
49198+
"3.4",
49199+
"3.6",
49200+
"4.0"
49201+
],
49202+
"pull_requests": [
49203+
{
49204+
"pr": "18862",
49205+
"title": "[FIX] Showing alerts during setup wizard",
49206+
"userLogin": "sampaiodiego",
49207+
"milestone": "3.6.1",
49208+
"contributors": [
49209+
"sampaiodiego"
49210+
]
49211+
},
49212+
{
49213+
"pr": "18852",
49214+
"title": "[FIX] User can't invite or join other Omnichannel rooms",
49215+
"userLogin": "renatobecker",
49216+
"milestone": "3.6.1",
49217+
"contributors": [
49218+
"renatobecker"
49219+
]
49220+
},
49221+
{
49222+
"pr": "18851",
49223+
"title": "[FIX] User administration throwing a blank page if user has no role",
49224+
"userLogin": "ggazzo",
49225+
"milestone": "3.6.1",
49226+
"contributors": [
49227+
"ggazzo"
49228+
]
49229+
},
49230+
{
49231+
"pr": "18850",
49232+
"title": "[FIX] IE11 support livechat widget",
49233+
"userLogin": "ggazzo",
49234+
"milestone": "3.6.1",
49235+
"contributors": [
49236+
"ggazzo"
49237+
]
49238+
},
49239+
{
49240+
"pr": "18841",
49241+
"title": "[FIX] File upload (Avatars, Emoji, Sounds)",
49242+
"userLogin": "ggazzo",
49243+
"milestone": "3.6.1",
49244+
"contributors": [
49245+
"ggazzo"
49246+
]
49247+
},
49248+
{
49249+
"pr": "18835",
49250+
"title": "[FIX][ENTERPRISE] Omnichannel service status switching to unavailable",
49251+
"userLogin": "renatobecker",
49252+
"milestone": "3.6.1",
49253+
"contributors": [
49254+
"renatobecker"
49255+
]
49256+
},
49257+
{
49258+
"pr": "18795",
49259+
"title": "[FIX] Omnichannel Current Chats open status filter not working",
49260+
"userLogin": "renatobecker",
49261+
"milestone": "3.6.1",
49262+
"contributors": [
49263+
"renatobecker"
49264+
]
49265+
}
49266+
]
4920049267
}
4920149268
}
49202-
}
49269+
}

.snapcraft/resources/prepareRocketChat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
curl -SLf "https://releases.rocket.chat/3.6.0/download/" -o rocket.chat.tgz
3+
curl -SLf "https://releases.rocket.chat/3.6.1/download/" -o rocket.chat.tgz
44

55
tar xf rocket.chat.tgz --strip 1
66

.snapcraft/snap/snapcraft.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# 5. `snapcraft snap`
88

99
name: rocketchat-server
10-
version: 3.6.0
10+
version: 3.6.1
1111
summary: Rocket.Chat server
1212
description: Have your own Slack like online chat, built with Meteor. https://rocket.chat/
1313
confinement: strict

HISTORY.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,36 @@
11

2+
# 3.6.1
3+
`2020-09-11 · 7 🐛 · 3 👩‍💻👨‍💻`
4+
5+
### Engine versions
6+
- Node: `12.16.1`
7+
- NPM: `6.14.0`
8+
- MongoDB: `3.4, 3.6, 4.0`
9+
- Apps-Engine: `1.17.0`
10+
11+
### 🐛 Bug fixes
12+
13+
14+
- **ENTERPRISE:** Omnichannel service status switching to unavailable ([#18835](https://github.com/RocketChat/Rocket.Chat/pull/18835))
15+
16+
- File upload (Avatars, Emoji, Sounds) ([#18841](https://github.com/RocketChat/Rocket.Chat/pull/18841))
17+
18+
- IE11 support livechat widget ([#18850](https://github.com/RocketChat/Rocket.Chat/pull/18850))
19+
20+
- Omnichannel Current Chats open status filter not working ([#18795](https://github.com/RocketChat/Rocket.Chat/pull/18795))
21+
22+
- Showing alerts during setup wizard ([#18862](https://github.com/RocketChat/Rocket.Chat/pull/18862))
23+
24+
- User administration throwing a blank page if user has no role ([#18851](https://github.com/RocketChat/Rocket.Chat/pull/18851))
25+
26+
- User can't invite or join other Omnichannel rooms ([#18852](https://github.com/RocketChat/Rocket.Chat/pull/18852))
27+
28+
### 👩‍💻👨‍💻 Core Team 🤓
29+
30+
- [@ggazzo](https://github.com/ggazzo)
31+
- [@renatobecker](https://github.com/renatobecker)
32+
- [@sampaiodiego](https://github.com/sampaiodiego)
33+
234
# 3.6.0
335
`2020-08-29 · 10 🎉 · 5 🚀 · 26 🐛 · 36 🔍 · 23 👩‍💻👨‍💻`
436

app/2fa/server/code/index.ts

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export function getUserForCheck(userId: string): IUser {
4343
fields: {
4444
emails: 1,
4545
language: 1,
46+
createdAt: 1,
4647
'services.totp': 1,
4748
'services.email2fa': 1,
4849
'services.emailCode': 1,
@@ -61,6 +62,19 @@ export function getFingerprintFromConnection(connection: IMethodConnection): str
6162
return crypto.createHash('md5').update(data).digest('hex');
6263
}
6364

65+
function getRememberDate(from: Date = new Date()): Date | undefined {
66+
const rememberFor = parseInt(settings.get('Accounts_TwoFactorAuthentication_RememberFor') as string, 10);
67+
68+
if (rememberFor <= 0) {
69+
return;
70+
}
71+
72+
const expires = new Date(from);
73+
expires.setSeconds(expires.getSeconds() + rememberFor);
74+
75+
return expires;
76+
}
77+
6478
export function isAuthorizedForToken(connection: IMethodConnection, user: IUser, options: ITwoFactorOptions): boolean {
6579
const currentToken = Accounts._getLoginToken(connection.id);
6680
const tokenObject = user.services?.resume?.loginTokens?.find((i) => i.hashedToken === currentToken);
@@ -77,6 +91,12 @@ export function isAuthorizedForToken(connection: IMethodConnection, user: IUser,
7791
return false;
7892
}
7993

94+
// remember user right after their registration
95+
const rememberAfterRegistration = user.createdAt && getRememberDate(user.createdAt);
96+
if (rememberAfterRegistration && rememberAfterRegistration >= new Date()) {
97+
return true;
98+
}
99+
80100
if (!tokenObject.twoFactorAuthorizedUntil || !tokenObject.twoFactorAuthorizedHash) {
81101
return false;
82102
}
@@ -95,15 +115,11 @@ export function isAuthorizedForToken(connection: IMethodConnection, user: IUser,
95115
export function rememberAuthorization(connection: IMethodConnection, user: IUser): void {
96116
const currentToken = Accounts._getLoginToken(connection.id);
97117

98-
const rememberFor = parseInt(settings.get('Accounts_TwoFactorAuthentication_RememberFor') as string, 10);
99-
100-
if (rememberFor <= 0) {
118+
const expires = getRememberDate();
119+
if (!expires) {
101120
return;
102121
}
103122

104-
const expires = new Date();
105-
expires.setSeconds(expires.getSeconds() + rememberFor);
106-
107123
Users.setTwoFactorAuthorizationHashAndUntilForUserIdAndToken(user._id, currentToken, getFingerprintFromConnection(connection), expires);
108124
}
109125

app/lib/server/functions/addUserToRoom.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const addUserToRoom = function(rid, user, inviter, silenced) {
3131
throw error;
3232
}
3333

34-
if (room.t === 'c' || room.t === 'p') {
34+
if (room.t === 'c' || room.t === 'p' || room.t === 'l') {
3535
// Add a new event, with an optional inviter
3636
callbacks.run('beforeAddedToRoom', { user, inviter }, room);
3737

app/lib/server/startup/settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2679,7 +2679,7 @@ settings.addGroup('Setup_Wizard', function() {
26792679
this.add('Allow_Marketing_Emails', true, {
26802680
type: 'boolean',
26812681
});
2682-
this.add('Register_Server', true, {
2682+
this.add('Register_Server', false, {
26832683
type: 'boolean',
26842684
});
26852685
this.add('Organization_Email', '', {

app/livechat/lib/LivechatRoomType.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { ChatRoom } from '../../models';
55
import { settings } from '../../settings';
66
import { hasPermission } from '../../authorization';
77
import { openRoom } from '../../ui-utils';
8-
import { RoomSettingsEnum, UiTextContext, RoomTypeRouteConfig, RoomTypeConfig } from '../../utils';
8+
import { RoomMemberActions, RoomSettingsEnum, UiTextContext, RoomTypeRouteConfig, RoomTypeConfig } from '../../utils';
99
import { getAvatarURL } from '../../utils/lib/getAvatarURL';
1010

1111
let LivechatInquiry;
@@ -85,6 +85,10 @@ export default class LivechatRoomType extends RoomTypeConfig {
8585
}
8686
}
8787

88+
allowMemberAction(room, action) {
89+
return [RoomMemberActions.INVITE, RoomMemberActions.JOIN].includes(action);
90+
}
91+
8892
getUiText(context) {
8993
switch (context) {
9094
case UiTextContext.HIDE_WARNING:

app/livechat/server/startup.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ Meteor.startup(async () => {
8383
}));
8484
}, callbacks.priority.LOW, 'cant-leave-room');
8585

86+
callbacks.add('beforeJoinRoom', function(user, room) {
87+
if (room.t === 'l' && !hasPermission(user._id, 'view-l-room')) {
88+
throw new Meteor.Error('error-user-is-not-agent', 'User is not an Omnichannel Agent', { method: 'beforeJoinRoom' });
89+
}
90+
91+
return user;
92+
}, callbacks.priority.LOW, 'cant-join-room');
93+
8694
createLivechatQueueView();
8795

8896
const monitor = new LivechatAgentActivityMonitor();

0 commit comments

Comments
 (0)