add name when sending message from mattermost

This commit is contained in:
Hannes Klinckaert 2019-09-02 23:51:44 +02:00
parent c204e9a38e
commit 62c2deb0db

View file

@ -88,7 +88,10 @@ def messages_post():
if "spam" in str(message, "UTF-8").lower(): if "spam" in str(message, "UTF-8").lower():
messages.append(Message(time, "1.3.3.7", "ip", "Nee")) messages.append(Message(time, "1.3.3.7", "ip", "Nee"))
return "OK" return "OK"
if sender != "somebody":
message = "<" + sender + "> " + message
messages.append(Message(time, sender, sendertype, str(message, "UTF-8"))) messages.append(Message(time, sender, sendertype, str(message, "UTF-8")))
url = 'http://10.0.5.42:8000/' # Set destination URL here url = 'http://10.0.5.42:8000/' # Set destination URL here
post_fields = {'X-Messages': base64.b64encode(message)} post_fields = {'X-Messages': base64.b64encode(message)}