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


Java TLRPC.TL_encryptedChat方法代码示例

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


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

示例1: checkScreenshots

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void checkScreenshots(ArrayList<Long> dates) {
    if (dates == null || dates.isEmpty() || lastSecretChatEnterTime == 0 || lastSecretChat == null || !(lastSecretChat instanceof TLRPC.TL_encryptedChat)) {
        return;
    }
    long dt = 2000;
    boolean send = false;
    for (Long date : dates) {
        if (lastMediaCheckTime != 0 && date <= lastMediaCheckTime) {
            continue;
        }

        if (date >= lastSecretChatEnterTime) {
            if (lastSecretChatLeaveTime == 0 || date <= lastSecretChatLeaveTime + dt) {
                lastMediaCheckTime = Math.max(lastMediaCheckTime, date);
                send = true;
            }
        }
    }
    if (send) {
        SecretChatHelper.getInstance().sendScreenshotMessage(lastSecretChat, lastSecretChatVisibleMessages, null);
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:23,代码来源:MediaController.java

示例2: sendClearHistoryMessage

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void sendClearHistoryMessage(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_decryptedMessageActionFlushHistory();
        message = createServiceSecretMessage(encryptedChat, reqSend.action);
    }
    reqSend.random_id = message.random_id;

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

示例3: sendMessagesReadMessage

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void sendMessagesReadMessage(TLRPC.EncryptedChat encryptedChat, ArrayList<Long> random_ids, 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_decryptedMessageActionReadMessages();
        reqSend.action.random_ids = random_ids;
        message = createServiceSecretMessage(encryptedChat, reqSend.action);
    }
    reqSend.random_id = message.random_id;

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

示例4: processUpdateEncryption

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
protected void processUpdateEncryption(TLRPC.TL_updateEncryption update, ConcurrentHashMap<Integer, TLRPC.User> usersDict) {
    final TLRPC.EncryptedChat newChat = update.chat;
    long dialog_id = ((long) newChat.id) << 32;
    TLRPC.EncryptedChat existingChat = MessagesController.getInstance().getEncryptedChatDB(newChat.id);

    if (newChat instanceof TLRPC.TL_encryptedChatRequested && existingChat == null) {
        int user_id = newChat.participant_id;
        if (user_id == UserConfig.getClientUserId()) {
            user_id = newChat.admin_id;
        }
        TLRPC.User user = MessagesController.getInstance().getUser(user_id);
        if (user == null) {
            user = usersDict.get(user_id);
        }
        newChat.user_id = user_id;
        final TLRPC.TL_dialog dialog = new TLRPC.TL_dialog();
        dialog.id = dialog_id;
        dialog.unread_count = 0;
        dialog.top_message = 0;
        dialog.last_message_date = update.date;

        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public void run() {
                MessagesController.getInstance().dialogs_dict.put(dialog.id, dialog);
                MessagesController.getInstance().dialogs.add(dialog);
                MessagesController.getInstance().putEncryptedChat(newChat, false);
                MessagesController.getInstance().sortDialogs(null);
                NotificationCenter.getInstance().postNotificationName(NotificationCenter.dialogsNeedReload);
            }
        });
        MessagesStorage.getInstance().putEncryptedChat(newChat, user, dialog);
        SecretChatHelper.getInstance().acceptSecretChat(newChat);
    } else if (newChat instanceof TLRPC.TL_encryptedChat) {
        if (existingChat != null && existingChat instanceof TLRPC.TL_encryptedChatWaiting && (existingChat.auth_key == null || existingChat.auth_key.length == 1)) {
            newChat.a_or_b = existingChat.a_or_b;
            newChat.user_id = existingChat.user_id;
            SecretChatHelper.getInstance().processAcceptedSecretChat(newChat);
        } else if (existingChat == null && startingSecretChat) {
            delayedEncryptedChatUpdates.add(update);
        }
    } else {
        final TLRPC.EncryptedChat exist = existingChat;
        if (exist != null) {
            newChat.user_id = exist.user_id;
            newChat.auth_key = exist.auth_key;
            newChat.key_create_date = exist.key_create_date;
            newChat.key_use_count_in = exist.key_use_count_in;
            newChat.key_use_count_out = exist.key_use_count_out;
            newChat.ttl = exist.ttl;
            newChat.seq_in = exist.seq_in;
            newChat.seq_out = exist.seq_out;
        }
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public void run() {
                if (exist != null) {
                    MessagesController.getInstance().putEncryptedChat(newChat, false);
                }
                MessagesStorage.getInstance().updateEncryptedChat(newChat);
                NotificationCenter.getInstance().postNotificationName(NotificationCenter.encryptedChatUpdated, newChat);
            }
        });
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:66,代码来源:SecretChatHelper.java

