summaryrefslogtreecommitdiff
path: root/src/client/app/common/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/app/common/scripts')
-rw-r--r--src/client/app/common/scripts/check-for-update.ts4
-rw-r--r--src/client/app/common/scripts/streaming/channel.ts2
-rw-r--r--src/client/app/common/scripts/streaming/drive.ts2
-rw-r--r--src/client/app/common/scripts/streaming/global-timeline.ts2
-rw-r--r--src/client/app/common/scripts/streaming/home.ts25
-rw-r--r--src/client/app/common/scripts/streaming/local-timeline.ts2
-rw-r--r--src/client/app/common/scripts/streaming/messaging-index.ts2
-rw-r--r--src/client/app/common/scripts/streaming/messaging.ts2
-rw-r--r--src/client/app/common/scripts/streaming/othello-game.ts2
-rw-r--r--src/client/app/common/scripts/streaming/othello.ts2
-rw-r--r--src/client/app/common/scripts/streaming/server.ts2
-rw-r--r--src/client/app/common/scripts/streaming/stream.ts2
-rw-r--r--src/client/app/common/scripts/streaming/user-list.ts17
13 files changed, 52 insertions, 14 deletions
diff --git a/src/client/app/common/scripts/check-for-update.ts b/src/client/app/common/scripts/check-for-update.ts
index 20ce64ea85..1e303017eb 100644
--- a/src/client/app/common/scripts/check-for-update.ts
+++ b/src/client/app/common/scripts/check-for-update.ts
@@ -1,9 +1,9 @@
-import MiOS from '../mios';
+import MiOS from '../../mios';
import { version as current } from '../../config';
export default async function(mios: MiOS, force = false, silent = false) {
const meta = await mios.getMeta(force);
- const newer = meta.version;
+ const newer = meta.clientVersion;
if (newer != current) {
localStorage.setItem('should-refresh', 'true');
diff --git a/src/client/app/common/scripts/streaming/channel.ts b/src/client/app/common/scripts/streaming/channel.ts
index cab5f4edb4..be68ec0997 100644
--- a/src/client/app/common/scripts/streaming/channel.ts
+++ b/src/client/app/common/scripts/streaming/channel.ts
@@ -1,5 +1,5 @@
import Stream from './stream';
-import MiOS from '../../mios';
+import MiOS from '../../../mios';
/**
* Channel stream connection
diff --git a/src/client/app/common/scripts/streaming/drive.ts b/src/client/app/common/scripts/streaming/drive.ts
index 7ff85b5946..50fff05737 100644
--- a/src/client/app/common/scripts/streaming/drive.ts
+++ b/src/client/app/common/scripts/streaming/drive.ts
@@ -1,6 +1,6 @@
import Stream from './stream';
import StreamManager from './stream-manager';
-import MiOS from '../../mios';
+import MiOS from '../../../mios';
/**
* Drive stream connection
diff --git a/src/client/app/common/scripts/streaming/global-timeline.ts b/src/client/app/common/scripts/streaming/global-timeline.ts
index 452ddbac03..a639f1595c 100644
--- a/src/client/app/common/scripts/streaming/global-timeline.ts
+++ b/src/client/app/common/scripts/streaming/global-timeline.ts
@@ -1,6 +1,6 @@
import Stream from './stream';
import StreamManager from './stream-manager';
-import MiOS from '../../mios';
+import MiOS from '../../../mios';
/**
* Global timeline stream connection
diff --git a/src/client/app/common/scripts/streaming/home.ts b/src/client/app/common/scripts/streaming/home.ts
index 73f2c5302c..32685f3c2c 100644
--- a/src/client/app/common/scripts/streaming/home.ts
+++ b/src/client/app/common/scripts/streaming/home.ts
@@ -2,7 +2,7 @@ import * as merge from 'object-assign-deep';
import Stream from './stream';
import StreamManager from './stream-manager';
-import MiOS from '../../mios';
+import MiOS from '../../../mios';
/**
* Home stream connection
@@ -25,10 +25,31 @@ export class HomeStream extends Stream {
console.log('I updated:', i);
}
merge(me, i);
+
+ // キャッシュ更新
+ os.bakeMe();
+ });
+
+ this.on('clientSettingUpdated', x => {
+ os.store.commit('settings/set', {
+ key: x.key,
+ value: x.value
+ });
+ });
+
+ this.on('home_updated', x => {
+ if (x.home) {
+ os.store.commit('settings/setHome', x.home);
+ } else {
+ os.store.commit('settings/setHomeWidget', {
+ id: x.id,
+ data: x.data
+ });
+ }
});
// トークンが再生成されたとき
- // このままではAPIが利用できないので強制的にサインアウトさせる
+ // このままではMisskeyが利用できないので強制的にサインアウトさせる
this.on('my_token_regenerated', () => {
alert('%i18n:!common.my-token-regenerated%');
os.signout();
diff --git a/src/client/app/common/scripts/streaming/local-timeline.ts b/src/client/app/common/scripts/streaming/local-timeline.ts
index 3d04e05cd4..2834262bdc 100644
--- a/src/client/app/common/scripts/streaming/local-timeline.ts
+++ b/src/client/app/common/scripts/streaming/local-timeline.ts
@@ -1,6 +1,6 @@
import Stream from './stream';
import StreamManager from './stream-manager';
-import MiOS from '../../mios';
+import MiOS from '../../../mios';
/**
* Local timeline stream connection
diff --git a/src/client/app/common/scripts/streaming/messaging-index.ts b/src/client/app/common/scripts/streaming/messaging-index.ts
index 84e2174ec4..addcccb952 100644
--- a/src/client/app/common/scripts/streaming/messaging-index.ts
+++ b/src/client/app/common/scripts/streaming/messaging-index.ts
@@ -1,6 +1,6 @@
import Stream from './stream';
import StreamManager from './stream-manager';
-import MiOS from '../../mios';
+import MiOS from '../../../mios';
/**
* Messaging index stream connection
diff --git a/src/client/app/common/scripts/streaming/messaging.ts b/src/client/app/common/scripts/streaming/messaging.ts
index c1b5875cfb..a59377d867 100644
--- a/src/client/app/common/scripts/streaming/messaging.ts
+++ b/src/client/app/common/scripts/streaming/messaging.ts
@@ -1,5 +1,5 @@
import Stream from './stream';
-import MiOS from '../../mios';
+import MiOS from '../../../mios';
/**
* Messaging stream connection
diff --git a/src/client/app/common/scripts/streaming/othello-game.ts b/src/client/app/common/scripts/streaming/othello-game.ts
index b85af8f72b..9e36f647bb 100644
--- a/src/client/app/common/scripts/streaming/othello-game.ts
+++ b/src/client/app/common/scripts/streaming/othello-game.ts
@@ -1,5 +1,5 @@
import Stream from './stream';
-import MiOS from '../../mios';
+import MiOS from '../../../mios';
export class OthelloGameStream extends Stream {
constructor(os: MiOS, me, game) {
diff --git a/src/client/app/common/scripts/streaming/othello.ts b/src/client/app/common/scripts/streaming/othello.ts
index f5d47431cd..8f4f217e39 100644
--- a/src/client/app/common/scripts/streaming/othello.ts
+++ b/src/client/app/common/scripts/streaming/othello.ts
@@ -1,6 +1,6 @@
import StreamManager from './stream-manager';
import Stream from './stream';
-import MiOS from '../../mios';
+import MiOS from '../../../mios';
export class OthelloStream extends Stream {
constructor(os: MiOS, me) {
diff --git a/src/client/app/common/scripts/streaming/server.ts b/src/client/app/common/scripts/streaming/server.ts
index 3d35ef4d9d..2ea4239288 100644
--- a/src/client/app/common/scripts/streaming/server.ts
+++ b/src/client/app/common/scripts/streaming/server.ts
@@ -1,6 +1,6 @@
import Stream from './stream';
import StreamManager from './stream-manager';
-import MiOS from '../../mios';
+import MiOS from '../../../mios';
/**
* Server stream connection
diff --git a/src/client/app/common/scripts/streaming/stream.ts b/src/client/app/common/scripts/streaming/stream.ts
index 3912186ad3..fefa8e5ced 100644
--- a/src/client/app/common/scripts/streaming/stream.ts
+++ b/src/client/app/common/scripts/streaming/stream.ts
@@ -2,7 +2,7 @@ import { EventEmitter } from 'eventemitter3';
import * as uuid from 'uuid';
import * as ReconnectingWebsocket from 'reconnecting-websocket';
import { wsUrl } from '../../../config';
-import MiOS from '../../mios';
+import MiOS from '../../../mios';
/**
* Misskey stream connection
diff --git a/src/client/app/common/scripts/streaming/user-list.ts b/src/client/app/common/scripts/streaming/user-list.ts
new file mode 100644
index 0000000000..30a52b98dd
--- /dev/null
+++ b/src/client/app/common/scripts/streaming/user-list.ts
@@ -0,0 +1,17 @@
+import Stream from './stream';
+import MiOS from '../../mios';
+
+export class UserListStream extends Stream {
+ constructor(os: MiOS, me, listId) {
+ super(os, 'user-list', {
+ i: me.token,
+ listId
+ });
+
+ (this as any).on('_connected_', () => {
+ this.send({
+ i: me.token
+ });
+ });
+ }
+}