diff options
Diffstat (limited to 'warmachine/addons/standup.py')
| -rw-r--r-- | warmachine/addons/standup.py | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/warmachine/addons/standup.py b/warmachine/addons/standup.py index aa7fda6..27cee53 100644 --- a/warmachine/addons/standup.py +++ b/warmachine/addons/standup.py | |||
| @@ -149,7 +149,7 @@ class StandUpPlugin(WarMachinePlugin): | |||
| 149 | elif cmd == '!standup-ignore' and channel \ | 149 | elif cmd == '!standup-ignore' and channel \ |
| 150 | and channel in self.standup_schedules: # noqa - indent level | 150 | and channel in self.standup_schedules: # noqa - indent level |
| 151 | if parts: | 151 | if parts: |
| 152 | users_to_ignore = ''.join(parts).split(' ') | 152 | users_to_ignore = parts |
| 153 | for u in users_to_ignore: | 153 | for u in users_to_ignore: |
| 154 | if u not in self.standup_schedules[channel]['ignoring']: | 154 | if u not in self.standup_schedules[channel]['ignoring']: |
| 155 | self.log.info('Ignoring {} in channel {}'.format( | 155 | self.log.info('Ignoring {} in channel {}'.format( |
| @@ -166,10 +166,37 @@ class StandUpPlugin(WarMachinePlugin): | |||
| 166 | 166 | ||
| 167 | await connection.say('Currently ignoring {}'.format(ignoring), | 167 | await connection.say('Currently ignoring {}'.format(ignoring), |
| 168 | channel) | 168 | channel) |
| 169 | |||
| 170 | # ====================================================================== | ||
| 171 | # !standup-unignore <space separated users> | ||
| 172 | # | ||
| 173 | # Remove users from the ignore list. | ||
| 174 | # ====================================================================== | ||
| 169 | elif cmd == '!standup-unignore' and channel \ | 175 | elif cmd == '!standup-unignore' and channel \ |
| 170 | and channel in self.standup_schedules: # noqa - indent level | 176 | and channel in self.standup_schedules: # noqa - indent level |
| 171 | if not parts: | 177 | removed_users = [] # Used for the message |
| 172 | return | 178 | |
| 179 | if parts: | ||
| 180 | users_to_unignore = parts | ||
| 181 | for u in users_to_unignore: | ||
| 182 | if u in self.standup_schedules[channel]['ignoring']: | ||
| 183 | self.log.info('Unignoring {} in channel {}'.format( | ||
| 184 | u, channel)) | ||
| 185 | self.standup_schedules[channel]['ignoring'].remove(u) | ||
| 186 | removed_users.append(u) | ||
| 187 | self.save_schedule(connection) | ||
| 188 | |||
| 189 | if removed_users: | ||
| 190 | await connection.say('Removed {} from the ignore list'.format( | ||
| 191 | ', '.join(removed_users)), channel) | ||
| 192 | |||
| 193 | ignoring = ', '.join( | ||
| 194 | self.standup_schedules[channel]['ignoring']) | ||
| 195 | if not ignoring: | ||
| 196 | ignoring = 'no one' | ||
| 197 | |||
| 198 | await connection.say('Currently ignoring {}'.format(ignoring), | ||
| 199 | channel) | ||
| 173 | 200 | ||
| 174 | # ====================================================================== | 201 | # ====================================================================== |
| 175 | # !standup-schedules | 202 | # !standup-schedules |