Fix LBTC POST message signing

This commit is contained in:
2022-05-10 21:41:16 +01:00
parent 644444c02f
commit b2b7b3b923
4 changed files with 37 additions and 22 deletions

View File

@@ -3,6 +3,7 @@ from json import dumps, loads
# Project imports
from settings import settings
import db
class GenericCommands(object):
@@ -117,12 +118,17 @@ class GenericCommands(object):
class redist(object):
@staticmethod
def run(cmd, spl, length, authed, msg, agora, tx, ux, caller):
for x in caller.redist_countries():
def got_redist(redist_output, msg):
for x in redist_output:
if x[0]["success"]:
msg(f"{x[0]['response']['data']['message']}: {x[1]}")
else:
msg(dumps(x[0]["response"]))
msg(dumps(x))
@staticmethod
def run(cmd, spl, length, authed, msg, agora, tx, ux, caller):
c = caller.redist_countries()
c.addCallback(GenericCommands.redist.got_redist, msg)
class stripdupes(object):
@staticmethod
@@ -432,7 +438,7 @@ class IRCCommands(object):
@staticmethod
def run(cmd, spl, length, authed, msg, agora, tx, ux):
msg(f"References: {', '.join(tx.get_refs())}")
msg(f"References: {', '.join(db.get_refs())}")
class ref(object):
name = "ref"
@@ -442,7 +448,7 @@ class IRCCommands(object):
@staticmethod
def run(cmd, spl, length, authed, msg, agora, tx, ux):
if length == 2:
ref_data = tx.get_ref(spl[1])
ref_data = db.get_ref(spl[1])
if not ref_data:
msg(f"No such reference: {spl[1]}")
return
@@ -456,11 +462,11 @@ class IRCCommands(object):
@staticmethod
def run(cmd, spl, length, authed, msg, agora, tx, ux):
if length == 2:
ref_data = tx.get_ref(spl[1])
ref_data = db.get_ref(spl[1])
if not ref_data:
msg(f"No such reference: {spl[1]}")
return
tx.del_ref(spl[1])
db.del_ref(spl[1])
msg(f"Deleted reference: {spl[1]}")
class arelease(object):