diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-11-14 00:54:16 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-11-14 00:54:16 +0900 |
| commit | ab2293aa4c0832f9e57d64aa22d2fce319fbfcb1 (patch) | |
| tree | 0060da35ac7fcb525ba2df2d9ac02d71c10d7b29 /src/web/app/common/scripts | |
| parent | Add access log widget (diff) | |
| download | sharkey-ab2293aa4c0832f9e57d64aa22d2fce319fbfcb1.tar.gz sharkey-ab2293aa4c0832f9e57d64aa22d2fce319fbfcb1.tar.bz2 sharkey-ab2293aa4c0832f9e57d64aa22d2fce319fbfcb1.zip | |
Add messaging widget
Diffstat (limited to 'src/web/app/common/scripts')
| -rw-r--r-- | src/web/app/common/scripts/messaging-index-stream-manager.ts | 20 | ||||
| -rw-r--r-- | src/web/app/common/scripts/messaging-index-stream.ts | 14 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/web/app/common/scripts/messaging-index-stream-manager.ts b/src/web/app/common/scripts/messaging-index-stream-manager.ts new file mode 100644 index 0000000000..dc386204ca --- /dev/null +++ b/src/web/app/common/scripts/messaging-index-stream-manager.ts @@ -0,0 +1,20 @@ +import StreamManager from './stream-manager'; +import Connection from './messaging-index-stream'; + +export default class ServerStreamManager extends StreamManager<Connection> { + private me; + + constructor(me) { + super(); + + this.me = me; + } + + public getConnection() { + if (this.connection == null) { + this.connection = new Connection(this.me); + } + + return this.connection; + } +} diff --git a/src/web/app/common/scripts/messaging-index-stream.ts b/src/web/app/common/scripts/messaging-index-stream.ts new file mode 100644 index 0000000000..c194e663c2 --- /dev/null +++ b/src/web/app/common/scripts/messaging-index-stream.ts @@ -0,0 +1,14 @@ +import Stream from './stream'; + +/** + * Messaging index stream connection + */ +class Connection extends Stream { + constructor(me) { + super('messaging-index', { + i: me.token + }); + } +} + +export default Connection; |