feat(e2ee): introduce OLM encryption. refactor(storage): moved from fs to localstorage. refactor(config): added as global to registrar. chore(npm): upgraded matrix-js-sdk from 2.4.6 release to 9.5.1 release.

This commit is contained in:
vulet 2021-02-01 16:58:59 +08:00
parent 0cd373fb8a
commit 67b88f9c96
28 changed files with 264 additions and 1413 deletions

View file

@ -1,14 +1,12 @@
const axios = require('axios');
exports.runQuery = function (matrixClient, room, userInput, registrar) {
exports.runQuery = function (matrixClient, room, userInput, ) {
axios({
method: 'GET',
url: `${registrar.config.fediverse.domain}/api/v1/statuses/${userInput}`,
headers: { Authorization: `Bearer ${registrar.fediverse_auth.access_token}` },
url: `${config.fediverse.domain}/api/v1/statuses/${userInput}`,
headers: { Authorization: `Bearer ${fediverse_auth.access_token}` },
}).then((response) => {
matrixClient.sendHtmlNotice(room.roomId,
'',
`<b><a href="${registrar.config.fediverse.domain}/notice/${response.data.id}">${response.data.account.acct}</a>
`<b><a href="${config.fediverse.domain}/notice/${response.data.id}">${response.data.account.acct}</a>
<blockquote><i>${response.data.content}<br>
${response.data.media_attachments.map(media =>
`<a href="${media.remote_url}"><b>${media.description}</b></a>`)