Skip to content

Commit

Permalink
Merge pull request #17158 from RocketChat/release-3.0.12
Browse files Browse the repository at this point in the history
Release 3.0.12
  • Loading branch information
sampaiodiego authored Apr 3, 2020
2 parents 5fbbc7d + 07ca30a commit 15ac767
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 8 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 3.0.11
ENV RC_VERSION 3.0.12

MAINTAINER [email protected]

Expand Down
29 changes: 29 additions & 0 deletions .github/history.json
Original file line number Diff line number Diff line change
Expand Up @@ -40243,6 +40243,35 @@
]
}
]
},
"3.0.12": {
"node_version": "12.14.0",
"npm_version": "6.13.4",
"mongo_versions": [
"3.4",
"3.6",
"4.0"
],
"pull_requests": [
{
"pr": "17155",
"title": "Fix: Missing checks for Troubleshoot > Disable Notifications",
"userLogin": "rodrigok",
"milestone": "3.0.12",
"contributors": [
"rodrigok"
]
},
{
"pr": "17152",
"title": "Fix: Error message on startup of multiple instances related to the metrics’ server",
"userLogin": "rodrigok",
"milestone": "3.0.12",
"contributors": [
"rodrigok"
]
}
]
}
}
}
22 changes: 22 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@

# 3.0.12
`2020-04-03 · 2 🔍 · 1 👩‍💻👨‍💻`

### Engine versions
- Node: `12.14.0`
- NPM: `6.13.4`
- MongoDB: `3.4, 3.6, 4.0`

<details>
<summary>🔍 Minor changes</summary>


- Fix: Missing checks for Troubleshoot > Disable Notifications ([#17155](https://github.com/RocketChat/Rocket.Chat/pull/17155))

- Fix: Error message on startup of multiple instances related to the metrics’ server ([#17152](https://github.com/RocketChat/Rocket.Chat/pull/17152))

</details>

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

- [@rodrigok](https://github.com/rodrigok)

# 3.0.11
`2020-04-02 · 2 🐛 · 1 🔍 · 2 👩‍💻👨‍💻`

Expand Down
9 changes: 7 additions & 2 deletions app/lib/server/functions/notifications/audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ export function shouldNotifyAudio({
return false;
}

if (!audioNotifications && settings.get('Accounts_Default_User_Preferences_audioNotifications') === 'all') {
return true;
if (!audioNotifications) {
if (settings.get('Accounts_Default_User_Preferences_audioNotifications') === 'all') {
return true;
}
if (settings.get('Accounts_Default_User_Preferences_audioNotifications') === 'nothing') {
return false;
}
}

return roomType === 'd' || (!disableAllMessageNotifications && (hasMentionToAll || hasMentionToHere)) || isHighlighted || audioNotifications === 'all' || hasMentionToUser || hasReplyToThread;
Expand Down
15 changes: 14 additions & 1 deletion app/lib/server/lib/sendNotificationsOnMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { sendSinglePush, shouldNotifyMobile } from '../functions/notifications/m
import { notifyDesktopUser, shouldNotifyDesktop } from '../functions/notifications/desktop';
import { notifyAudioUser, shouldNotifyAudio } from '../functions/notifications/audio';

let TroubleshootDisableNotifications;

export const sendNotification = async ({
subscription,
sender,
Expand All @@ -24,6 +26,10 @@ export const sendNotification = async ({
mentionIds,
disableAllMessageNotifications,
}) => {
if (TroubleshootDisableNotifications === true) {
return;
}

// don't notify the sender
if (subscription.u._id === sender._id) {
return;
Expand Down Expand Up @@ -187,6 +193,10 @@ const lookup = {
};

export async function sendMessageNotifications(message, room, usersInThread = []) {
if (TroubleshootDisableNotifications === true) {
return;
}

const sender = roomTypes.getConfig(room.t).getMsgSender(message.u._id);
if (!sender) {
return message;
Expand Down Expand Up @@ -287,6 +297,10 @@ export async function sendMessageNotifications(message, room, usersInThread = []
}

export async function sendAllNotifications(message, room) {
if (TroubleshootDisableNotifications === true) {
return;
}

// threads
if (message.tmid) {
return message;
Expand Down Expand Up @@ -353,7 +367,6 @@ export async function sendAllNotifications(message, room) {
return message;
}

let TroubleshootDisableNotifications;
settings.get('Troubleshoot_Disable_Notifications', (key, value) => {
if (TroubleshootDisableNotifications === value) { return; }
TroubleshootDisableNotifications = value;
Expand Down
11 changes: 9 additions & 2 deletions app/metrics/server/lib/metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,18 @@ const oplogMetric = ({ collection, op }) => {
};

let timer;
let wasEnabled = false;
const updatePrometheusConfig = async () => {
const port = process.env.PROMETHEUS_PORT || settings.get('Prometheus_Port');
const enabled = settings.get('Prometheus_Enabled');
const enabled = Boolean(port && settings.get('Prometheus_Enabled'));

if (!port || !enabled) {
if (wasEnabled === enabled) {
return;
}

wasEnabled = enabled;

if (!enabled) {
server.close();
Meteor.clearInterval(timer);
oplogEvents.removeListener('record', oplogMetric);
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": "3.0.11"
"version": "3.0.12"
}
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": "3.0.11",
"version": "3.0.12",
"author": {
"name": "Rocket.Chat",
"url": "https://rocket.chat/"
Expand Down

0 comments on commit 15ac767

Please sign in to comment.