diff options
author | Dan Williams <dcbw@localhost.localdomain> | 2006-09-25 01:31:48 (GMT) |
---|---|---|
committer | Dan Williams <dcbw@localhost.localdomain> | 2006-09-25 01:31:48 (GMT) |
commit | 701cef3f1d6697651e20a2146f62e7dda7b2dd7e (patch) | |
tree | 678bfc585c554cd4c2a017039ceb7513288496ad /tests | |
parent | b67c0a6b3d637e722570de9f1ac8ccd3250062be (diff) |
Only broadcast and activity change if it actually changed
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/simulator/kiu.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/simulator/kiu.py b/tests/simulator/kiu.py index 434db93..e9339c7 100755 --- a/tests/simulator/kiu.py +++ b/tests/simulator/kiu.py @@ -11,6 +11,7 @@ class KiuBot(Bot): self._olpc_channel_service = None self._sugar_channel_service = None self._activity_switch_timeout = None + self._curact = None action = ShareActivityAction('OLPC channel', '_GroupChatActivity_Sugar_redhat_com._udp', @@ -33,9 +34,11 @@ class KiuBot(Bot): actid = self._sugar_channel_activity.get_id() else: raise RuntimeError("WTF? unexpected value") - print "KIU: now setting current activity to %s" % actid - self._owner.set_current_activity(actid) - self._schedule_activity_switch_timeout() + if actid != self._curact: + print "KIU: now setting current activity to %s" % actid + self._owner.set_current_activity(actid) + self._schedule_activity_switch_timeout() + self._curact = actid return False def _schedule_activity_switch_timeout(self): |