本文整理汇总了Java中org.telegram.tgnet.TLRPC.TL_webPage方法的典型用法代码示例。如果您正苦于以下问题:Java TLRPC.TL_webPage方法的具体用法?Java TLRPC.TL_webPage怎么用?Java TLRPC.TL_webPage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.telegram.tgnet.TLRPC
的用法示例。
在下文中一共展示了TLRPC.TL_webPage方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例2: 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;
}
示例3: 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);
}
}
示例4: 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;
}
示例5: 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;
}
示例6: isUserDataChanged
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private boolean isUserDataChanged() {
if (currentMessageObject != null && (!hasLinkPreview && currentMessageObject.messageOwner.media != null && currentMessageObject.messageOwner.media.webpage instanceof TLRPC.TL_webPage)) {
return true;
}
if (currentMessageObject == null || currentUser == null && currentChat == null) {
return false;
}
if (lastSendState != currentMessageObject.messageOwner.send_state) {
return true;
}
if (lastDeleteDate != currentMessageObject.messageOwner.destroyTime) {
return true;
}
if (lastViewsCount != currentMessageObject.messageOwner.views) {
return true;
}
TLRPC.User newUser = null;
TLRPC.Chat newChat = null;
if (currentMessageObject.isFromUser()) {
newUser = MessagesController.getInstance().getUser(currentMessageObject.messageOwner.from_id);
} else if (currentMessageObject.messageOwner.from_id < 0) {
newChat = MessagesController.getInstance().getChat(-currentMessageObject.messageOwner.from_id);
} else if (currentMessageObject.messageOwner.post) {
newChat = MessagesController.getInstance().getChat(currentMessageObject.messageOwner.to_id.channel_id);
}
TLRPC.FileLocation newPhoto = null;
if (isAvatarVisible) {
if (newUser != null && newUser.photo != null){
newPhoto = newUser.photo.photo_small;
} else if (newChat != null && newChat.photo != null) {
newPhoto = newChat.photo.photo_small;
}
}
if (replyTextLayout == null && currentMessageObject.replyMessageObject != null) {
return true;
}
if (currentPhoto == null && newPhoto != null || currentPhoto != null && newPhoto == null || currentPhoto != null && newPhoto != null && (currentPhoto.local_id != newPhoto.local_id || currentPhoto.volume_id != newPhoto.volume_id)) {
return true;
}
TLRPC.FileLocation newReplyPhoto = null;
if (currentMessageObject.replyMessageObject != null) {
TLRPC.PhotoSize photoSize = FileLoader.getClosestPhotoSizeWithSize(currentMessageObject.replyMessageObject.photoThumbs, 80);
if (photoSize != null && currentMessageObject.replyMessageObject.type != 13) {
newReplyPhoto = photoSize.location;
}
}
if (currentReplyPhoto == null && newReplyPhoto != null) {
return true;
}
String newNameString = null;
if (drawName && isChat && !currentMessageObject.isOutOwner()) {
if (newUser != null) {
newNameString = UserObject.getUserName(newUser);
} else if (newChat != null) {
newNameString = newChat.title;
}
}
if (currentNameString == null && newNameString != null || currentNameString != null && newNameString == null || currentNameString != null && newNameString != null && !currentNameString.equals(newNameString)) {
return true;
}
if (drawForwardedName) {
newNameString = currentMessageObject.getForwardedName();
return currentForwardNameString == null && newNameString != null || currentForwardNameString != null && newNameString == null || currentForwardNameString != null && newNameString != null && !currentForwardNameString.equals(newNameString);
}
return false;
}