2021-02-01 11:58:59 +03:00
|
|
|
global.Olm = require('olm');
|
|
|
|
global.sdk = require('matrix-js-sdk');
|
|
|
|
global.axios = require('axios');
|
|
|
|
global.config = require('./config.js');
|
|
|
|
global.auth = require('./auth.js');
|
2024-09-29 20:53:07 +03:00
|
|
|
global.authEvents = [];
|
2021-02-01 11:58:59 +03:00
|
|
|
const { LocalStorage } = require('node-localstorage');
|
|
|
|
global.localStorage = new LocalStorage('./keys');
|
2021-02-14 10:57:35 +03:00
|
|
|
if (!localStorage.getItem('matrix_auth')) {
|
2021-02-01 11:58:59 +03:00
|
|
|
localStorage.clear();
|
2021-02-14 10:57:35 +03:00
|
|
|
localStorage.setItem('matrix_auth', '[]');
|
2021-02-01 11:58:59 +03:00
|
|
|
}
|
2024-09-29 20:53:07 +03:00
|
|
|
if (!localStorage.getItem('fediverse_auth')) localStorage.setItem('fediverse_auth', '{}');
|
|
|
|
if (!localStorage.getItem('timeline')) localStorage.setItem('timeline', '{}');
|
|
|
|
if (!localStorage.getItem('notifications')) localStorage.setItem('notifications', '{}');
|
2021-02-01 11:58:59 +03:00
|
|
|
|
2021-02-14 10:57:35 +03:00
|
|
|
|
|
|
|
global.fediverse = {
|
|
|
|
auth: JSON.parse(localStorage.getItem('fediverse_auth')),
|
|
|
|
utils: require('./commands/fediverse/utils.js'),
|
|
|
|
};
|
|
|
|
global.matrix = {
|
|
|
|
auth: JSON.parse(localStorage.getItem('matrix_auth')),
|
|
|
|
utils: require('./utils.js'),
|
|
|
|
};
|
2021-01-17 16:41:11 +03:00
|
|
|
|
2019-07-04 00:27:39 +03:00
|
|
|
module.exports = {
|
|
|
|
config: require('./config.js'),
|
2020-05-26 21:06:34 +03:00
|
|
|
archive: require('./commands/archive.js'),
|
2021-07-23 11:27:06 +03:00
|
|
|
proxy: require('./commands/proxy.js'),
|
2020-06-25 14:32:36 +03:00
|
|
|
invidious: require('./commands/invidious.js'),
|
2021-01-14 13:58:29 +03:00
|
|
|
nitter: require('./commands/nitter.js'),
|
|
|
|
boo: require('./commands/fediverse/boo.js'),
|
|
|
|
clap: require('./commands/fediverse/clap.js'),
|
|
|
|
copy: require('./commands/fediverse/copy.js'),
|
|
|
|
flood: require('./commands/fediverse/flood.js'),
|
|
|
|
follow: require('./commands/fediverse/follow.js'),
|
2021-01-14 14:03:54 +03:00
|
|
|
help: require('./commands/help.js'),
|
2021-01-14 13:58:29 +03:00
|
|
|
notify: require('./commands/fediverse/notify.js'),
|
|
|
|
pin: require('./commands/fediverse/pin.js'),
|
|
|
|
post: require('./commands/fediverse/post.js'),
|
|
|
|
redact: require('./commands/fediverse/redact.js'),
|
|
|
|
status: require('./commands/fediverse/status.js'),
|
|
|
|
unfollow: require('./commands/fediverse/unfollow.js'),
|
2021-02-14 10:57:35 +03:00
|
|
|
unpin: require('./commands/fediverse/unpin.js'),
|
2022-04-26 06:09:55 +03:00
|
|
|
unreblog: require('./commands/fediverse/unreblog.js'),
|
2023-08-23 10:25:48 +03:00
|
|
|
unroll: require('./commands/fediverse/unroll.js'),
|
|
|
|
react: require('./commands/fediverse/react.js'),
|
2024-09-29 20:53:07 +03:00
|
|
|
expand: require('./commands/expand.js'),
|
|
|
|
auth: require("./commands/fediverse/auth.js")
|
2019-07-04 00:27:39 +03:00
|
|
|
};
|