本文整理汇总了Java中org.telegram.tgnet.TLRPC.TL_channelForbidden方法的典型用法代码示例。如果您正苦于以下问题:Java TLRPC.TL_channelForbidden方法的具体用法?Java TLRPC.TL_channelForbidden怎么用?Java TLRPC.TL_channelForbidden使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.telegram.tgnet.TLRPC
的用法示例。
在下文中一共展示了TLRPC.TL_channelForbidden方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPeer
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static TLRPC.Peer getPeer(int id) {
TLRPC.Peer inputPeer;
if (id < 0) {
TLRPC.Chat chat = getInstance().getChat(-id);
if (chat instanceof TLRPC.TL_channel || chat instanceof TLRPC.TL_channelForbidden) {
inputPeer = new TLRPC.TL_peerChannel();
inputPeer.channel_id = -id;
} else {
inputPeer = new TLRPC.TL_peerChat();
inputPeer.chat_id = -id;
}
} else {
TLRPC.User user = getInstance().getUser(id);
inputPeer = new TLRPC.TL_peerUser();
inputPeer.user_id = id;
}
return inputPeer;
}
示例2: getInputChannel
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static TLRPC.InputChannel getInputChannel(TLRPC.Chat chat) {
if (chat instanceof TLRPC.TL_channel || chat instanceof TLRPC.TL_channelForbidden) {
TLRPC.InputChannel inputChat = new TLRPC.TL_inputChannel();
inputChat.channel_id = chat.id;
inputChat.access_hash = chat.access_hash;
return inputChat;
} else {
return new TLRPC.TL_inputChannelEmpty();
}
}
示例3: isLeftFromChat
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static boolean isLeftFromChat(TLRPC.Chat chat) {
return chat == null || chat instanceof TLRPC.TL_chatEmpty || chat instanceof TLRPC.TL_chatForbidden || chat instanceof TLRPC.TL_channelForbidden || chat.left || chat.deactivated;
}
示例4: isKickedFromChat
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static boolean isKickedFromChat(TLRPC.Chat chat) {
return chat == null || chat instanceof TLRPC.TL_chatEmpty || chat instanceof TLRPC.TL_chatForbidden || chat instanceof TLRPC.TL_channelForbidden || chat.kicked || chat.deactivated;
}
示例5: isNotInChat
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static boolean isNotInChat(TLRPC.Chat chat) {
return chat == null || chat instanceof TLRPC.TL_chatEmpty || chat instanceof TLRPC.TL_chatForbidden || chat instanceof TLRPC.TL_channelForbidden || chat.left || chat.kicked || chat.deactivated;
}
示例6: isChannel
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static boolean isChannel(TLRPC.Chat chat) {
return chat instanceof TLRPC.TL_channel || chat instanceof TLRPC.TL_channelForbidden;
}
示例7: updateBottomOverlay
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void updateBottomOverlay() {
if (bottomOverlayChatText == null) {
return;
}
if (currentChat != null) {
if (ChatObject.isChannel(currentChat) && !(currentChat instanceof TLRPC.TL_channelForbidden)) {
if (ChatObject.isNotInChat(currentChat)) {
bottomOverlayChatText.setText(LocaleController.getString("ChannelJoin", R.string.ChannelJoin));
} else {
if (!MessagesController.getInstance().isDialogMuted(dialog_id)) {
bottomOverlayChatText.setText(LocaleController.getString("ChannelMute", R.string.ChannelMute));
} else {
bottomOverlayChatText.setText(LocaleController.getString("ChannelUnmute", R.string.ChannelUnmute));
}
}
} else {
bottomOverlayChatText.setText(LocaleController.getString("DeleteThisGroup", R.string.DeleteThisGroup));
}
} else {
if (userBlocked) {
if (currentUser.bot) {
bottomOverlayChatText.setText(LocaleController.getString("BotUnblock", R.string.BotUnblock));
} else {
bottomOverlayChatText.setText(LocaleController.getString("Unblock", R.string.Unblock));
}
if (botButtons != null) {
botButtons = null;
if (chatActivityEnterView != null) {
if (replyingMessageObject != null && botReplyButtons == replyingMessageObject) {
botReplyButtons = null;
showReplyPanel(false, null, null, null, false, true);
}
chatActivityEnterView.setButtons(botButtons, false);
}
}
} else if (botUser != null && currentUser.bot) {
bottomOverlayChatText.setText(LocaleController.getString("BotStart", R.string.BotStart));
chatActivityEnterView.hidePopup(false);
if (getParentActivity() != null) {
AndroidUtilities.hideKeyboard(getParentActivity().getCurrentFocus());
}
} else {
bottomOverlayChatText.setText(LocaleController.getString("DeleteThisChat", R.string.DeleteThisChat));
}
}
if (searchItem != null && searchItem.getVisibility() == View.VISIBLE) {
searchContainer.setVisibility(View.VISIBLE);
bottomOverlayChat.setVisibility(View.INVISIBLE);
chatActivityEnterView.setFieldFocused(false);
chatActivityEnterView.setVisibility(View.INVISIBLE);
} else {
searchContainer.setVisibility(View.INVISIBLE);
if (currentChat != null && (ChatObject.isNotInChat(currentChat) || !ChatObject.canWriteToChat(currentChat)) ||
currentUser != null && (UserObject.isDeleted(currentUser) || userBlocked)) {
bottomOverlayChat.setVisibility(View.VISIBLE);
muteItem.setVisibility(View.GONE);
chatActivityEnterView.setFieldFocused(false);
chatActivityEnterView.setVisibility(View.INVISIBLE);
} else {
if (botUser != null && currentUser.bot) {
bottomOverlayChat.setVisibility(View.VISIBLE);
chatActivityEnterView.setVisibility(View.INVISIBLE);
} else {
chatActivityEnterView.setVisibility(View.VISIBLE);
bottomOverlayChat.setVisibility(View.INVISIBLE);
}
muteItem.setVisibility(View.VISIBLE);
}
}
checkRaiseSensors();
}
示例8: updateSubtitle
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void updateSubtitle() {
TLRPC.User user = parentFragment.getCurrentUser();
TLRPC.Chat chat = parentFragment.getCurrentChat();
CharSequence printString = MessagesController.getInstance().printingStrings.get(parentFragment.getDialogId());
if (printString != null) {
printString = TextUtils.replace(printString, new String[]{"..."}, new String[]{""});
}
if (printString == null || printString.length() == 0 || ChatObject.isChannel(chat) && !chat.megagroup) {
setTypingAnimation(false);
if (chat != null) {
TLRPC.ChatFull info = parentFragment.getCurrentChatInfo();
if (ChatObject.isChannel(chat)) {
if (!chat.broadcast && !chat.megagroup && !(chat instanceof TLRPC.TL_channelForbidden)) {
subtitleTextView.setText(LocaleController.getString("ShowDiscussion", R.string.ShowDiscussion));
if (radioButton != null && radioButton.getVisibility() != VISIBLE) {
radioButton.setVisibility(View.VISIBLE);
}
} else {
if (info != null && info.participants_count != 0) {
if (chat.megagroup && info.participants_count <= 200) {
if (onlineCount > 1 && info.participants_count != 0) {
subtitleTextView.setText(String.format("%s, %s", LocaleController.formatPluralString("Members", info.participants_count), LocaleController.formatPluralString("Online", onlineCount)));
} else {
subtitleTextView.setText(LocaleController.formatPluralString("Members", info.participants_count));
}
} else {
int result[] = new int[1];
String shortNumber = LocaleController.formatShortNumber(info.participants_count, result);
String text = LocaleController.formatPluralString("Members", result[0]).replace(String.format("%d", result[0]), shortNumber);
subtitleTextView.setText(text);
}
} else {
if (chat.megagroup) {
subtitleTextView.setText(LocaleController.getString("Loading", R.string.Loading).toLowerCase());
} else {
if ((chat.flags & TLRPC.CHAT_FLAG_IS_PUBLIC) != 0) {
subtitleTextView.setText(LocaleController.getString("ChannelPublic", R.string.ChannelPublic).toLowerCase());
} else {
subtitleTextView.setText(LocaleController.getString("ChannelPrivate", R.string.ChannelPrivate).toLowerCase());
}
}
}
if (radioButton != null && radioButton.getVisibility() != GONE) {
radioButton.setVisibility(View.GONE);
}
}
} else {
if (ChatObject.isKickedFromChat(chat)) {
subtitleTextView.setText(LocaleController.getString("YouWereKicked", R.string.YouWereKicked));
} else if (ChatObject.isLeftFromChat(chat)) {
subtitleTextView.setText(LocaleController.getString("YouLeft", R.string.YouLeft));
} else {
int count = chat.participants_count;
if (info != null) {
count = info.participants.participants.size();
}
if (onlineCount > 1 && count != 0) {
subtitleTextView.setText(String.format("%s, %s", LocaleController.formatPluralString("Members", count), LocaleController.formatPluralString("Online", onlineCount)));
} else {
subtitleTextView.setText(LocaleController.formatPluralString("Members", count));
}
}
}
} else if (user != null) {
user = MessagesController.getInstance().getUser(user.id);
String newStatus;
if (user.id == 333000 || user.id == 777000) {
newStatus = LocaleController.getString("ServiceNotifications", R.string.ServiceNotifications);
} else if (user.bot) {
newStatus = LocaleController.getString("Bot", R.string.Bot);
} else {
newStatus = LocaleController.formatUserStatus(user);
}
subtitleTextView.setText(newStatus);
}
} else {
subtitleTextView.setText(printString);
setTypingAnimation(true);
}
}