Make relays dynamic
This commit is contained in:
parent
a584467907
commit
c1c349a6f3
10
src/app.py
10
src/app.py
@ -65,6 +65,8 @@ def get_json():
|
|||||||
|
|
||||||
nostr = {}
|
nostr = {}
|
||||||
nostr['names'] = {}
|
nostr['names'] = {}
|
||||||
|
nostr['relays'] = {}
|
||||||
|
|
||||||
if localusers is not None:
|
if localusers is not None:
|
||||||
for user in localusers:
|
for user in localusers:
|
||||||
if user['nickname'] == 'gvs':
|
if user['nickname'] == 'gvs':
|
||||||
@ -72,11 +74,7 @@ def get_json():
|
|||||||
for field in user.get('fields'):
|
for field in user.get('fields'):
|
||||||
if field.get('name').lower() == 'nostr':
|
if field.get('name').lower() == 'nostr':
|
||||||
nostr['names'][user['nickname']] = field.get('value')
|
nostr['names'][user['nickname']] = field.get('value')
|
||||||
|
nostr['relays'][field.get('value')] = relays
|
||||||
|
|
||||||
|
# print(json.dumps(nostr))
|
||||||
# nostr['names']['gvs'] = 'eb2881406ad19ba7cf01c210ce002f4fe53e8ce6d84e77df5a2319f9f00a8005'
|
|
||||||
nostr['relays'] = {}
|
|
||||||
nostr['relays']['eb2881406ad19ba7cf01c210ce002f4fe53e8ce6d84e77df5a2319f9f00a8005'] = relays
|
|
||||||
|
|
||||||
print(json.dumps(nostr))
|
|
||||||
return json.dumps(nostr)
|
return json.dumps(nostr)
|
||||||
|
Loading…
Reference in New Issue
Block a user