Update to 8.2.1 (2462)

This commit is contained in:
xaxtix 2021-11-05 13:06:49 +03:00
parent 09f95ec069
commit 1d379b9a7b
141 changed files with 11475 additions and 5394 deletions

View file

@ -1490,6 +1490,10 @@ public class ChatObject {
return (chat instanceof TLRPC.TL_channel || chat instanceof TLRPC.TL_channelForbidden) && chat.megagroup;
}
public static boolean isChannelAndNotMegaGroup(TLRPC.Chat chat) {
return isChannel(chat) && !isMegagroup(chat);
}
public static boolean isMegagroup(int currentAccount, long chatId) {
TLRPC.Chat chat = MessagesController.getInstance(currentAccount).getChat(chatId);
return ChatObject.isChannel(chat) && chat.megagroup;
@ -1569,6 +1573,11 @@ public class ChatObject {
return chat instanceof TLRPC.TL_channel || chat instanceof TLRPC.TL_channelForbidden;
}
public static boolean isChannelAndNotMegaGroup(long chatId, int currentAccount) {
TLRPC.Chat chat = MessagesController.getInstance(currentAccount).getChat(chatId);
return isChannelAndNotMegaGroup(chat);
}
public static boolean isCanWriteToChannel(long chatId, int currentAccount) {
TLRPC.Chat chat = MessagesController.getInstance(currentAccount).getChat(chatId);
return ChatObject.canSendMessages(chat) || chat.megagroup;