diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2020-03-28 19:52:41 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2020-03-28 19:52:41 +0900 |
| commit | f014a79f8dbb101a80d638d025a27bbb5ea02575 (patch) | |
| tree | cc8af5c152e6470cddf1f34d083e2e0e222e7610 /src/server/api/stream/index.ts | |
| parent | Merge branch 'develop' (diff) | |
| parent | 12.27.0 (diff) | |
| download | misskey-f014a79f8dbb101a80d638d025a27bbb5ea02575.tar.gz misskey-f014a79f8dbb101a80d638d025a27bbb5ea02575.tar.bz2 misskey-f014a79f8dbb101a80d638d025a27bbb5ea02575.zip | |
Merge branch 'develop'
Diffstat (limited to 'src/server/api/stream/index.ts')
| -rw-r--r-- | src/server/api/stream/index.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server/api/stream/index.ts b/src/server/api/stream/index.ts index 463ae0a601..05594ac722 100644 --- a/src/server/api/stream/index.ts +++ b/src/server/api/stream/index.ts @@ -7,9 +7,9 @@ import Channel from './channel'; import channels from './channels'; import { EventEmitter } from 'events'; import { User } from '../../../models/entities/user'; -import { App } from '../../../models/entities/app'; import { Users, Followings, Mutings } from '../../../models'; import { ApiError } from '../error'; +import { AccessToken } from '../../../models/entities/access-token'; /** * Main stream connection @@ -18,7 +18,7 @@ export default class Connection { public user?: User; public following: User['id'][] = []; public muting: User['id'][] = []; - public app: App; + public token: AccessToken; private wsConnection: websocket.connection; public subscriber: EventEmitter; private channels: Channel[] = []; @@ -30,12 +30,12 @@ export default class Connection { wsConnection: websocket.connection, subscriber: EventEmitter, user: User | null | undefined, - app: App | null | undefined + token: AccessToken | null | undefined ) { this.wsConnection = wsConnection; this.subscriber = subscriber; if (user) this.user = user; - if (app) this.app = app; + if (token) this.token = token; this.wsConnection.on('message', this.onWsConnectionMessage); @@ -83,7 +83,7 @@ export default class Connection { const endpoint = payload.endpoint || payload.ep; // alias // 呼び出し - call(endpoint, user, this.app, payload.data).then(res => { + call(endpoint, user, this.token, payload.data).then(res => { this.sendMessageToWs(`api:${payload.id}`, { res }); }).catch((e: ApiError) => { this.sendMessageToWs(`api:${payload.id}`, { |