Implement sending of relay messages

pull/1/head
Mark Veidemanis 5 years ago
parent fc304d4b25
commit 9e1a6613a4

@ -1,6 +1,7 @@
import main
import modules.keyword as keyword
from copy import deepcopy
from json import dumps
def testNetTarget(name, target):
called = False
@ -49,6 +50,14 @@ def magicFunction(A, B):
return all(A[k] in B[k] for k in set(A) & set(B)) and set(B) <= set(A)
def event(name, target, cast):
for i in main.relayConnections.keys():
if main.relayConnections[i].authed and cast["type"] in main.relayConnections[i].subscriptions:
newCast = deepcopy(cast)
if not target == None:
newCast["target"] = target
if "exact" in newCast.keys():
del newCast["exact"]
main.relayConnections[i].send(dumps(newCast))
monitorGroups = testNetTarget(name, target)
if monitorGroups == False:
return

Loading…
Cancel
Save