mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-12-22 16:30:13 +00:00
Implement #745
This commit is contained in:
parent
631ff6e490
commit
7fe0abc5ce
3 changed files with 16 additions and 0 deletions
|
@ -5,6 +5,7 @@ ChangeLog (Release Notes)
|
|||
unreleased
|
||||
----------
|
||||
* New: 投稿のピン留め (#746)
|
||||
* New: ホームストリームにメッセージを流すことでlast_used_atを更新できるようにする (#745)
|
||||
* その他細かな修正
|
||||
|
||||
2508 (2017/08/30)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -12,6 +12,11 @@ class Connection extends Stream {
|
|||
i: me.token
|
||||
});
|
||||
|
||||
// 最終利用日時を更新するため定期的にaliveメッセージを送信
|
||||
setInterval(() => {
|
||||
this.send({ type: 'alive' });
|
||||
}, 1000 * 60);
|
||||
|
||||
this.on('i_updated', me.update);
|
||||
|
||||
this.on('my_token_regenerated', () => {
|
||||
|
|
Loading…
Reference in a new issue