summaryrefslogtreecommitdiff
path: root/src/web/app/common/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/app/common/scripts')
-rw-r--r--src/web/app/common/scripts/messaging-index-stream-manager.ts20
-rw-r--r--src/web/app/common/scripts/messaging-index-stream.ts14
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;