feat: show relay NOTICE
This commit is contained in:
parent
f244f60c56
commit
1601f71b03
6 changed files with 44 additions and 10 deletions
|
|
@ -6,7 +6,7 @@ import time
|
|||
from loguru import logger
|
||||
|
||||
from .filter import Filters
|
||||
from .message_pool import MessagePool
|
||||
from .message_pool import MessagePool, NoticeMessage
|
||||
from .relay import Relay, RelayPolicy
|
||||
from .subscription import Subscription
|
||||
|
||||
|
|
@ -80,6 +80,11 @@ class RelayManager:
|
|||
if relay.policy.should_write:
|
||||
relay.publish(message)
|
||||
|
||||
def handle_notice(self, notice: NoticeMessage):
|
||||
relay = next((r for r in self.relays.values() if r.url == notice.url))
|
||||
if relay:
|
||||
relay.add_notice(notice.content)
|
||||
|
||||
def _open_connection(self, relay: Relay, ssl_options: dict = None, proxy: dict = None):
|
||||
self.threads[relay.url] = threading.Thread(
|
||||
target=relay.connect,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue