From ffc373db620aaa3b76a4d54178fc68f1e991dfc2 Mon Sep 17 00:00:00 2001 From: retoor Date: Sun, 25 May 2025 12:30:43 +0200 Subject: [PATCH] Channel support. --- src/snek/app.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/snek/app.py b/src/snek/app.py index e2273ab..c092b41 100644 --- a/src/snek/app.py +++ b/src/snek/app.py @@ -56,6 +56,7 @@ from snek.view.upload import UploadView from snek.view.user import UserView from snek.view.web import WebView from snek.view.channel import ChannelAttachmentView +from snek.view.channel import ChannelView from snek.view.settings.containers import ContainersIndexView, ContainersCreateView, ContainersUpdateView, ContainersDeleteView from snek.webdav import WebdavApplication from snek.sgit import GitApplication @@ -221,6 +222,7 @@ class Application(BaseApplication): self.router.add_get("/http-get", self.handle_http_get) self.router.add_get("/http-photo", self.handle_http_photo) self.router.add_get("/rpc.ws", RPCView) + self.router.add_get("/c/{channel:.*}", ChannelView) self.router.add_view("/channel/{channel_uid}/attachment.bin",ChannelAttachmentView) self.router.add_view("/channel/attachment/{relative_url:.*}",ChannelAttachmentView) self.router.add_view("/channel/{channel}.html", WebView) @@ -277,11 +279,14 @@ class Application(BaseApplication): async for subscribed_channel in self.services.channel_member.find( user_uid=request.session.get("uid"), deleted_at=None, is_banned=False ): + + parent_object = await subscribed_channel.get_channel() + item = {} other_user = await self.services.channel_member.get_other_dm_user( subscribed_channel["channel_uid"], request.session.get("uid") ) - parent_object = await subscribed_channel.get_channel() + last_message = await parent_object.get_last_message() color = None if last_message: