Removed ssb.addEventListener and ssb.removeEventListener from the public API. Can do the same thing with core.register.

This commit is contained in:
2024-05-22 18:51:21 -04:00
parent b883e6a485
commit 1be94ae0be
6 changed files with 15 additions and 10 deletions

View File

@ -76,7 +76,7 @@ tfrpc.register(function getHash(id, message) {
tfrpc.register(function setHash(hash) {
return app.setHash(hash);
});
ssb.addEventListener('message', async function (id) {
core.register('onMessage', async function (id) {
await tfrpc.rpc.notifyNewMessage(id);
});
tfrpc.register(async function store_blob(blob) {
@ -103,7 +103,7 @@ tfrpc.register(async function encrypt(id, recipients, content) {
tfrpc.register(async function getActiveIdentity() {
return await ssb.getActiveIdentity();
});
ssb.addEventListener('broadcasts', async function () {
core.register('onBroadcastsChanged', async function () {
await tfrpc.rpc.set('broadcasts', await ssb.getBroadcasts());
});