From 7fe0abc5cec71759807a41f383606dd156f11d88 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 30 Aug 2017 17:45:23 +0900 Subject: Implement #745 --- src/api/stream/home.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/api') diff --git a/src/api/stream/home.ts b/src/api/stream/home.ts index 2ab8d3025b..d5fe01c261 100644 --- a/src/api/stream/home.ts +++ b/src/api/stream/home.ts @@ -2,6 +2,7 @@ import * as websocket from 'websocket'; import * as redis from 'redis'; import * as debug from 'debug'; +import User from '../models/user'; import serializePost from '../serializers/post'; const log = debug('misskey'); @@ -35,6 +36,15 @@ export default function homeStream(request: websocket.request, connection: webso const msg = JSON.parse(data.utf8Data); switch (msg.type) { + case 'alive': + // Update lastUsedAt + User.update({ _id: user._id }, { + $set: { + last_used_at: new Date() + } + }); + break; + case 'capture': if (!msg.id) return; const postId = msg.id; -- cgit v1.2.3-freya