This commit is contained in:
2026-04-25 16:36:34 +08:00
commit db90e7579b
1876 changed files with 189777 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import { useAppSelector } from './useAppSelector';
/**
* 获取用户禁言状态
* @param groupId 群组ID
* @param userId 用户ID
* @returns 如果没有禁言状态或者有禁言但是已过期则返回false否则返回禁言到的时间
*/
export function useGroupMemberMute(
groupId: string,
userId: string
): string | false {
const muteUntil = useAppSelector(
(state) =>
state.group.groups[groupId]?.members.find((m) => m.userId === userId)
?.muteUntil
);
if (!muteUntil || new Date(muteUntil).valueOf() < new Date().valueOf()) {
return false;
}
return muteUntil;
}