[91] Notify admins of state-changing commands
This MR notifies the rest of the admins on a channel when one admin issues the following state-changing commands:
ADD
-
LEAVE
- only when an admin leaves REMOVE
RENAME
RESPONSES_ON/OFF
VOUCHING_ON/OFF
As a side effect, it also uses notifications when an admin INVITE
s someone to a vouched channel.
A highlight of the major changes:
Executor service
- returns an array of
Notifications
in theCommandResult
- generates these notifications via
notificationsOf
method for each respective command - if no notifications are needed, returns an empty arr []
messenger service
- the messenger service now just iterates over the array of notifications to Get Them Out The Door!
- alters
notify()
to use signal.sendMessage - alters
handleNotifications()
andhandleSignupMessage()
to usenotify()
(possibility here to changebroadcast
or create new utility function to deal w multiple notifications)
strings > commands > messages
- adds suitable notification string for each command
tests
- adds new unit tests for all of the above!
- takes advantage of new better tests for message strings <3
Besides those pesky routes tests that keep failing, the rest of the tests are passing and the functionality for each command has also been manually tested :)
That being said, I feel like the messenger tests introduced here are kind of janky and I'm not sure if we should keep/refactor them.
Closes #91 (closed)