From a68ecdfb5a472924ca13d562a866642004415b27 Mon Sep 17 00:00:00 2001 From: jason Date: Thu, 25 Aug 2016 16:38:00 -0600 Subject: don't schedule multiple pesters - people in multiple channels that start standup at the same time get multiple pesters. don't schedule the multiple pesters and check to see if they've already answered standup before pestering them. --- warmachine/addons/standup.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/warmachine/addons/standup.py b/warmachine/addons/standup.py index 1120082..f6f8b06 100644 --- a/warmachine/addons/standup.py +++ b/warmachine/addons/standup.py @@ -354,6 +354,15 @@ class StandUpPlugin(WarMachinePlugin): self.log.debug('Messaging user: {}'.format(user)) if user in self.users_awaiting_reply: + if 'standup_msg' in self.users_awaiting_reply[user]: + await connection.say('*@{}*: {}'.format( + user, self.users_awaiting_reply[user]['standup_msg'] + ), channel) + + self.users_awaiting_reply[user]['pester_task'].cancel() + self.users_awaiting_reply[user]['pester_task'] = None + + return # Don't readd an existing channel if channel not in self.users_awaiting_reply[user]['for_channels']: self.users_awaiting_reply[user]['for_channels'].append(channel) @@ -363,6 +372,13 @@ class StandUpPlugin(WarMachinePlugin): 'for_channels': [channel, ], } + # They are already being bothered about it. It won't help to bother them + # for a different thing + if pester_count == 0 and \ + 'pester_task' in self.users_awaiting_reply[user] and \ + self.users_awaiting_reply[user]['pester_task']: + return + for_channels = self.users_awaiting_reply[user]['for_channels'] await connection.say('What did you do yesterday? What will you ' 'do today? do you have any blockers? ' -- cgit v1.2.1