diff options
| author | jason | 2016-08-25 16:38:00 -0600 |
|---|---|---|
| committer | jason | 2016-08-25 16:38:00 -0600 |
| commit | a68ecdfb5a472924ca13d562a866642004415b27 (patch) | |
| tree | 30241ca41f42f48635c8f0bafc11a745e27b76f9 | |
| parent | 1180e331b94b1c02b7714cf7e3fd7d59aabefd96 (diff) | |
| download | warmachine-ng-a68ecdfb5a472924ca13d562a866642004415b27.tar.gz warmachine-ng-a68ecdfb5a472924ca13d562a866642004415b27.zip | |
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.
| -rw-r--r-- | warmachine/addons/standup.py | 16 |
1 files changed, 16 insertions, 0 deletions
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): | |||
| 354 | self.log.debug('Messaging user: {}'.format(user)) | 354 | self.log.debug('Messaging user: {}'.format(user)) |
| 355 | 355 | ||
| 356 | if user in self.users_awaiting_reply: | 356 | if user in self.users_awaiting_reply: |
| 357 | if 'standup_msg' in self.users_awaiting_reply[user]: | ||
| 358 | await connection.say('*@{}*: {}'.format( | ||
| 359 | user, self.users_awaiting_reply[user]['standup_msg'] | ||
| 360 | ), channel) | ||
| 361 | |||
| 362 | self.users_awaiting_reply[user]['pester_task'].cancel() | ||
| 363 | self.users_awaiting_reply[user]['pester_task'] = None | ||
| 364 | |||
| 365 | return | ||
| 357 | # Don't readd an existing channel | 366 | # Don't readd an existing channel |
| 358 | if channel not in self.users_awaiting_reply[user]['for_channels']: | 367 | if channel not in self.users_awaiting_reply[user]['for_channels']: |
| 359 | self.users_awaiting_reply[user]['for_channels'].append(channel) | 368 | self.users_awaiting_reply[user]['for_channels'].append(channel) |
| @@ -363,6 +372,13 @@ class StandUpPlugin(WarMachinePlugin): | |||
| 363 | 'for_channels': [channel, ], | 372 | 'for_channels': [channel, ], |
| 364 | } | 373 | } |
| 365 | 374 | ||
| 375 | # They are already being bothered about it. It won't help to bother them | ||
| 376 | # for a different thing | ||
| 377 | if pester_count == 0 and \ | ||
| 378 | 'pester_task' in self.users_awaiting_reply[user] and \ | ||
| 379 | self.users_awaiting_reply[user]['pester_task']: | ||
| 380 | return | ||
| 381 | |||
| 366 | for_channels = self.users_awaiting_reply[user]['for_channels'] | 382 | for_channels = self.users_awaiting_reply[user]['for_channels'] |
| 367 | await connection.say('What did you do yesterday? What will you ' | 383 | await connection.say('What did you do yesterday? What will you ' |
| 368 | 'do today? do you have any blockers? ' | 384 | 'do today? do you have any blockers? ' |