irislib / iris-messenger

Decentralized messenger
https://iris.to
MIT License
720 stars 159 forks source link

Combine `Relay.ts` and `PubSub.ts`? #371

Closed npub1zenn0 closed 1 year ago

npub1zenn0 commented 1 year ago

@mmalmi what do you think of this, is this something that can feasibly be done?

I have a problem now in https://github.com/irislib/iris-messenger/pull/370 , because the client connects to the same relay multiple times. Every connection needs its own auth.

From what I can see, it looks a bit like Relay.ts is connecting for metadata, while PubSub is connecting for notes etc. correct me if I'm wrong on that.

mmalmi commented 1 year ago

I will make Relays.ts only handle the relay list and not initiate connections. Requests are already made from PubSub.ts via relaypool — I'll also make publishing go through it.

npub1zenn0 commented 1 year ago

That sounds good. Using the relaypool in Relays.ts seems like a plan.

npub1zenn0 commented 1 year ago

This seems done.