more-fixes
This commit is contained in:
parent
8cac67986c
commit
8c87457a09
|
@ -21,7 +21,7 @@ async def create_message(_, info, chat: str, body: str, reply_to=None):
|
||||||
if not chat:
|
if not chat:
|
||||||
return {"error": "chat is not exist"}
|
return {"error": "chat is not exist"}
|
||||||
else:
|
else:
|
||||||
chat = dict(json.loads(chat))
|
chat = vars(json.loads(chat))
|
||||||
message_id = await redis.execute("GET", f"chats/{chat['id']}/next_message_id")
|
message_id = await redis.execute("GET", f"chats/{chat['id']}/next_message_id")
|
||||||
message_id = int(message_id)
|
message_id = int(message_id)
|
||||||
new_message = {
|
new_message = {
|
||||||
|
|
|
@ -7,7 +7,7 @@ from services.auth import login_required
|
||||||
async def get_unread_counter(chat_id: str, author_id: int):
|
async def get_unread_counter(chat_id: str, author_id: int):
|
||||||
try:
|
try:
|
||||||
unread = await redis.execute(
|
unread = await redis.execute(
|
||||||
"LLEN", f"chats/{chat_id.decode('utf-8')}/unread/{author_id}"
|
"LLEN", f"chats/{chat_id}/unread/{author_id}"
|
||||||
)
|
)
|
||||||
if unread:
|
if unread:
|
||||||
return unread
|
return unread
|
||||||
|
|
Loading…
Reference in New Issue
Block a user