Only broadcast and activity change if it actually changed
This commit is contained in:
parent
b67c0a6b3d
commit
701cef3f1d
@ -11,6 +11,7 @@ class KiuBot(Bot):
|
|||||||
self._olpc_channel_service = None
|
self._olpc_channel_service = None
|
||||||
self._sugar_channel_service = None
|
self._sugar_channel_service = None
|
||||||
self._activity_switch_timeout = None
|
self._activity_switch_timeout = None
|
||||||
|
self._curact = None
|
||||||
|
|
||||||
action = ShareActivityAction('OLPC channel',
|
action = ShareActivityAction('OLPC channel',
|
||||||
'_GroupChatActivity_Sugar_redhat_com._udp',
|
'_GroupChatActivity_Sugar_redhat_com._udp',
|
||||||
@ -33,9 +34,11 @@ class KiuBot(Bot):
|
|||||||
actid = self._sugar_channel_activity.get_id()
|
actid = self._sugar_channel_activity.get_id()
|
||||||
else:
|
else:
|
||||||
raise RuntimeError("WTF? unexpected value")
|
raise RuntimeError("WTF? unexpected value")
|
||||||
|
if actid != self._curact:
|
||||||
print "KIU: now setting current activity to %s" % actid
|
print "KIU: now setting current activity to %s" % actid
|
||||||
self._owner.set_current_activity(actid)
|
self._owner.set_current_activity(actid)
|
||||||
self._schedule_activity_switch_timeout()
|
self._schedule_activity_switch_timeout()
|
||||||
|
self._curact = actid
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _schedule_activity_switch_timeout(self):
|
def _schedule_activity_switch_timeout(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user