session-info

This commit is contained in:
2022-08-12 15:50:59 +03:00
parent 0873304068
commit 9c60318919
4 changed files with 21 additions and 20 deletions

View File

@@ -36,7 +36,7 @@ class MessageResult:
self.status = status
self.message = message
async def get_inbox_counter(user_slug):
async def get_unread_counter(user_slug):
chats = await redis.execute("GET", f"chats_by_user/{user_slug}")
if not chats:
return 0
@@ -250,13 +250,8 @@ async def mark_as_read(_, info, chatId, ids):
return {}
@subscription.source("chatUpdated")
@login_required
async def message_generator(obj, info, chatId):
#TODO: send AUTH header
#auth = info.context["request"].auth
#if not auth.logged_in:
# yield {"error" : auth.error_message or "Please login"}
try:
following_chat = ChatFollowing(chatId)
await MessagesStorage.register_chat(following_chat)