mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-10-09 21:42:32 +02:00
do a little check on inbox relays to avoid some errors
This commit is contained in:
@@ -121,14 +121,11 @@ def get_inbox_relays(event_to_send: Event, client: Client, dvm_config):
|
|||||||
nip65event = events[0]
|
nip65event = events[0]
|
||||||
relays = []
|
relays = []
|
||||||
for tag in nip65event.tags():
|
for tag in nip65event.tags():
|
||||||
if tag.as_vec()[0] == 'r' and len(tag.as_vec()) == 2:
|
if ((tag.as_vec()[0] == 'r' and len(tag.as_vec()) == 2)
|
||||||
rtag = tag.as_vec()[1]
|
or ((tag.as_vec()[0] == 'r' and len(tag.as_vec()) == 3) and tag.as_vec()[2] == "read")):
|
||||||
if rtag.rstrip("/") not in dvm_config.AVOID_PAID_OUTBOX_RELAY_LIST:
|
|
||||||
relays.append(rtag)
|
|
||||||
elif tag.as_vec()[0] == 'r' and len(tag.as_vec()) == 3:
|
|
||||||
if tag.as_vec()[2] == "read":
|
|
||||||
rtag = tag.as_vec()[1]
|
rtag = tag.as_vec()[1]
|
||||||
if rtag.rstrip("/") not in dvm_config.AVOID_PAID_OUTBOX_RELAY_LIST:
|
if rtag.rstrip("/") not in dvm_config.AVOID_PAID_OUTBOX_RELAY_LIST:
|
||||||
|
if rtag.startswith("ws") and " " not in rtag:
|
||||||
relays.append(rtag)
|
relays.append(rtag)
|
||||||
return relays
|
return relays
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user