summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-10-13 19:16:47 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-10-13 19:16:47 +0900
commit3aef5e6748777b821e8bcb3ad58410ac52b848e2 (patch)
treed0e1c57ecd8de78a774b1b51a5e5732b23f0fb8a /src
parentconnectedイベントはpongパラメータがtrueの時だけ発行するよ... (diff)
downloadmisskey-3aef5e6748777b821e8bcb3ad58410ac52b848e2.tar.gz
misskey-3aef5e6748777b821e8bcb3ad58410ac52b848e2.tar.bz2
misskey-3aef5e6748777b821e8bcb3ad58410ac52b848e2.zip
Better id
Diffstat (limited to 'src')
-rw-r--r--src/client/app/boot.js2
-rw-r--r--src/client/app/common/scripts/stream.ts4
-rw-r--r--src/client/app/common/views/widgets/posts-monitor.vue2
-rw-r--r--src/client/app/mios.ts2
-rw-r--r--src/server/api/streaming.ts4
5 files changed, 7 insertions, 7 deletions
diff --git a/src/client/app/boot.js b/src/client/app/boot.js
index 6e06a88aa3..063749caee 100644
--- a/src/client/app/boot.js
+++ b/src/client/app/boot.js
@@ -142,7 +142,7 @@
localStorage.setItem('shouldFlush', 'false');
// Random
- localStorage.setItem('salt', Math.random().toString());
+ localStorage.setItem('salt', Math.random().toString().substr(2, 8));
// Clear cache (service worker)
try {
diff --git a/src/client/app/common/scripts/stream.ts b/src/client/app/common/scripts/stream.ts
index 7456c0b074..70180bc5b7 100644
--- a/src/client/app/common/scripts/stream.ts
+++ b/src/client/app/common/scripts/stream.ts
@@ -156,7 +156,7 @@ class Pool {
this.channel = channel;
this.stream = stream;
- this.id = Math.random().toString();
+ this.id = Math.random().toString().substr(2, 8);
this.stream.on('_disconnected_', this.onStreamDisconnected);
}
@@ -275,7 +275,7 @@ class NonSharedConnection extends Connection {
super(stream, channel);
this.params = params;
- this.id = Math.random().toString();
+ this.id = Math.random().toString().substr(2, 8);
this.connect();
}
diff --git a/src/client/app/common/views/widgets/posts-monitor.vue b/src/client/app/common/views/widgets/posts-monitor.vue
index cb307715d8..c62533d1ee 100644
--- a/src/client/app/common/views/widgets/posts-monitor.vue
+++ b/src/client/app/common/views/widgets/posts-monitor.vue
@@ -114,7 +114,7 @@ export default define({
this.connection.on('stats', this.onStats);
this.connection.on('statsLog', this.onStatsLog);
this.connection.send('requestLog',{
- id: Math.random().toString()
+ id: Math.random().toString().substr(2, 8)
});
},
beforeDestroy() {
diff --git a/src/client/app/mios.ts b/src/client/app/mios.ts
index 558c53dcf1..abbd23e3d4 100644
--- a/src/client/app/mios.ts
+++ b/src/client/app/mios.ts
@@ -446,7 +446,7 @@ export default class MiOS extends EventEmitter {
const viaStream = this.stream && this.store.state.device.apiViaStream && !forceFetch;
if (viaStream) {
- const id = Math.random().toString();
+ const id = Math.random().toString().substr(2, 8);
this.stream.once(`api:${id}`, res => {
if (res == null || Object.keys(res).length == 0) {
diff --git a/src/server/api/streaming.ts b/src/server/api/streaming.ts
index 1a0543b364..8c0e6f6372 100644
--- a/src/server/api/streaming.ts
+++ b/src/server/api/streaming.ts
@@ -64,14 +64,14 @@ module.exports = (server: http.Server) => {
}));
};
- main.connectChannel(Math.random().toString(), null,
+ main.connectChannel(Math.random().toString().substr(2, 8), null,
request.resourceURL.pathname === '/' ? 'homeTimeline' :
request.resourceURL.pathname === '/local-timeline' ? 'localTimeline' :
request.resourceURL.pathname === '/hybrid-timeline' ? 'hybridTimeline' :
request.resourceURL.pathname === '/global-timeline' ? 'globalTimeline' : null);
if (request.resourceURL.pathname === '/') {
- main.connectChannel(Math.random().toString(), null, 'main');
+ main.connectChannel(Math.random().toString().substr(2, 8), null, 'main');
}
}