当前位置: 首页>>代码示例>>Java>>正文


Java TLRPC.TL_decryptedMessageActionSetMessageTTL方法代码示例

本文整理汇总了Java中org.telegram.tgnet.TLRPC.TL_decryptedMessageActionSetMessageTTL方法的典型用法代码示例。如果您正苦于以下问题:Java TLRPC.TL_decryptedMessageActionSetMessageTTL方法的具体用法?Java TLRPC.TL_decryptedMessageActionSetMessageTTL怎么用?Java TLRPC.TL_decryptedMessageActionSetMessageTTL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.telegram.tgnet.TLRPC的用法示例。


在下文中一共展示了TLRPC.TL_decryptedMessageActionSetMessageTTL方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createServiceSecretMessage

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private TLRPC.TL_messageService createServiceSecretMessage(final TLRPC.EncryptedChat encryptedChat, TLRPC.DecryptedMessageAction decryptedMessage) {
    TLRPC.TL_messageService newMsg = new TLRPC.TL_messageService();

    newMsg.action = new TLRPC.TL_messageEncryptedAction();
    newMsg.action.encryptedAction = decryptedMessage;
    newMsg.local_id = newMsg.id = UserConfig.getNewMessageId();
    newMsg.from_id = UserConfig.getClientUserId();
    newMsg.unread = true;
    newMsg.out = true;
    newMsg.flags = TLRPC.MESSAGE_FLAG_HAS_FROM_ID;
    newMsg.dialog_id = ((long) encryptedChat.id) << 32;
    newMsg.to_id = new TLRPC.TL_peerUser();
    newMsg.send_state = MessageObject.MESSAGE_SEND_STATE_SENDING;
    if (encryptedChat.participant_id == UserConfig.getClientUserId()) {
        newMsg.to_id.user_id = encryptedChat.admin_id;
    } else {
        newMsg.to_id.user_id = encryptedChat.participant_id;
    }
    if (decryptedMessage instanceof TLRPC.TL_decryptedMessageActionScreenshotMessages || decryptedMessage instanceof TLRPC.TL_decryptedMessageActionSetMessageTTL) {
        newMsg.date = ConnectionsManager.getInstance().getCurrentTime();
    } else {
        newMsg.date = 0;
    }
    newMsg.random_id = SendMessagesHelper.getInstance().getNextRandomId();
    UserConfig.saveConfig(false);

    ArrayList<TLRPC.Message> arr = new ArrayList<>();
    arr.add(newMsg);
    MessagesStorage.getInstance().putMessages(arr, false, true, true, 0);

    return newMsg;
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:33,代码来源:SecretChatHelper.java

示例2: sendTTLMessage

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void sendTTLMessage(TLRPC.EncryptedChat encryptedChat, TLRPC.Message resendMessage) {
    if (!(encryptedChat instanceof TLRPC.TL_encryptedChat)) {
        return;
    }

    TLRPC.TL_decryptedMessageService reqSend;
    if (AndroidUtilities.getPeerLayerVersion(encryptedChat.layer) >= 17) {
        reqSend = new TLRPC.TL_decryptedMessageService();
    } else {
        reqSend = new TLRPC.TL_decryptedMessageService_layer8();
        reqSend.random_bytes = new byte[15];
        Utilities.random.nextBytes(reqSend.random_bytes);
    }

    TLRPC.Message message;

    if (resendMessage != null) {
        message = resendMessage;
        reqSend.action = message.action.encryptedAction;
    } else {
        reqSend.action = new TLRPC.TL_decryptedMessageActionSetMessageTTL();
        reqSend.action.ttl_seconds = encryptedChat.ttl;
        message = createServiceSecretMessage(encryptedChat, reqSend.action);

        MessageObject newMsgObj = new MessageObject(message, null, false);
        newMsgObj.messageOwner.send_state = MessageObject.MESSAGE_SEND_STATE_SENDING;
        ArrayList<MessageObject> objArr = new ArrayList<>();
        objArr.add(newMsgObj);
        MessagesController.getInstance().updateInterfaceWithMessages(message.dialog_id, objArr);
        NotificationCenter.getInstance().postNotificationName(NotificationCenter.dialogsNeedReload);
    }
    reqSend.random_id = message.random_id;

    performSendEncryptedRequest(reqSend, message, encryptedChat, null, null, null);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:36,代码来源:SecretChatHelper.java

示例3: setType

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void setType() {
    int oldType = type;
    if (messageOwner instanceof TLRPC.TL_message || messageOwner instanceof TLRPC.TL_messageForwarded_old2) {
        if (isMediaEmpty()) {
            type = 0;
            if (messageText == null || messageText.length() == 0) {
                messageText = "Empty message";
            }
        } else if (messageOwner.media instanceof TLRPC.TL_messageMediaPhoto) {
            type = 1;
        } else if (messageOwner.media instanceof TLRPC.TL_messageMediaGeo || messageOwner.media instanceof TLRPC.TL_messageMediaVenue) {
            type = 4;
        } else if (isVideo()) {
            type = 3;
        } else if (isVoice()) {
            type = 2;
        } else if (isMusic()) {
            type = 14;
        } else if (messageOwner.media instanceof TLRPC.TL_messageMediaContact) {
            type = 12;
        } else if (messageOwner.media instanceof TLRPC.TL_messageMediaUnsupported) {
            type = 0;
        } else if (messageOwner.media instanceof TLRPC.TL_messageMediaDocument) {
            if (messageOwner.media.document.mime_type != null) {
                if (isGifDocument(messageOwner.media.document)) {
                    type = 8;
                } else if (messageOwner.media.document.mime_type.equals("image/webp") && isSticker()) {
                    type = 13;
                } else {
                    type = 9;
                }
            } else {
                type = 9;
            }
        }
    } else if (messageOwner instanceof TLRPC.TL_messageService) {
        if (messageOwner.action instanceof TLRPC.TL_messageActionLoginUnknownLocation) {
            type = 0;
        } else if (messageOwner.action instanceof TLRPC.TL_messageActionChatEditPhoto || messageOwner.action instanceof TLRPC.TL_messageActionUserUpdatedPhoto) {
            contentType = 1;
            type = 11;
        } else if (messageOwner.action instanceof TLRPC.TL_messageEncryptedAction) {
            if (messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionScreenshotMessages || messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionSetMessageTTL) {
                contentType = 1;
                type = 10;
            } else {
                contentType = -1;
                type = -1;
            }
        } else if (messageOwner.action instanceof TLRPC.TL_messageActionHistoryClear) {
            contentType = -1;
            type = -1;
        } else {
            contentType = 1;
            type = 10;
        }
    }
    if (oldType != 1000 && oldType != type) {
        generateThumbs(false);
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:62,代码来源:MessageObject.java

示例4: retrySendMessage

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public boolean retrySendMessage(MessageObject messageObject, boolean unsent) {
    if (messageObject.getId() >= 0) {
        return false;
    }
    if (messageObject.messageOwner.action instanceof TLRPC.TL_messageEncryptedAction) {
        int enc_id = (int) (messageObject.getDialogId() >> 32);
        TLRPC.EncryptedChat encryptedChat = MessagesController.getInstance().getEncryptedChat(enc_id);
        if (encryptedChat == null) {
            MessagesStorage.getInstance().markMessageAsSendError(messageObject.messageOwner);
            messageObject.messageOwner.send_state = MessageObject.MESSAGE_SEND_STATE_SEND_ERROR;
            NotificationCenter.getInstance().postNotificationName(NotificationCenter.messageSendError, messageObject.getId());
            processSentMessage(messageObject.getId());
            return false;
        }
        if (messageObject.messageOwner.random_id == 0) {
            messageObject.messageOwner.random_id = getNextRandomId();
        }
        if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionSetMessageTTL) {
            SecretChatHelper.getInstance().sendTTLMessage(encryptedChat, messageObject.messageOwner);
        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionDeleteMessages) {
            SecretChatHelper.getInstance().sendMessagesDeleteMessage(encryptedChat, null, messageObject.messageOwner);
        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionFlushHistory) {
            SecretChatHelper.getInstance().sendClearHistoryMessage(encryptedChat, messageObject.messageOwner);
        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionNotifyLayer) {
            SecretChatHelper.getInstance().sendNotifyLayerMessage(encryptedChat, messageObject.messageOwner);
        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionReadMessages) {
            SecretChatHelper.getInstance().sendMessagesReadMessage(encryptedChat, null, messageObject.messageOwner);
        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionScreenshotMessages) {
            SecretChatHelper.getInstance().sendScreenshotMessage(encryptedChat, null, messageObject.messageOwner);
        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionTyping) {

        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionResend) {

        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionCommitKey) {
            SecretChatHelper.getInstance().sendCommitKeyMessage(encryptedChat, messageObject.messageOwner);
        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionAbortKey) {
            SecretChatHelper.getInstance().sendAbortKeyMessage(encryptedChat, messageObject.messageOwner, 0);
        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionRequestKey) {
            SecretChatHelper.getInstance().sendRequestKeyMessage(encryptedChat, messageObject.messageOwner);
        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionAcceptKey) {
            SecretChatHelper.getInstance().sendAcceptKeyMessage(encryptedChat, messageObject.messageOwner);
        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionNoop) {
            SecretChatHelper.getInstance().sendNoopMessage(encryptedChat, messageObject.messageOwner);
        }
        return true;
    }
    if (unsent) {
        unsentMessages.put(messageObject.getId(), messageObject);
    }
    sendMessage(messageObject);
    return true;
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:53,代码来源:SendMessagesHelper.java

示例5: isSecretVisibleMessage

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static boolean isSecretVisibleMessage(TLRPC.Message message) {
    return message.action instanceof TLRPC.TL_messageEncryptedAction && (message.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionScreenshotMessages || message.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionSetMessageTTL);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:4,代码来源:SecretChatHelper.java

示例6: isSecretInvisibleMessage

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static boolean isSecretInvisibleMessage(TLRPC.Message message) {
    return message.action instanceof TLRPC.TL_messageEncryptedAction && !(message.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionScreenshotMessages || message.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionSetMessageTTL);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:4,代码来源:SecretChatHelper.java

示例7: setType

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void setType() {
    int oldType = type;
    if (messageOwner instanceof TLRPC.TL_message || messageOwner instanceof TLRPC.TL_messageForwarded_old2) {
        if (isMediaEmpty()) {
            type = 0;
            if (messageText == null || messageText.length() == 0) {
                messageText = "Empty message";
            }
        } else if (messageOwner.media instanceof TLRPC.TL_messageMediaPhoto) {
            type = 1;
        } else if (messageOwner.media instanceof TLRPC.TL_messageMediaGeo || messageOwner.media instanceof TLRPC.TL_messageMediaVenue) {
            type = 4;
        } else if (isVideo()) {
            type = 3;
        } else if (isVoice()) {
            type = 2;
        } else if (isMusic()) {
            type = 14;
        } else if (messageOwner.media instanceof TLRPC.TL_messageMediaContact) {
            type = 12;
        } else if (messageOwner.media instanceof TLRPC.TL_messageMediaUnsupported) {
            type = 0;
        } else if (messageOwner.media instanceof TLRPC.TL_messageMediaDocument) {
            if (messageOwner.media.document != null && messageOwner.media.document.mime_type != null) {
                if (isGifDocument(messageOwner.media.document)) {
                    type = 8;
                } else if (messageOwner.media.document.mime_type.equals("image/webp") && isSticker()) {
                    type = 13;
                } else {
                    type = 9;
                }
            } else {
                type = 9;
            }
        } else if (messageOwner.media instanceof TLRPC.TL_messageMediaGame) {
            type = 0;
        }
    } else if (messageOwner instanceof TLRPC.TL_messageService) {
        if (messageOwner.action instanceof TLRPC.TL_messageActionLoginUnknownLocation) {
            type = 0;
        } else if (messageOwner.action instanceof TLRPC.TL_messageActionChatEditPhoto || messageOwner.action instanceof TLRPC.TL_messageActionUserUpdatedPhoto) {
            contentType = 1;
            type = 11;
        } else if (messageOwner.action instanceof TLRPC.TL_messageEncryptedAction) {
            if (messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionScreenshotMessages || messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionSetMessageTTL) {
                contentType = 1;
                type = 10;
            } else {
                contentType = -1;
                type = -1;
            }
        } else if (messageOwner.action instanceof TLRPC.TL_messageActionHistoryClear) {
            contentType = -1;
            type = -1;
        } else {
            contentType = 1;
            type = 10;
        }
    }
    if (oldType != 1000 && oldType != type) {
        generateThumbs(false);
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:64,代码来源:MessageObject.java

示例8: retrySendMessage

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public boolean retrySendMessage(MessageObject messageObject, boolean unsent) {
    if (messageObject.getId() >= 0) {
        return false;
    }
    if (messageObject.messageOwner.action instanceof TLRPC.TL_messageEncryptedAction) {
        int enc_id = (int) (messageObject.getDialogId() >> 32);
        TLRPC.EncryptedChat encryptedChat = MessagesController.getInstance().getEncryptedChat(enc_id);
        if (encryptedChat == null) {
            MessagesStorage.getInstance().markMessageAsSendError(messageObject.messageOwner);
            messageObject.messageOwner.send_state = MessageObject.MESSAGE_SEND_STATE_SEND_ERROR;
            NotificationCenter.getInstance().postNotificationName(NotificationCenter.messageSendError, messageObject.getId());
            processSentMessage(messageObject.getId());
            return false;
        }
        if (messageObject.messageOwner.random_id == 0) {
            messageObject.messageOwner.random_id = getNextRandomId();
        }
        if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionSetMessageTTL) {
            SecretChatHelper.getInstance().sendTTLMessage(encryptedChat, messageObject.messageOwner);
        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionDeleteMessages) {
            SecretChatHelper.getInstance().sendMessagesDeleteMessage(encryptedChat, null, messageObject.messageOwner);
        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionFlushHistory) {
            SecretChatHelper.getInstance().sendClearHistoryMessage(encryptedChat, messageObject.messageOwner);
        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionNotifyLayer) {
            SecretChatHelper.getInstance().sendNotifyLayerMessage(encryptedChat, messageObject.messageOwner);
        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionReadMessages) {
            SecretChatHelper.getInstance().sendMessagesReadMessage(encryptedChat, null, messageObject.messageOwner);
        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionScreenshotMessages) {
            SecretChatHelper.getInstance().sendScreenshotMessage(encryptedChat, null, messageObject.messageOwner);
        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionTyping) {

        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionResend) {

        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionCommitKey) {
            SecretChatHelper.getInstance().sendCommitKeyMessage(encryptedChat, messageObject.messageOwner);
        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionAbortKey) {
            SecretChatHelper.getInstance().sendAbortKeyMessage(encryptedChat, messageObject.messageOwner, 0);
        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionRequestKey) {
            SecretChatHelper.getInstance().sendRequestKeyMessage(encryptedChat, messageObject.messageOwner);
        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionAcceptKey) {
            SecretChatHelper.getInstance().sendAcceptKeyMessage(encryptedChat, messageObject.messageOwner);
        } else if (messageObject.messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionNoop) {
            SecretChatHelper.getInstance().sendNoopMessage(encryptedChat, messageObject.messageOwner);
        }
        return true;
    }
    if (unsent) {
        unsentMessages.put(messageObject.getId(), messageObject);
    }
    sendMessage(messageObject, messageObject.messageOwner.post);
    return true;
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:53,代码来源:SendMessagesHelper.java


注:本文中的org.telegram.tgnet.TLRPC.TL_decryptedMessageActionSetMessageTTL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。