Chat: Fix applying unban (#6075)

This commit is contained in:
zubiden 2025-07-25 19:34:51 +02:00 committed by Alexander Zinchuk
parent 5c15869a40
commit 155c62e1b8
2 changed files with 12 additions and 14 deletions

View File

@ -192,7 +192,7 @@ function buildApiChatPermissions(peerEntity: GramJs.TypeUser | GramJs.TypeChat):
};
}
function buildApiChatRestrictions(peerEntity: GramJs.TypeUser | GramJs.TypeChat): {
function buildApiChatRestrictions(peerEntity: Entity): {
isNotJoined?: boolean;
isForbidden?: boolean;
isRestricted?: boolean;
@ -212,17 +212,13 @@ function buildApiChatRestrictions(peerEntity: GramJs.TypeUser | GramJs.TypeChat)
const restrictions = {};
if ('restricted' in peerEntity) {
const restrictionReason = peerEntity.restricted
? buildApiChatRestrictionReason(peerEntity.restrictionReason)
: undefined;
if ('restricted' in peerEntity && !peerEntity.min) {
const restrictionReason = buildApiChatRestrictionReason(peerEntity.restrictionReason);
if (restrictionReason) {
Object.assign(restrictions, {
isRestricted: true,
restrictionReason,
});
}
Object.assign(restrictions, {
isRestricted: peerEntity.restricted,
restrictionReason,
});
}
if (peerEntity instanceof GramJs.Chat) {

View File

@ -43,9 +43,11 @@ const ChatInviteModal = ({ modal }: OwnProps) => {
const handleAccept = useLastCallback(() => {
acceptChatInvite({ hash: hash! });
showNotification({
message: isBroadcast ? lang('RequestToJoinChannelSentDescription') : lang('RequestToJoinGroupSentDescription'),
});
if (isRequestNeeded) {
showNotification({
message: isBroadcast ? lang('RequestToJoinChannelSentDescription') : lang('RequestToJoinGroupSentDescription'),
});
}
handleClose();
});