Skip to content

resolve: "Hard-coded admin relays message to hard-coded group members" [#20]

aguestuser requested to merge 20-relay-message-to-hardcoded-group-members into master

Summary

With this MR, a hard-coded admin can send a message that is relayed to hard-coded group members, but group members get an error message when they try to send a message.

AC's

This MR closes #20 (closed) and fulfills its AC's, which were:

GIVEN a channel #red-alert on phone number +1-666-666-6666

  • AND a hard-coded admin, alice, of that group with a different phone number
  • AND two hard-coded members of that group, bob and cassie (also with different phone numbers)
  • WHEN alice sends the signal message "hello world!" to +1-666...
  • THEN alice, bob, and cassie will all receive a signal message reading "hello world!" from +1-666...

GIVEN the above

  • WHEN bob sends any message to +1-666...
  • THEN nobody sees it
  • AND THEN bob receives an error message telling him that non-admins cannot send messages

Implementation Notes

  • add #onReceivedMessage method to signalDbusInterface
    • listens for MessageReceived events from signal-cli dbus
    • passes message, sender, and timestamp to handler
  • refactor relay service to:
    • register this event listener
    • pass a handler that:
      • filters whether the sender was an admin or not (by reading hard-coded json)
      • if admin relays the message to members (from hard-coded json)
      • if not admin sends error message

SIDE-EFFECTS:

  • strip vestigal bash scripts
  • strip vestigal /relay endpoint from run.js

BLACKBOX LOG:

  • registered in blackbox: members.json
  • registered in blackbox: admins.json
Edited by aguestuser

Merge request reports