Kicked from group status
Restrict writing in kicked groups
This commit is contained in:
parent
38daa43ad8
commit
365b30f888
@ -482,6 +482,7 @@ const lang = {
|
||||
"formatDateAtTime": "%1$s at %2$s",
|
||||
"JoinByPeekChannelTitle": "Join Channel",
|
||||
"JoinByPeekGroupTitle": "Join Group",
|
||||
"YouWereKicked": "you were removed",
|
||||
|
||||
// * macos
|
||||
"AccountSettings.Filters": "Chat Folders",
|
||||
|
@ -4454,9 +4454,9 @@ export class AppMessagesManager {
|
||||
|
||||
public canWriteToPeer(peerId: number, threadId?: number) {
|
||||
if(peerId < 0) {
|
||||
const isChannel = appPeersManager.isChannel(peerId);
|
||||
const hasRights = isChannel && appChatsManager.hasRights(-peerId, 'send_messages', undefined, !!threadId);
|
||||
return !isChannel || hasRights;
|
||||
//const isChannel = appPeersManager.isChannel(peerId);
|
||||
const hasRights = /* isChannel && */appChatsManager.hasRights(-peerId, 'send_messages', undefined, !!threadId);
|
||||
return /* !isChannel || */hasRights;
|
||||
} else {
|
||||
return appUsersManager.canSendToUser(peerId);
|
||||
}
|
||||
|
@ -465,7 +465,11 @@ export class AppProfileManager {
|
||||
}
|
||||
|
||||
public getChatMembersString(id: number) {
|
||||
const chat = appChatsManager.getChat(id);
|
||||
const chat: Chat = appChatsManager.getChat(id);
|
||||
if(chat._ === 'chatForbidden') {
|
||||
return i18n('YouWereKicked');
|
||||
}
|
||||
|
||||
const chatFull = this.chatsFull[id];
|
||||
let count: number;
|
||||
if(chatFull) {
|
||||
@ -475,7 +479,7 @@ export class AppProfileManager {
|
||||
count = (chatFull.participants as ChatParticipants.chatParticipants).participants?.length;
|
||||
}
|
||||
} else {
|
||||
count = chat.participants_count || chat.participants?.participants.length;
|
||||
count = (chat as Chat.chat).participants_count || (chat as any).participants?.participants.length;
|
||||
}
|
||||
|
||||
const isChannel = appChatsManager.isBroadcast(id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user