conn.py 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # mautrix-signal - A Matrix-Signal puppeting bridge
  2. # Copyright (C) 2020 Tulir Asokan
  3. #
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU Affero General Public License as published by
  6. # the Free Software Foundation, either version 3 of the License, or
  7. # (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU Affero General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU Affero General Public License
  15. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. from . import command_handler, CommandEvent, SECTION_CONNECTION
  17. @command_handler(needs_auth=False, management_only=True, help_section=SECTION_CONNECTION,
  18. help_text="Mark this room as your bridge notice room")
  19. async def set_notice_room(evt: CommandEvent) -> None:
  20. evt.sender.notice_room = evt.room_id
  21. await evt.sender.update()
  22. await evt.reply("This room has been marked as your bridge notice room")
  23. # @command_handler(needs_auth=False, management_only=True, help_section=SECTION_CONNECTION,
  24. # help_text="Check if you're logged into Twitter")
  25. # async def ping(evt: CommandEvent) -> None:
  26. # if evt.sender.username:
  27. # await evt.reply("")
  28. # user_info = await evt.sender.get_info()
  29. # await evt.reply(f"You're logged in as {user_info.name} "
  30. # f"([@{evt.sender.username}](https://twitter.com/{evt.sender.username}), "
  31. # f"user ID: {evt.sender.twid})")
  32. # TODO request syncs or something
  33. # @command_handler(needs_auth=True, management_only=False, help_section=SECTION_CONNECTION,
  34. # help_text="Synchronize portals")
  35. # async def sync(evt: CommandEvent) -> None:
  36. # await evt.sender.sync()
  37. # await evt.reply("Synchronization complete")