summaryrefslogtreecommitdiffstats
path: root/ui/src/services
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-01-22 16:35:29 -0500
committerDessalines <tyhou13@gmx.com>2020-01-22 16:38:16 -0500
commit253bc3e0afb6adf64b79f334a8bc1f972aa45eba (patch)
treebdbbb36ee59ea4331c7bf7cf89e8ef554eb2d63e /ui/src/services
parenta964b4ce21cc19eb42ae4da1a1aef8bfc0a1df5c (diff)
Adding private messaging, and matrix user ids.
- Fixes #244
Diffstat (limited to 'ui/src/services')
-rw-r--r--ui/src/services/WebSocketService.ts26
1 files changed, 25 insertions, 1 deletions
diff --git a/ui/src/services/WebSocketService.ts b/ui/src/services/WebSocketService.ts
index a70fb2de..146a9abf 100644
--- a/ui/src/services/WebSocketService.ts
+++ b/ui/src/services/WebSocketService.ts
@@ -32,10 +32,13 @@ import {
DeleteAccountForm,
PasswordResetForm,
PasswordChangeForm,
+ PrivateMessageForm,
+ EditPrivateMessageForm,
+ GetPrivateMessagesForm,
} from '../interfaces';
import { webSocket } from 'rxjs/webSocket';
import { Subject } from 'rxjs';
-import { retryWhen, delay, take } from 'rxjs/operators';
+import { retryWhen, delay } from 'rxjs/operators';
import { UserService } from './';
import { i18n } from '../i18next';
@@ -285,6 +288,27 @@ export class WebSocketService {
this.subject.next(this.wsSendWrapper(UserOperation.PasswordChange, form));
}
+ public createPrivateMessage(form: PrivateMessageForm) {
+ this.setAuth(form);
+ this.subject.next(
+ this.wsSendWrapper(UserOperation.CreatePrivateMessage, form)
+ );
+ }
+
+ public editPrivateMessage(form: EditPrivateMessageForm) {
+ this.setAuth(form);
+ this.subject.next(
+ this.wsSendWrapper(UserOperation.EditPrivateMessage, form)
+ );
+ }
+
+ public getPrivateMessages(form: GetPrivateMessagesForm) {
+ this.setAuth(form);
+ this.subject.next(
+ this.wsSendWrapper(UserOperation.GetPrivateMessages, form)
+ );
+ }
+
private wsSendWrapper(op: UserOperation, data: any) {
let send = { op: UserOperation[op], data: data };
console.log(send);