- add chat_notification_settings table and migration - add chat notifications API (get/update muted) - skip message notifications for muted recipients - add mute/unmute control in chat info panel
This commit is contained in:
@@ -3,7 +3,7 @@ import re
|
||||
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from app.chats.repository import list_chat_members
|
||||
from app.chats.repository import is_chat_muted_for_user, list_chat_members
|
||||
from app.messages.models import Message
|
||||
from app.notifications.repository import create_notification_log, list_user_notifications
|
||||
from app.notifications.schemas import NotificationRead, NotificationRequest
|
||||
@@ -44,6 +44,8 @@ async def dispatch_message_notifications(db: AsyncSession, message: Message) ->
|
||||
sender_name = sender_users[0].username if sender_users else "Someone"
|
||||
|
||||
for recipient in users:
|
||||
if await is_chat_muted_for_user(db, chat_id=message.chat_id, user_id=recipient.id):
|
||||
continue
|
||||
base_payload = {
|
||||
"chat_id": message.chat_id,
|
||||
"message_id": message.id,
|
||||
|
||||
Reference in New Issue
Block a user