本文整理汇总了Java中org.telegram.tgnet.TLRPC.TL_messageActionEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java TLRPC.TL_messageActionEmpty方法的具体用法?Java TLRPC.TL_messageActionEmpty怎么用?Java TLRPC.TL_messageActionEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.telegram.tgnet.TLRPC
的用法示例。
在下文中一共展示了TLRPC.TL_messageActionEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: canEditMessage
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static boolean canEditMessage(TLRPC.Message message, TLRPC.Chat chat) {
if (message == null || message.to_id == null || message.action != null && !(message.action instanceof TLRPC.TL_messageActionEmpty) || isForwardedMessage(message) || message.via_bot_id != 0 || message.id < 0 || Math.abs(message.date - ConnectionsManager.getInstance().getCurrentTime()) > MessagesController.getInstance().maxEditTime) {
return false;
}
if (message.to_id.channel_id == 0) {
return message.out && (message.media instanceof TLRPC.TL_messageMediaPhoto ||
message.media instanceof TLRPC.TL_messageMediaDocument && !isStickerMessage(message) ||
message.media instanceof TLRPC.TL_messageMediaEmpty ||
message.media instanceof TLRPC.TL_messageMediaWebPage ||
message.media == null);
}
if (chat == null && message.to_id.channel_id != 0) {
chat = MessagesController.getInstance().getChat(message.to_id.channel_id);
if (chat == null) {
return false;
}
}
if (chat.megagroup && message.out || !chat.megagroup && (chat.creator || chat.editor && isOut(message)) && message.post) {
if (message.media instanceof TLRPC.TL_messageMediaPhoto ||
message.media instanceof TLRPC.TL_messageMediaDocument && !isStickerMessage(message) ||
message.media instanceof TLRPC.TL_messageMediaEmpty ||
message.media instanceof TLRPC.TL_messageMediaWebPage ||
message.media == null) {
return true;
}
}
return false;
}
示例2: canEditMessage
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static boolean canEditMessage(TLRPC.Message message, TLRPC.Chat chat) {
if (message == null || message.to_id == null || message.action != null && !(message.action instanceof TLRPC.TL_messageActionEmpty) || isForwardedMessage(message) || message.via_bot_id != 0 || message.id < 0) {
return false;
}
if (message.from_id == message.to_id.user_id && message.from_id == UserConfig.getClientUserId()) {
return true;
}
if (Math.abs(message.date - ConnectionsManager.getInstance().getCurrentTime()) > MessagesController.getInstance().maxEditTime) {
return false;
}
if (message.to_id.channel_id == 0) {
return (message.out || message.from_id == UserConfig.getClientUserId()) && (message.media instanceof TLRPC.TL_messageMediaPhoto ||
message.media instanceof TLRPC.TL_messageMediaDocument && !isStickerMessage(message) ||
message.media instanceof TLRPC.TL_messageMediaEmpty ||
message.media instanceof TLRPC.TL_messageMediaWebPage ||
message.media == null);
}
if (chat == null && message.to_id.channel_id != 0) {
chat = MessagesController.getInstance().getChat(message.to_id.channel_id);
if (chat == null) {
return false;
}
}
if (chat.megagroup && message.out || !chat.megagroup && (chat.creator || chat.editor && isOut(message)) && message.post) {
if (message.media instanceof TLRPC.TL_messageMediaPhoto ||
message.media instanceof TLRPC.TL_messageMediaDocument && !isStickerMessage(message) ||
message.media instanceof TLRPC.TL_messageMediaEmpty ||
message.media instanceof TLRPC.TL_messageMediaWebPage ||
message.media == null) {
return true;
}
}
return false;
}
示例3: isPersonalMessage
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private boolean isPersonalMessage(MessageObject messageObject) {
return messageObject.messageOwner.to_id != null && messageObject.messageOwner.to_id.chat_id == 0 && messageObject.messageOwner.to_id.channel_id == 0
&& (messageObject.messageOwner.action == null || messageObject.messageOwner.action instanceof TLRPC.TL_messageActionEmpty);
}