summaryrefslogtreecommitdiff
path: root/src/client/app/common/scripts/streaming/home.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2018-10-07 11:06:17 +0900
committerGitHub <noreply@github.com>2018-10-07 11:06:17 +0900
commitd0570d7fe3a3bf3c6b0312dece74bacc04c3534a (patch)
tree698218279a38f9c78b0350e81b8ac77ae52e4a0d /src/client/app/common/scripts/streaming/home.ts
parentFix お知らせが確認中...のままになる(Announcement Fetching...) (... (diff)
downloadmisskey-d0570d7fe3a3bf3c6b0312dece74bacc04c3534a.tar.gz
misskey-d0570d7fe3a3bf3c6b0312dece74bacc04c3534a.tar.bz2
misskey-d0570d7fe3a3bf3c6b0312dece74bacc04c3534a.zip
V10 (#2826)
* wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * Update CHANGELOG.md * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * Update CHANGELOG.md * Update CHANGELOG.md * wip * Update CHANGELOG.md * wip * wip * wip * wip
Diffstat (limited to 'src/client/app/common/scripts/streaming/home.ts')
-rw-r--r--src/client/app/common/scripts/streaming/home.ts126
1 files changed, 0 insertions, 126 deletions
diff --git a/src/client/app/common/scripts/streaming/home.ts b/src/client/app/common/scripts/streaming/home.ts
deleted file mode 100644
index 26729507fb..0000000000
--- a/src/client/app/common/scripts/streaming/home.ts
+++ /dev/null
@@ -1,126 +0,0 @@
-import Stream from './stream';
-import StreamManager from './stream-manager';
-import MiOS from '../../../mios';
-
-/**
- * Home stream connection
- */
-export class HomeStream extends Stream {
- constructor(os: MiOS, me) {
- super(os, '', {
- i: me.token
- });
-
- // 最終利用日時を更新するため定期的にaliveメッセージを送信
- setInterval(() => {
- this.send({ type: 'alive' });
- me.lastUsedAt = new Date();
- }, 1000 * 60);
-
- // 自分の情報が更新されたとき
- this.on('meUpdated', i => {
- if (os.debug) {
- console.log('I updated:', i);
- }
-
- os.store.dispatch('mergeMe', i);
- });
-
- this.on('read_all_notifications', () => {
- os.store.dispatch('mergeMe', {
- hasUnreadNotification: false
- });
- });
-
- this.on('unread_notification', () => {
- os.store.dispatch('mergeMe', {
- hasUnreadNotification: true
- });
- });
-
- this.on('read_all_messaging_messages', () => {
- os.store.dispatch('mergeMe', {
- hasUnreadMessagingMessage: false
- });
- });
-
- this.on('unread_messaging_message', () => {
- os.store.dispatch('mergeMe', {
- hasUnreadMessagingMessage: true
- });
- });
-
- this.on('unreadMention', () => {
- os.store.dispatch('mergeMe', {
- hasUnreadMentions: true
- });
- });
-
- this.on('readAllUnreadMentions', () => {
- os.store.dispatch('mergeMe', {
- hasUnreadMentions: false
- });
- });
-
- this.on('unreadSpecifiedNote', () => {
- os.store.dispatch('mergeMe', {
- hasUnreadSpecifiedNotes: true
- });
- });
-
- this.on('readAllUnreadSpecifiedNotes', () => {
- os.store.dispatch('mergeMe', {
- hasUnreadSpecifiedNotes: false
- });
- });
-
- this.on('clientSettingUpdated', x => {
- os.store.commit('settings/set', {
- key: x.key,
- value: x.value
- });
- });
-
- this.on('home_updated', x => {
- os.store.commit('settings/setHome', x);
- });
-
- this.on('mobile_home_updated', x => {
- os.store.commit('settings/setMobileHome', x);
- });
-
- this.on('widgetUpdated', x => {
- os.store.commit('settings/setWidget', {
- id: x.id,
- data: x.data
- });
- });
-
- // トークンが再生成されたとき
- // このままではMisskeyが利用できないので強制的にサインアウトさせる
- this.on('my_token_regenerated', () => {
- alert('%i18n:common.my-token-regenerated%');
- os.signout();
- });
- }
-}
-
-export class HomeStreamManager extends StreamManager<HomeStream> {
- private me;
- private os: MiOS;
-
- constructor(os: MiOS, me) {
- super();
-
- this.me = me;
- this.os = os;
- }
-
- public getConnection() {
- if (this.connection == null) {
- this.connection = new HomeStream(this.os, this.me);
- }
-
- return this.connection;
- }
-}