REMOVE subscriber by id
context
- we don't want users to know each other's phone numbers!
- as of #408 , we can remove admins by id (and can no longer remove subscribers by phone number)
- subscribers often write in asking to be removed from a channel (which is impossible if you don't know their phone number, which you likely don't)
- so: let's add support for removing a user by their hotline message id
behavior
issuing removal
GIVEN a channel with admin alice (@ADMIN_1) and subscriber bob, who has sent hotling message @123
within the last week
- WHEN alice issues
REMOVE @123
- THEN bob receives a message informing them they have been removed
- AND THEN alice receives a command response notifying her that bob has been removed
- AND THEN all other admins on the channel receive a notification that
@123 has been removed by @ADMIN_1
sad paths
hotline message expired
GIVEN the same channel, but bob sent hotline message @123
over a week ago
- WHEN alice issues
REMOVE @123
- THEN she receives an error message that says (something like) "sorry, that hotline message id does not exist"
- AND THEN bob is not removed
invalid id
GIVEN the same channel
- WHEN alice issues
REMOVE +1222333444
orREMOVE FOO
- THEN alice receives a notification
hotline id belongs to a rando
GIVEN the same channel, but charlise (who is not a subscriber) sends hotline message @321
- WHEN alice issues
REMOVE @321
- THEN alice receives a message that says
Sorry, @123 is not subscribed to this channel. Cannot remove them.
implementation notes
- note:
parse.js
will now have to support polymorphic payloads forREMOVE
(ie: it will have to support either@ADMIN_1
for removing admins or@123
for removing subscribers, and somehow communicate downstream whether the id it parses was for an admin or a hotline message sender