summaryrefslogtreecommitdiff
path: root/src/server/api
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2020-02-09 03:49:18 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2020-02-09 03:49:18 +0900
commit390279a4a820e0b9678c2514a0d4cebae6992aa6 (patch)
tree37ff1f74a2adfeb25067a4d637b6d2ed9434f417 /src/server/api
parent非ログイン時に検索欄がズレていたのを修正 (#5883) (diff)
downloadsharkey-390279a4a820e0b9678c2514a0d4cebae6992aa6.tar.gz
sharkey-390279a4a820e0b9678c2514a0d4cebae6992aa6.tar.bz2
sharkey-390279a4a820e0b9678c2514a0d4cebae6992aa6.zip
Fix #5885
Diffstat (limited to 'src/server/api')
-rw-r--r--src/server/api/stream/index.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/server/api/stream/index.ts b/src/server/api/stream/index.ts
index 6ec644a024..463ae0a601 100644
--- a/src/server/api/stream/index.ts
+++ b/src/server/api/stream/index.ts
@@ -60,8 +60,9 @@ export default class Connection {
switch (type) {
case 'api': this.onApiRequest(body); break;
case 'readNotification': this.onReadNotification(body); break;
- case 'subNote': this.onSubscribeNote(body); break;
- case 'sn': this.onSubscribeNote(body); break; // alias
+ case 'subNote': this.onSubscribeNote(body, true); break;
+ case 'sn': this.onSubscribeNote(body, true); break; // alias
+ case 's': this.onSubscribeNote(body, false); break;
case 'unsubNote': this.onUnsubscribeNote(body); break;
case 'un': this.onUnsubscribeNote(body); break; // alias
case 'connect': this.onChannelConnectRequested(body); break;
@@ -107,7 +108,7 @@ export default class Connection {
* 投稿購読要求時
*/
@autobind
- private onSubscribeNote(payload: any) {
+ private onSubscribeNote(payload: any, read: boolean) {
if (!payload.id) return;
if (this.subscribingNotes[payload.id] == null) {
@@ -120,7 +121,7 @@ export default class Connection {
this.subscriber.on(`noteStream:${payload.id}`, this.onNoteStreamMessage);
}
- if (this.user) {
+ if (this.user && read) {
readNote(this.user.id, payload.id);
}
}