Skip to content

Commit

Permalink
Merge pull request #14823 from RocketChat/release-1.1.2
Browse files Browse the repository at this point in the history
Release 1.1.2
  • Loading branch information
sampaiodiego committed Jun 18, 2019
2 parents 80341ed + a505fc5 commit aece97e
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .docker/Dockerfile.rhel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM registry.access.redhat.com/rhscl/nodejs-8-rhel7

ENV RC_VERSION 1.1.1
ENV RC_VERSION 1.1.2

MAINTAINER buildmaster@rocket.chat

Expand Down
42 changes: 42 additions & 0 deletions .github/history.json
Original file line number Diff line number Diff line change
Expand Up @@ -31841,6 +31841,48 @@
]
}
]
},
"1.1.2": {
"node_version": "8.11.4",
"npm_version": "6.4.1",
"mongo_versions": [
"3.2",
"3.4",
"3.6",
"4.0"
],
"pull_requests": [
{
"pr": "14763",
"title": "[FIX] User status information on User Info panel",
"userLogin": "MarcosSpessatto",
"milestone": "1.1.2",
"contributors": [
"MarcosSpessatto"
]
},
{
"pr": "14711",
"title": "[FIX] User Real Name being erased when not modified",
"userLogin": "Hudell",
"milestone": "1.1.2",
"contributors": [
"Hudell"
]
},
{
"pr": "14717",
"title": "[FIX] Anonymous chat read",
"userLogin": "sampaiodiego",
"milestone": "1.1.2",
"contributors": [
"sampaiodiego",
"ggazzo",
"MarcosSpessatto",
"web-flow"
]
}
]
}
}
}
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=1.1.1
RC_VERSION=1.1.2
fi

echo "Preparing to trigger a snap release for $CHANNEL channel"
Expand Down
21 changes: 21 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@

# 1.1.2
`2019-06-17 · 3 🐛 · 4 👩‍💻👨‍💻`

### Engine versions
- Node: `8.11.4`
- NPM: `6.4.1`
- MongoDB: `3.2, 3.4, 3.6, 4.0`

### 🐛 Bug fixes

