feat(message): add conversation notification mute feature
Add notification mute functionality for conversations with the following changes: - Add notification_muted field to ConversationResponse and related DTOs - Add notificationMutedMap to message store for tracking mute state - Add setConversationNotificationMuted API method - Integrate mute toggle in GroupInfoScreen and PrivateChatInfoScreen - Skip system notifications for muted conversations - Suppress vibration for muted conversations in WS handler - Clean up selected mentions when @mentions are removed from text Chore changes: - Update PostCard bookmark icon from 'bookmark' to 'star' - Refine card styles across AppsScreen, MaterialsScreen, and SubjectMaterialsScreen - Improve week selector scrolling to center selected week in ScheduleScreen
This commit is contained in:
@@ -705,8 +705,25 @@ export const useChatScreen = (props?: ChatScreenProps) => {
|
||||
} else {
|
||||
setActivePanel('none');
|
||||
}
|
||||
|
||||
if (selectedMentions.length > 0) {
|
||||
const stillPresent = selectedMentions.filter(userId => {
|
||||
const member = groupMembers.find(m => m.user_id === userId);
|
||||
const nickname = member?.nickname || member?.user?.nickname;
|
||||
if (!nickname) return false;
|
||||
const escapedName = nickname.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
return new RegExp(`@${escapedName}(\\s|$)`, 'g').test(text);
|
||||
});
|
||||
if (stillPresent.length !== selectedMentions.length) {
|
||||
setSelectedMentions(stillPresent);
|
||||
}
|
||||
}
|
||||
|
||||
if (mentionAll && !text.includes('@所有人')) {
|
||||
setMentionAll(false);
|
||||
}
|
||||
}
|
||||
}, [isGroupChat]);
|
||||
}, [isGroupChat, selectedMentions, mentionAll, groupMembers]);
|
||||
|
||||
// 【改造】获取发送者信息(群聊)- 优先从消息的 sender 字段获取
|
||||
const getSenderInfo = useCallback((senderId: string): SenderInfo => {
|
||||
|
||||
Reference in New Issue
Block a user