Chat: Fix applying unban (#6075)
This commit is contained in:
parent
5c15869a40
commit
155c62e1b8
@ -192,7 +192,7 @@ function buildApiChatPermissions(peerEntity: GramJs.TypeUser | GramJs.TypeChat):
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildApiChatRestrictions(peerEntity: GramJs.TypeUser | GramJs.TypeChat): {
|
function buildApiChatRestrictions(peerEntity: Entity): {
|
||||||
isNotJoined?: boolean;
|
isNotJoined?: boolean;
|
||||||
isForbidden?: boolean;
|
isForbidden?: boolean;
|
||||||
isRestricted?: boolean;
|
isRestricted?: boolean;
|
||||||
@ -212,17 +212,13 @@ function buildApiChatRestrictions(peerEntity: GramJs.TypeUser | GramJs.TypeChat)
|
|||||||
|
|
||||||
const restrictions = {};
|
const restrictions = {};
|
||||||
|
|
||||||
if ('restricted' in peerEntity) {
|
if ('restricted' in peerEntity && !peerEntity.min) {
|
||||||
const restrictionReason = peerEntity.restricted
|
const restrictionReason = buildApiChatRestrictionReason(peerEntity.restrictionReason);
|
||||||
? buildApiChatRestrictionReason(peerEntity.restrictionReason)
|
|
||||||
: undefined;
|
|
||||||
|
|
||||||
if (restrictionReason) {
|
Object.assign(restrictions, {
|
||||||
Object.assign(restrictions, {
|
isRestricted: peerEntity.restricted,
|
||||||
isRestricted: true,
|
restrictionReason,
|
||||||
restrictionReason,
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peerEntity instanceof GramJs.Chat) {
|
if (peerEntity instanceof GramJs.Chat) {
|
||||||
|
|||||||
@ -43,9 +43,11 @@ const ChatInviteModal = ({ modal }: OwnProps) => {
|
|||||||
const handleAccept = useLastCallback(() => {
|
const handleAccept = useLastCallback(() => {
|
||||||
acceptChatInvite({ hash: hash! });
|
acceptChatInvite({ hash: hash! });
|
||||||
|
|
||||||
showNotification({
|
if (isRequestNeeded) {
|
||||||
message: isBroadcast ? lang('RequestToJoinChannelSentDescription') : lang('RequestToJoinGroupSentDescription'),
|
showNotification({
|
||||||
});
|
message: isBroadcast ? lang('RequestToJoinChannelSentDescription') : lang('RequestToJoinGroupSentDescription'),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
handleClose();
|
handleClose();
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user