[89] Resolve "allow channel owners to toggle responses on/off"
Closes #89 (closed)
User-facing changes
GIVEN a channel on which responses are not enabled
- WHEN the owner sends a message that says "RESPONSES ON"
- THEN signalboost will enable subscriber responses on that channel
GIVEN a channel with responses enabled
- WHEN a subscriber sends a non-command message to the channel
- THEN it will be relayed to all channel owners
GIVEN a channel with responses enabled
- WHEN the channel owner sends a message that says "RESPONSES OFF"
- THEN signalboost will disable subscriber responses on that channel
GIVEN a channel with responses not enabled
- WHEN a subscriber sends a non-command message to the channel
- THEN they will receive a "Whoops!" message in response
GIVEN a channel
- WHEN a publisher send a message that says "RESPONSES FOO" (or anything other than ON/OFF)
- THEN they will get an error message notifying them of the allowed settings
GIVEN a channel
- WHEN a publisher issues an
INFO
command - THEN they will see the current state of the subscriber responses toggle as part of the response
Implementation notes
- add a
responsesEnabled
field on channel - check
responsesEnabled
inmessenger
dispatch flow (and relay message to owners if sender is a subscriber) - add new
TOGGLE_RESPONSES
command toservices.dispatcher.executor.js
- add new
BROADCAST_RESPONSE
message type toservices.dispatcher.messenger.js
- generally refactor
dispatcher.messenger
for clarity and readability - descoped command notificiations for all admins, but left TODO for how to accomplish it
- not totally happy with factoring of
dispatcher.messenger.format
ATM, but seems okay for now and unlikely to change too much so fine with some extra copmlexity there for a bit
Edited by aguestuser