Merge pull request #386 from jdowner/develop-iot

iot: only add the 'done' field when all devices are done
This commit is contained in:
Mike Taylor 2015-09-18 15:13:07 -04:00
commit 4fa5dedc47

View file

@ -482,10 +482,10 @@ class XEP_0323(BasePlugin):
if result == "done": if result == "done":
self.sessions[session]["commTimers"][nodeId].cancel() self.sessions[session]["commTimers"][nodeId].cancel()
self.sessions[session]["nodeDone"][nodeId] = True self.sessions[session]["nodeDone"][nodeId] = True
msg['fields']['done'] = 'true'
if (self._all_nodes_done(session)): if (self._all_nodes_done(session)):
# The session is complete, delete it # The session is complete, delete it
del self.sessions[session] del self.sessions[session]
msg['fields']['done'] = 'true'
else: else:
# Restart comm timer # Restart comm timer
self.sessions[session]["commTimers"][nodeId].reset() self.sessions[session]["commTimers"][nodeId].reset()