announcements: push notification for internal announcements
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
f946e6a28d
commit
67c98f6a76
|
@ -236,8 +236,15 @@ class Announcements:
|
||||||
"feed": feed
|
"feed": feed
|
||||||
}
|
}
|
||||||
self.entry_mgr.add_entry(entry)
|
self.entry_mgr.add_entry(entry)
|
||||||
|
self.eventloop.create_task(self._notify_internal())
|
||||||
return entry
|
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:
|
async def remove_announcement(self, entry_id: str) -> None:
|
||||||
ret = await self.entry_mgr.remove_entry(entry_id)
|
ret = await self.entry_mgr.remove_entry(entry_id)
|
||||||
if ret is not None:
|
if ret is not None:
|
||||||
|
|
Loading…
Reference in New Issue