summaryrefslogtreecommitdiff
path: root/src/server/api/common
diff options
context:
space:
mode:
authorAya Morisawa <AyaMorisawa4869@gmail.com>2018-07-20 14:16:02 +0900
committerAya Morisawa <AyaMorisawa4869@gmail.com>2018-07-20 14:16:02 +0900
commit5d09b7e38b42f19530d51feeeae0e57ad4320351 (patch)
treef0e26bedf307603d87dbee9c7033699466e16b42 /src/server/api/common
parentUpdate README.md (diff)
downloadsharkey-5d09b7e38b42f19530d51feeeae0e57ad4320351.tar.gz
sharkey-5d09b7e38b42f19530d51feeeae0e57ad4320351.tar.bz2
sharkey-5d09b7e38b42f19530d51feeeae0e57ad4320351.zip
mark as read all -> mark all as read
Close #855
Diffstat (limited to 'src/server/api/common')
-rw-r--r--src/server/api/common/read-messaging-message.ts18
-rw-r--r--src/server/api/common/read-notification.ts18
2 files changed, 18 insertions, 18 deletions
diff --git a/src/server/api/common/read-messaging-message.ts b/src/server/api/common/read-messaging-message.ts
index bd5a04f1b0..a34fd8a703 100644
--- a/src/server/api/common/read-messaging-message.ts
+++ b/src/server/api/common/read-messaging-message.ts
@@ -7,7 +7,7 @@ import { publishMessagingIndexStream } from '../../../stream';
import User from '../../../models/user';
/**
- * Mark as read message(s)
+ * Mark messages as read
*/
export default (
user: string | mongo.ObjectID,
@@ -42,12 +42,12 @@ export default (
recipientId: userId,
isRead: false
}, {
- $set: {
- isRead: true
- }
- }, {
- multi: true
- });
+ $set: {
+ isRead: true
+ }
+ }, {
+ multi: true
+ });
// Publish event
publishMessagingStream(otherpartyId, userId, 'read', ids.map(id => id.toString()));
@@ -59,8 +59,8 @@ export default (
recipientId: userId,
isRead: false
}, {
- limit: 1
- });
+ limit: 1
+ });
if (count == 0) {
// Update flag
diff --git a/src/server/api/common/read-notification.ts b/src/server/api/common/read-notification.ts
index fcebad6baa..3a1f4cfbde 100644
--- a/src/server/api/common/read-notification.ts
+++ b/src/server/api/common/read-notification.ts
@@ -5,7 +5,7 @@ import Mute from '../../../models/mute';
import User from '../../../models/user';
/**
- * Mark as read notification(s)
+ * Mark notifications as read
*/
export default (
user: string | mongo.ObjectID,
@@ -38,12 +38,12 @@ export default (
_id: { $in: ids },
isRead: false
}, {
- $set: {
- isRead: true
- }
- }, {
- multi: true
- });
+ $set: {
+ isRead: true
+ }
+ }, {
+ multi: true
+ });
// Calc count of my unread notifications
const count = await Notification
@@ -54,8 +54,8 @@ export default (
},
isRead: false
}, {
- limit: 1
- });
+ limit: 1
+ });
if (count == 0) {
// Update flag