Rename 'state' presence key to the much more obvious 'presence'; maintain a legacy 'state' copy for now

This commit is contained in:
Paul "LeoNerd" Evans 2014-09-01 14:45:35 +01:00
parent f500dd627a
commit 02f4e3b3ff
7 changed files with 147 additions and 78 deletions

View file

@ -48,7 +48,11 @@ class PresenceStatusRestServlet(RestServlet):
try:
content = json.loads(request.content.read())
state["state"] = content.pop("state")
# Legacy handling
if "state" in content:
state["presence"] = content.pop("state")
else:
state["presence"] = content.pop("presence")
if "status_msg" in content:
state["status_msg"] = content.pop("status_msg")