- User status information on User Info panel ([#14763](https://github.com/RocketChat/Rocket.Chat/pull/14763))
- User Real Name being erased when not modified ([#14711](https://github.com/RocketChat/Rocket.Chat/pull/14711))
- Anonymous chat read ([#14717](https://github.com/RocketChat/Rocket.Chat/pull/14717))

### 👩‍💻👨‍💻 Core Team 🤓

- [@Hudell](https://github.com/Hudell)
- [@MarcosSpessatto](https://github.com/MarcosSpessatto)
- [@ggazzo](https://github.com/ggazzo)
- [@sampaiodiego](https://github.com/sampaiodiego)

# 1.1.1
`2019-05-30 · 2 🐛 · 1 🔍 · 3 👩‍💻👨‍💻`

Expand Down
2 changes: 1 addition & 1 deletion app/emoji/client/emojiPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const getEmojiElement = (emoji, image) => image && `<li class="emoji-${ emoji }

const createEmojiList = (category, actualTone) => {
const html = Object.values(emoji.packages).map((emojiPackage) => {
if (!emojiPackage.emojisByCategory[category]) {
if (!emojiPackage.emojisByCategory || !emojiPackage.emojisByCategory[category]) {
return;
}

Expand Down
4 changes: 3 additions & 1 deletion app/lib/server/functions/saveUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ export const saveUser = function(userId, userData) {
setUsername(userData._id, userData.username);
}

setRealName(userData._id, userData.name);
if (userData.hasOwnProperty('name')) {
setRealName(userData._id, userData.name);
}

if (userData.email) {
const shouldSendVerificationEmailToUser = userData.verified !== true;
Expand Down
4 changes: 0 additions & 4 deletions app/lib/server/methods/getSingleMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ Meteor.methods({
getSingleMessage(msgId) {
check(msgId, String);

if (!Meteor.userId()) {
throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'getSingleMessage' });
}

const msg = Messages.findOneById(msgId);

if (!msg || !msg.rid) {
Expand Down
2 changes: 1 addition & 1 deletion app/ui-flextab/client/tabs/userInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Template.userInfo.helpers({
userStatus() {
const user = Template.instance().user.get();
const userStatus = Session.get(`user_${ user.username }_status`);
return userStatus;
return userStatus || 'offline';
},

email() {
Expand Down
4 changes: 2 additions & 2 deletions app/ui-master/client/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Template.main.helpers({
hasUsername() {
const uid = Meteor.userId();
const user = uid && Users.findOne({ _id: uid }, { fields: { username: 1 } });
return (user && user.username) || settings.get('Accounts_AllowAnonymousRead');
return (user && user.username) || (!uid && settings.get('Accounts_AllowAnonymousRead'));
},
requirePasswordChange() {
const user = Meteor.user();
Expand All @@ -194,7 +194,7 @@ Template.main.helpers({
const user = Meteor.user();

// User is already using 2fa
if (user.services.totp !== undefined && user.services.totp.enabled) {
if (!user || (user.services.totp !== undefined && user.services.totp.enabled)) {
return false;
}

Expand Down
3 changes: 3 additions & 0 deletions app/ui-sidenav/client/roomList.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ Template.roomList.helpers({

noSubscriptionText() {
const instance = Template.instance();
if (instance.data.anonymous) {
return 'No_channels_yet';
}
return roomTypes.roomTypes[instance.data.identifier].getUiText(UiTextContext.NO_ROOMS_SUBSCRIBED) || 'No_channels_yet';
},

Expand Down
4 changes: 1 addition & 3 deletions app/ui-sidenav/client/sidebarItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ Template.sidebarItem.onCreated(function() {
this.lastMessageTs = new ReactiveVar();
this.timeAgoInterval;

// console.log('sidebarItem.onCreated');

this.autorun(() => {
const currentData = Template.currentData();

Expand All @@ -98,7 +96,7 @@ Template.sidebarItem.onCreated(function() {

const otherUser = settings.get('UI_Use_Real_Name') ? currentData.lastMessage.u.name || currentData.lastMessage.u.username : currentData.lastMessage.u.username;
const renderedMessage = renderMessageBody(currentData.lastMessage).replace(/<br\s?\\?>/g, ' ');
const sender = this.user._id === currentData.lastMessage.u._id ? t('You') : otherUser;
const sender = this.user && this.user._id === currentData.lastMessage.u._id ? t('You') : otherUser;

if (currentData.t === 'd' && Meteor.userId() !== currentData.lastMessage.u._id) {
this.renderedMessage = currentData.lastMessage.msg === '' ? t('Sent_an_attachment') : renderedMessage;
Expand Down
2 changes: 1 addition & 1 deletion app/ui-utils/client/lib/messageContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { AutoTranslate } from '../../../autotranslate/client';
export function messageContext({ rid } = Template.instance()) {
const uid = Meteor.userId();
return {
u: Users.findOne({ _id: uid }, { fields: { name: 1, username: 1 } }),
u: Users.findOne({ _id: uid }, { fields: { name: 1, username: 1 } }) || {},
room: Rooms.findOne({ _id: rid }, {
reactive: false,
fields: {
Expand Down
2 changes: 1 addition & 1 deletion app/utils/rocketchat.info
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.1.1"
"version": "1.1.2"
}
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": "1.1.1",
"version": "1.1.2",
"author": {
"name": "Rocket.Chat",
"url": "https://rocket.chat/"
Expand Down
10 changes: 9 additions & 1 deletion server/methods/browseChannels.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import s from 'underscore.string';
import { hasPermission } from '../../app/authorization';
import { Rooms, Users } from '../../app/models';
import { Federation } from '../../app/federation/server';
import { settings } from '../../app/settings/server';

const sortChannels = function(field, direction) {
switch (field) {
Expand Down Expand Up @@ -57,11 +58,13 @@ Meteor.methods({
limit,
};

const canViewAnonymous = settings.get('Accounts_AllowAnonymousRead') === true;

const user = Meteor.user();

if (type === 'channels') {
const sort = sortChannels(sortBy, sortDirection);
if (!hasPermission(user._id, 'view-c-room')) {
if ((!user && !canViewAnonymous) || (user && !hasPermission(user._id, 'view-c-room'))) {
return;
}

Expand All @@ -85,6 +88,11 @@ Meteor.methods({
};
}

// non-logged id user
if (!user) {
return;
}

// type === users
if (!hasPermission(user._id, 'view-outside-room') || !hasPermission(user._id, 'view-d-room')) {
return;
Expand Down

0 comments on commit aece97e

Please sign in to comment.