Add sinst fetch and fix message send logic
This commit is contained in:
parent
f8c1e952bb
commit
96de70aaf2
12
api/views.py
12
api/views.py
|
@ -617,7 +617,7 @@ class API(object):
|
|||
nick = None
|
||||
if channel == main.IRCPool[name].nickname:
|
||||
in_query = True
|
||||
if nick:
|
||||
if not nick:
|
||||
return dumps({"success": False, "reason": "no nick specified to query"})
|
||||
else:
|
||||
main.IRCPool[name].sendmsg(nick, msg, in_query=in_query)
|
||||
|
@ -687,3 +687,13 @@ class API(object):
|
|||
return dumps({"success": False, "reason": f"no relay {num} on {net}"})
|
||||
regproc.enableAuthentication(net, num, jump=False, run_now=True)
|
||||
return dumps({"success": True})
|
||||
|
||||
@app.route("/irc/sinst/<net>/", methods=["GET"])
|
||||
@login_required
|
||||
def irc_get_authentity(self, request, net):
|
||||
if net not in main.network.keys():
|
||||
return dumps({"success": False, "reason": "no such net."})
|
||||
auth = regproc.selectInst(net)
|
||||
if not auth:
|
||||
return dumps({"success": False, "reason": "error getting results."})
|
||||
return dumps({"success": True, "sinst": auth})
|
||||
|
|
Loading…
Reference in New Issue