示例5: sendCommitKeyMessage

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void sendCommitKeyMessage(final 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_decryptedMessageActionCommitKey();
        reqSend.action.exchange_id = encryptedChat.exchange_id;
        reqSend.action.key_fingerprint = encryptedChat.future_key_fingerprint;

        message = createServiceSecretMessage(encryptedChat, reqSend.action);
    }
    reqSend.random_id = message.random_id;

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

示例6: sendNotifyLayerMessage

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void sendNotifyLayerMessage(final TLRPC.EncryptedChat encryptedChat, TLRPC.Message resendMessage) {
    if (!(encryptedChat instanceof TLRPC.TL_encryptedChat)) {
        return;
    }
    if (sendingNotifyLayer.contains(encryptedChat.id)) {
        return;
    }
    sendingNotifyLayer.add(encryptedChat.id);
    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_decryptedMessageActionNotifyLayer();
        reqSend.action.layer = CURRENT_SECRET_CHAT_LAYER;
        message = createServiceSecretMessage(encryptedChat, reqSend.action);
    }
    reqSend.random_id = message.random_id;

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

示例7: sendRequestKeyMessage

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void sendRequestKeyMessage(final 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_decryptedMessageActionRequestKey();
        reqSend.action.exchange_id = encryptedChat.exchange_id;
        reqSend.action.g_a = encryptedChat.g_a;

        message = createServiceSecretMessage(encryptedChat, reqSend.action);
    }
    reqSend.random_id = message.random_id;

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

示例8: sendAcceptKeyMessage

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void sendAcceptKeyMessage(final 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_decryptedMessageActionAcceptKey();
        reqSend.action.exchange_id = encryptedChat.exchange_id;
        reqSend.action.key_fingerprint = encryptedChat.future_key_fingerprint;
        reqSend.action.g_b = encryptedChat.g_a_or_b;

        message = createServiceSecretMessage(encryptedChat, reqSend.action);
    }
    reqSend.random_id = message.random_id;

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

示例9: sendAbortKeyMessage

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void sendAbortKeyMessage(final TLRPC.EncryptedChat encryptedChat, TLRPC.Message resendMessage, long excange_id) {
    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_decryptedMessageActionAbortKey();
        reqSend.action.exchange_id = excange_id;

        message = createServiceSecretMessage(encryptedChat, reqSend.action);
    }
    reqSend.random_id = message.random_id;

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

示例10: sendNoopMessage

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void sendNoopMessage(final 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_decryptedMessageActionNoop();
        message = createServiceSecretMessage(encryptedChat, reqSend.action);
    }
    reqSend.random_id = message.random_id;

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

示例11: 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

