Skip to content

Commit

Permalink
announcements: push notification for internal announcements
Browse files Browse the repository at this point in the history
Signed-off-by:  Eric Callahan <[email protected]>
  • Loading branch information
Arksine committed Feb 7, 2024
1 parent f946e6a commit 67c98f6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions moonraker/components/announcements.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,15 @@ def add_internal_announcement(
"feed": feed
}
self.entry_mgr.add_entry(entry)
self.eventloop.create_task(self._notify_internal())
return entry

async def _notify_internal(self) -> None:
entries = await self.entry_mgr.list_entries()
self.server.send_event(
"announcements:entries_updated", {"entries": entries}
)

async def remove_announcement(self, entry_id: str) -> None:
ret = await self.entry_mgr.remove_entry(entry_id)
if ret is not None:
Expand Down

0 comments on commit 67c98f6

Please sign in to comment.