3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

global: do not allow sending empty messages

This commit is contained in:
James Lu 2018-06-08 18:22:00 -07:00
parent f4de604b7d
commit 0edbeb7fad

View File

@ -14,7 +14,12 @@ def g(irc, source, args):
Sends out a Instance-wide notice.
"""
permissions.check_permissions(irc, source, ["global.global"])
message = " ".join(args)
message = " ".join(args).strip()
if not message:
irc.error("Refusing to send an empty message.")
return
global_conf = conf.conf.get('global') or {}
template = string.Template(global_conf.get('format', DEFAULT_FORMAT))