|
|
@ -14,7 +14,7 @@ export class MatrixHandler {
|
|
|
|
if (this.client){ console.log('there is already an active session'); return; }
|
|
|
|
if (this.client){ console.log('there is already an active session'); return; }
|
|
|
|
this.client = new matrix.createClient({
|
|
|
|
this.client = new matrix.createClient({
|
|
|
|
baseUrl: baseUrl,
|
|
|
|
baseUrl: baseUrl,
|
|
|
|
sessionStore: new matrix.WebStorageSessionStore(window.localStorage)
|
|
|
|
sessionStore: new matrix.WebStorageSessionStore(localStorage)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.client.login('m.login.password', {
|
|
|
|
this.client.login('m.login.password', {
|
|
|
|
user: user,
|
|
|
|
user: user,
|
|
|
@ -45,7 +45,7 @@ export class MatrixHandler {
|
|
|
|
baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
accessToken,
|
|
|
|
accessToken,
|
|
|
|
userId,
|
|
|
|
userId,
|
|
|
|
sessionStore: new matrix.WebStorageSessionStore(window.localStorage)
|
|
|
|
sessionStore: new matrix.WebStorageSessionStore(localStorage)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.user = userId;
|
|
|
|
this.user = userId;
|
|
|
|
this.baseUrl = baseUrl;
|
|
|
|
this.baseUrl = baseUrl;
|
|
|
@ -70,7 +70,7 @@ export class MatrixHandler {
|
|
|
|
const msgSend = {
|
|
|
|
const msgSend = {
|
|
|
|
type: msg.type,
|
|
|
|
type: msg.type,
|
|
|
|
content: {
|
|
|
|
content: {
|
|
|
|
body: msg.content.body,
|
|
|
|
body: msg.content.body.trim(),
|
|
|
|
msgtype: msg.content.msgtype,
|
|
|
|
msgtype: msg.content.msgtype,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|