本文整理汇总了Java中org.telegram.tgnet.TLRPC.TL_messageMediaWebPage方法的典型用法代码示例。如果您正苦于以下问题:Java TLRPC.TL_messageMediaWebPage方法的具体用法?Java TLRPC.TL_messageMediaWebPage怎么用?Java TLRPC.TL_messageMediaWebPage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.telegram.tgnet.TLRPC
的用法示例。
在下文中一共展示了TLRPC.TL_messageMediaWebPage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFileName
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public String getFileName() {
if (messageOwner.media instanceof TLRPC.TL_messageMediaDocument) {
return FileLoader.getAttachFileName(messageOwner.media.document);
} else if (messageOwner.media instanceof TLRPC.TL_messageMediaPhoto) {
ArrayList<TLRPC.PhotoSize> sizes = messageOwner.media.photo.sizes;
if (sizes.size() > 0) {
TLRPC.PhotoSize sizeFull = FileLoader.getClosestPhotoSizeWithSize(sizes, AndroidUtilities.getPhotoSize());
if (sizeFull != null) {
return FileLoader.getAttachFileName(sizeFull);
}
}
} else if (messageOwner.media instanceof TLRPC.TL_messageMediaWebPage) {
return FileLoader.getAttachFileName(messageOwner.media.webpage.document);
}
return "";
}
示例2: generateLinkDescription
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void generateLinkDescription() {
if (linkDescription != null) {
return;
}
if (messageOwner.media instanceof TLRPC.TL_messageMediaWebPage && messageOwner.media.webpage instanceof TLRPC.TL_webPage && messageOwner.media.webpage.description != null) {
linkDescription = Spannable.Factory.getInstance().newSpannable(messageOwner.media.webpage.description);
if (containsUrls(linkDescription)) {
try {
Linkify.addLinks((Spannable) linkDescription, Linkify.WEB_URLS);
} catch (Exception e) {
FileLog.e("tmessages", e);
}
}
linkDescription = Emoji.replaceEmoji(linkDescription, textPaint.getFontMetricsInt(), AndroidUtilities.dp(20), false);
}
}
示例3: checkNeedDrawShareButton
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private boolean checkNeedDrawShareButton(MessageObject messageObject) {
if (messageObject.type == 13) {
return false;
} else if (messageObject.messageOwner.fwd_from != null && messageObject.messageOwner.fwd_from.channel_id != 0 && !messageObject.isOut()) {
return true;
} else if (messageObject.isFromUser()) {
if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaEmpty || messageObject.messageOwner.media == null || messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaWebPage && !(messageObject.messageOwner.media.webpage instanceof TLRPC.TL_webPage)) {
return false;
}
TLRPC.User user = MessagesController.getInstance().getUser(messageObject.messageOwner.from_id);
if (user != null && user.bot) {
return true;
}
if (messageObject.isMegagroup() && !messageObject.isOut()) {
TLRPC.Chat chat = MessagesController.getInstance().getChat(messageObject.messageOwner.to_id.channel_id);
return chat != null && chat.username != null && chat.username.length() > 0 && !(messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaContact) && !(messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaGeo);
}
} else if (messageObject.messageOwner.from_id < 0 || messageObject.messageOwner.post) {
if (messageObject.messageOwner.to_id.channel_id != 0 && (messageObject.messageOwner.via_bot_id == 0 && messageObject.messageOwner.reply_to_msg_id == 0 || messageObject.type != 13)) {
return true;
}
}
return false;
}
示例4: generateLinkDescription
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void generateLinkDescription() {
if (linkDescription != null) {
return;
}
if (messageOwner.media instanceof TLRPC.TL_messageMediaWebPage && messageOwner.media.webpage instanceof TLRPC.TL_webPage && messageOwner.media.webpage.description != null) {
linkDescription = Spannable.Factory.getInstance().newSpannable(messageOwner.media.webpage.description);
} else if (messageOwner.media instanceof TLRPC.TL_messageMediaGame && messageOwner.media.game.description != null) {
linkDescription = Spannable.Factory.getInstance().newSpannable(messageOwner.media.game.description);
}
if (linkDescription != null) {
if (containsUrls(linkDescription)) {
try {
Linkify.addLinks((Spannable) linkDescription, Linkify.WEB_URLS);
} catch (Exception e) {
FileLog.e("tmessages", e);
}
}
linkDescription = Emoji.replaceEmoji(linkDescription, textPaint.getFontMetricsInt(), AndroidUtilities.dp(20), false);
}
}
示例5: 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;
}
示例6: checkNeedDrawShareButton
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private boolean checkNeedDrawShareButton(MessageObject messageObject) {
if (messageObject.type == 13) {
return false;
} else if (messageObject.messageOwner.fwd_from != null && messageObject.messageOwner.fwd_from.channel_id != 0 && !messageObject.isOut()) {
return true;
} else if (messageObject.isFromUser()) {
if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaEmpty || messageObject.messageOwner.media == null || messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaWebPage && !(messageObject.messageOwner.media.webpage instanceof TLRPC.TL_webPage)) {
return false;
}
TLRPC.User user = MessagesController.getInstance().getUser(messageObject.messageOwner.from_id);
if (user != null && user.bot) {
return true;
}
if (!messageObject.isOut()) {
if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaGame) {
return true;
}
if (messageObject.isMegagroup()) {
TLRPC.Chat chat = MessagesController.getInstance().getChat(messageObject.messageOwner.to_id.channel_id);
return chat != null && chat.username != null && chat.username.length() > 0 && !(messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaContact) && !(messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaGeo);
}
}
} else if (messageObject.messageOwner.from_id < 0 || messageObject.messageOwner.post) {
if (messageObject.messageOwner.to_id.channel_id != 0 && (messageObject.messageOwner.via_bot_id == 0 && messageObject.messageOwner.reply_to_msg_id == 0 || messageObject.type != 13)) {
return true;
}
}
return false;
}
示例7: checkNeedDrawShareButton
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
protected boolean checkNeedDrawShareButton(MessageObject messageObject) {
if (messageObject.isFromUser()) {
TLRPC.User user = MessagesController.getInstance().getUser(messageObject.messageOwner.from_id);
if (user != null && user.bot && messageObject.type != 13 && !(messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaEmpty || messageObject.messageOwner.media == null
|| messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaWebPage && !(messageObject.messageOwner.media.webpage instanceof TLRPC.TL_webPage))) {
return true;
}
} else if (messageObject.messageOwner.from_id < 0 || messageObject.messageOwner.post) {
if (messageObject.messageOwner.to_id.channel_id != 0 && (messageObject.messageOwner.via_bot_id == 0 && messageObject.messageOwner.reply_to_msg_id == 0 || messageObject.type != 13)) {
return true;
}
}
return false;
}
示例8: 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;
}
示例9: getDocument
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public TLRPC.Document getDocument() {
if (messageOwner.media instanceof TLRPC.TL_messageMediaWebPage) {
return messageOwner.media.webpage.document;
}
return messageOwner.media != null ? messageOwner.media.document : null;
}
示例10: isMusicMessage
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static boolean isMusicMessage(TLRPC.Message message) {
if (message.media instanceof TLRPC.TL_messageMediaWebPage) {
return isMusicDocument(message.media.webpage.document);
}
return message.media != null && message.media.document != null && isMusicDocument(message.media.document);
}
示例11: isVoiceMessage
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static boolean isVoiceMessage(TLRPC.Message message) {
if (message.media instanceof TLRPC.TL_messageMediaWebPage) {
return isVoiceDocument(message.media.webpage.document);
}
return message.media != null && message.media.document != null && isVoiceDocument(message.media.document);
}
示例12: isVideoMessage
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static boolean isVideoMessage(TLRPC.Message message) {
if (message.media instanceof TLRPC.TL_messageMediaWebPage) {
return isVideoDocument(message.media.webpage.document);
}
return message.media != null && message.media.document != null && isVideoDocument(message.media.document);
}
示例13: isWebpageDocument
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public boolean isWebpageDocument() {
return messageOwner.media instanceof TLRPC.TL_messageMediaWebPage && messageOwner.media.webpage.document != null && !isGifDocument(messageOwner.media.webpage.document);
}
示例14: isMediaEmpty
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static boolean isMediaEmpty(TLRPC.Message message) {
return message == null || message.media == null || message.media instanceof TLRPC.TL_messageMediaEmpty || message.media instanceof TLRPC.TL_messageMediaWebPage;
}
示例15: isNewGifMessage
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static boolean isNewGifMessage(TLRPC.Message message) {
if (message.media instanceof TLRPC.TL_messageMediaWebPage) {
return isNewGifDocument(message.media.webpage.document);
}
return message.media != null && message.media.document != null && isNewGifDocument(message.media.document);
}