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",
|
"formatDateAtTime": "%1$s at %2$s",
|
||||||
"JoinByPeekChannelTitle": "Join Channel",
|
"JoinByPeekChannelTitle": "Join Channel",
|
||||||
"JoinByPeekGroupTitle": "Join Group",
|
"JoinByPeekGroupTitle": "Join Group",
|
||||||
|
"YouWereKicked": "you were removed",
|
||||||
|
|
||||||
// * macos
|
// * macos
|
||||||
"AccountSettings.Filters": "Chat Folders",
|
"AccountSettings.Filters": "Chat Folders",
|
||||||
|
@ -4454,9 +4454,9 @@ export class AppMessagesManager {
|
|||||||
|
|
||||||
public canWriteToPeer(peerId: number, threadId?: number) {
|
public canWriteToPeer(peerId: number, threadId?: number) {
|
||||||
if(peerId < 0) {
|
if(peerId < 0) {
|
||||||
const isChannel = appPeersManager.isChannel(peerId);
|
//const isChannel = appPeersManager.isChannel(peerId);
|
||||||
const hasRights = isChannel && appChatsManager.hasRights(-peerId, 'send_messages', undefined, !!threadId);
|
const hasRights = /* isChannel && */appChatsManager.hasRights(-peerId, 'send_messages', undefined, !!threadId);
|
||||||
return !isChannel || hasRights;
|
return /* !isChannel || */hasRights;
|
||||||
} else {
|
} else {
|
||||||
return appUsersManager.canSendToUser(peerId);
|
return appUsersManager.canSendToUser(peerId);
|
||||||
}
|
}
|
||||||
|
@ -465,7 +465,11 @@ export class AppProfileManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getChatMembersString(id: number) {
|
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];
|
const chatFull = this.chatsFull[id];
|
||||||
let count: number;
|
let count: number;
|
||||||
if(chatFull) {
|
if(chatFull) {
|
||||||
@ -475,7 +479,7 @@ export class AppProfileManager {
|
|||||||
count = (chatFull.participants as ChatParticipants.chatParticipants).participants?.length;
|
count = (chatFull.participants as ChatParticipants.chatParticipants).participants?.length;
|
||||||
}
|
}
|
||||||
} else {
|
} 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);
|
const isChannel = appChatsManager.isBroadcast(id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user