Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
tibetsprague committed Nov 23, 2022
2 parents f26eda6 + 69f0a0c commit 70f0867
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [5.0.3] - 2022-11-23

### Fixed
- Don't send emails or push notifications for Announcements when notifications are turned off in a group
- Bug that prevented saving group settings sometimes

## [5.0.2] - 2022-11-13

### Added
Expand Down
6 changes: 4 additions & 2 deletions api/models/Activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,13 @@ module.exports = bookshelf.Model.extend({
const emailable = membershipsPermitting('sendEmail')
const pushable = membershipsPermitting('sendPushNotifications')

if ((!isEmpty(emailable) && !isJustNewPost(activity)) || isAnnouncement(activity)) {
// Send emails if email notifications on and is announcement or "not just a new post" notification
if (!isEmpty(emailable) && (!isJustNewPost(activity) || isAnnouncement(activity))) {
notifications.push(Notification.MEDIUM.Email)
}

if (isTopic(activity) || !isEmpty(pushable) || isAnnouncement(activity)) {
// XXX: right now all notification types get sent as a push notification. Is this what we want?
if (!isEmpty(pushable)) {
notifications.push(Notification.MEDIUM.Push)
}

Expand Down
2 changes: 1 addition & 1 deletion api/models/mixins/HasSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
this.set('settings', merge({}, this.get('settings'), value))
if (save) {
const options = { patch: true }
if (transacting) settings['transacting'] = transacting
if (transacting) options['transacting'] = transacting
return this.save({settings: this.get('settings')}, options)
}
return this
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "Tibet Sprague <[email protected]>",
"license": "GNU AFFERO GENERAL PUBLIC LICENSE v3",
"private": true,
"version": "5.0.2",
"version": "5.0.3",
"repository": {
"type": "git",
"url": "git://github.com/Hylozoic/hylo-node.git"
Expand Down

0 comments on commit 70f0867

Please sign in to comment.