diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-01-06 01:45:02 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-01-06 01:45:02 +0900 |
| commit | 2ded8ba8580f49741e0d5e436f65561c8dd9ef18 (patch) | |
| tree | e2b13194a3d33b1481ee1004865f51f699b5f8ac /src/web/app/common/scripts | |
| parent | アクセストークンは i に統一 (diff) | |
| download | sharkey-2ded8ba8580f49741e0d5e436f65561c8dd9ef18.tar.gz sharkey-2ded8ba8580f49741e0d5e436f65561c8dd9ef18.tar.bz2 sharkey-2ded8ba8580f49741e0d5e436f65561c8dd9ef18.zip | |
Fix bug, Support thirdparty streaming access
Diffstat (limited to 'src/web/app/common/scripts')
| -rw-r--r-- | src/web/app/common/scripts/messaging-stream.ls | 2 | ||||
| -rw-r--r-- | src/web/app/common/scripts/stream.ls | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/web/app/common/scripts/messaging-stream.ls b/src/web/app/common/scripts/messaging-stream.ls index 298285dc93..ac3e74f1f5 100644 --- a/src/web/app/common/scripts/messaging-stream.ls +++ b/src/web/app/common/scripts/messaging-stream.ls @@ -9,7 +9,7 @@ class Connection @event = riot.observable! @me = me host = CONFIG.api.url.replace \http \ws - @socket = new ReconnectingWebSocket "#{host}/messaging?otherparty=#{otherparty}" + @socket = new ReconnectingWebSocket "#{host}/messaging?i=#{me.token}&otherparty=#{otherparty}" @socket.add-event-listener \open @on-open @socket.add-event-listener \message @on-message diff --git a/src/web/app/common/scripts/stream.ls b/src/web/app/common/scripts/stream.ls index 534048248f..64ae03817a 100644 --- a/src/web/app/common/scripts/stream.ls +++ b/src/web/app/common/scripts/stream.ls @@ -9,13 +9,12 @@ module.exports = (me) ~> state-ev = riot.observable! event = riot.observable! - socket = new ReconnectingWebSocket CONFIG.api.url.replace \http \ws + host = CONFIG.api.url.replace \http \ws + socket = new ReconnectingWebSocket "#{host}?i=#{me.token}" socket.onopen = ~> state := \connected state-ev.trigger \connected - socket.send JSON.stringify do - i: me.token socket.onclose = ~> state := \reconnecting |