示例12: updateSecretStatus

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void updateSecretStatus() {
    if (bottomOverlay == null) {
        return;
    }
    if (currentEncryptedChat == null || secretViewStatusTextView == null) {
        bottomOverlay.setVisibility(View.INVISIBLE);
        return;
    }
    boolean hideKeyboard = false;
    if (currentEncryptedChat instanceof TLRPC.TL_encryptedChatRequested) {
        bottomOverlayText.setText(LocaleController.getString("EncryptionProcessing", R.string.EncryptionProcessing));
        bottomOverlay.setVisibility(View.VISIBLE);
        hideKeyboard = true;
    } else if (currentEncryptedChat instanceof TLRPC.TL_encryptedChatWaiting) {
        bottomOverlayText.setText(AndroidUtilities.replaceTags(LocaleController.formatString("AwaitingEncryption", R.string.AwaitingEncryption, "<b>" + currentUser.first_name + "</b>")));
        bottomOverlay.setVisibility(View.VISIBLE);
        hideKeyboard = true;
    } else if (currentEncryptedChat instanceof TLRPC.TL_encryptedChatDiscarded) {
        bottomOverlayText.setText(LocaleController.getString("EncryptionRejected", R.string.EncryptionRejected));
        bottomOverlay.setVisibility(View.VISIBLE);
        chatActivityEnterView.setFieldText("");
        DraftQuery.cleanDraft(dialog_id, false);
        hideKeyboard = true;
    } else if (currentEncryptedChat instanceof TLRPC.TL_encryptedChat) {
        bottomOverlay.setVisibility(View.INVISIBLE);
    }
    checkRaiseSensors();
    if (hideKeyboard) {
        chatActivityEnterView.hidePopup(false);
        if (getParentActivity() != null) {
            AndroidUtilities.hideKeyboard(getParentActivity().getCurrentFocus());
        }
    }
    checkActionBarMenu();
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:36,代码来源:ChatActivity.java

示例13: updateSecretStatus

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void updateSecretStatus() {
    if (bottomOverlay == null) {
        return;
    }
    if (currentEncryptedChat == null || bigEmptyView == null) {
        bottomOverlay.setVisibility(View.INVISIBLE);
        return;
    }
    boolean hideKeyboard = false;
    if (currentEncryptedChat instanceof TLRPC.TL_encryptedChatRequested) {
        bottomOverlayText.setText(LocaleController.getString("EncryptionProcessing", R.string.EncryptionProcessing));
        bottomOverlay.setVisibility(View.VISIBLE);
        hideKeyboard = true;
    } else if (currentEncryptedChat instanceof TLRPC.TL_encryptedChatWaiting) {
        bottomOverlayText.setText(AndroidUtilities.replaceTags(LocaleController.formatString("AwaitingEncryption", R.string.AwaitingEncryption, "<b>" + currentUser.first_name + "</b>")));
        bottomOverlay.setVisibility(View.VISIBLE);
        hideKeyboard = true;
    } else if (currentEncryptedChat instanceof TLRPC.TL_encryptedChatDiscarded) {
        bottomOverlayText.setText(LocaleController.getString("EncryptionRejected", R.string.EncryptionRejected));
        bottomOverlay.setVisibility(View.VISIBLE);
        chatActivityEnterView.setFieldText("");
        DraftQuery.cleanDraft(dialog_id, false);
        hideKeyboard = true;
    } else if (currentEncryptedChat instanceof TLRPC.TL_encryptedChat) {
        bottomOverlay.setVisibility(View.INVISIBLE);
    }
    checkRaiseSensors();
    if (hideKeyboard) {
        chatActivityEnterView.hidePopup(false);
        if (getParentActivity() != null) {
            AndroidUtilities.hideKeyboard(getParentActivity().getCurrentFocus());
        }
    }
    checkActionBarMenu();
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:36,代码来源:ChatActivity.java

示例14: sendScreenshotMessage

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void sendScreenshotMessage(TLRPC.EncryptedChat encryptedChat, ArrayList<Long> random_ids, 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_decryptedMessageActionScreenshotMessages();
        reqSend.action.random_ids = random_ids;
        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:pooyafaroka,项目名称:PlusGram,代码行数:36,代码来源:SecretChatHelper.java


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