fixes
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import json
|
||||
from datetime import datetime, timezone
|
||||
from services.auth import login_required
|
||||
from services.presence import notify_message
|
||||
from services.redis import redis
|
||||
from resolvers import mutation
|
||||
|
||||
@@ -53,11 +54,7 @@ async def create_message(_, info, chat: str, body: str, reply_to=None):
|
||||
# await FollowingManager.push("chat", result)
|
||||
|
||||
# subscribe on updates
|
||||
channel_name = (
|
||||
f"chat:{chat['id']}" if not chat["title"] else f"group:{chat['id']}"
|
||||
)
|
||||
new_message["kind"] = "new_message"
|
||||
await redis.execute_pubsub("PUBLISH", channel_name, json.dumps(new_message))
|
||||
await notify_message(new_message, chat["id"])
|
||||
|
||||
return {"message": new_message, "error": None}
|
||||
|
||||
|
Reference in New Issue
Block a user