aboutsummaryrefslogtreecommitdiffstats
path: root/jsonfactory.py
diff options
context:
space:
mode:
authorJan Tuomi <jan-sebastian.tuomi@aalto.fi>2016-07-18 19:20:19 +0300
committerJan Tuomi <jan-sebastian.tuomi@aalto.fi>2016-07-18 19:20:19 +0300
commitd954ed175de1dab5bda8c198bc8d7e0b2c552d01 (patch)
tree4063d6d7b8803ae9c50de8cbb60e5fef72632742 /jsonfactory.py
parente5dede846917747e688a4b6581da019712ca9b1d (diff)
Add buffer to avoid forwarding duplicate messages from shoutbox
Diffstat (limited to 'jsonfactory.py')
-rw-r--r--jsonfactory.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/jsonfactory.py b/jsonfactory.py
index be70996..6703ef2 100644
--- a/jsonfactory.py
+++ b/jsonfactory.py
@@ -2,15 +2,18 @@ import json
class JSONFactory(object):
+ running_id = 1
+
@staticmethod
def make_object(text, user, timestamp, ip):
message = json.dumps({
+ "id": JSONFactory.running_id,
"text": text,
"user": user,
"timestamp": timestamp,
"ip": ip
})
-
+ JSONFactory.running_id += 1
return message
@staticmethod