Fix AiAe.exe willing to break stuff

This commit is contained in:
Giuseppe Guerra 2017-12-08 13:08:54 +01:00
parent 90cd4634fd
commit 050c1d5fe8

View File

@ -81,14 +81,20 @@ def roll(fro, chan, message):
# return random.choice(["yes", "no", "maybe"]) # return random.choice(["yes", "no", "maybe"])
def alert(fro, chan, message): def alert(fro, chan, message):
glob.streams.broadcast("main", serverPackets.notification(' '.join(message[:]))) msg = ' '.join(message[:])
if not msg.strip():
return False
glob.streams.broadcast("main", serverPackets.notification(msg))
return False return False
def alertUser(fro, chan, message): def alertUser(fro, chan, message):
target = message[0].lower() target = message[0].lower()
targetToken = glob.tokens.getTokenFromUsername(userUtils.safeUsername(target), safe=True) targetToken = glob.tokens.getTokenFromUsername(userUtils.safeUsername(target), safe=True)
if targetToken is not None: if targetToken is not None:
targetToken.enqueue(serverPackets.notification(' '.join(message[1:]))) msg = ' '.join(message[1:])
if not msg.strip():
return False
targetToken.enqueue(serverPackets.notification(msg))
return False return False
else: else:
return "User offline." return "User offline."