<commit_before>//     telegram-mt-node
//     Copyright 2014 <NAME> '<EMAIL>'
//     Released under the MIT License
//     https://github.com/enricostara/telegram-mt-node

//     EncryptedMessage class
//
// This class provide a encrypted-text message for data transmission in MTProto

// Import dependencies
require('requirish')._(module);
var util = require('util');
var mtproto = require('lib/mtproto');
var utility = require('lib/utility');
var security = require('lib/security');
var tl = require('telegram-tl-node');
var logger = require('get-log')('mtproto.EncryptedMessage');

EncryptedMessage.InnerMessage = new tl.TypeBuilder.buildType('message.EncryptedMessage', {
    "predicate": "InnerMessage",
    "params": [
        {
            "name": "server_salt",
            "type": "long"
        }, {
            "name": "session_id",
            "type": "long"
        }, {
            "name": "payload",
            "type": "%Message"
        }
    ],
    "type": "InnerMessage"
});

// To get an instance for `serialization`:
//
//     new EncryptedMessage({message: myMessageBuffer});
// Provide the payload as `Buffer`:
//
// To get an instance for `de-serialization`:
//
//     new EncryptedMessage({buffer: myBuffer});
// Provide a `buffer` containing the plain message from which extract the payload
function EncryptedMessage(options) {
    var opts = options ? options : {};
    this.constructor.super_.call(this, opts.buffer, opts.offset);
    this.authKey = opts.authKey;
    if (opts.message) {
        this.body = opts.message;
        this.innerMessage = new EncryptedMessage.InnerMessage({
            props: {
                server_salt: opts.serverSalt,
                session_id: opts.sessionId,
                payload: new mtproto.type.Message({
                    props: {
                        msg_id: utility.createMessageId(),
                        seqno: opts.sequenceNumber.generate(true),
                        bytes: this.body.length,
                        body: this.body
                    }<commit_msg>Add the 'messageId' property in EncryptedMessage class<commit_after>//     telegram-mt-node
//     Copyright 2014 <NAME> '<EMAIL>'
//     Released under the MIT License
//     https://github.com/enricostara/telegram-mt-node

//     EncryptedMessage class
//
// This class provide a encrypted-text message for data transmission in MTProto

// Import dependencies
require('requirish')._(module);
var util = require('util');
var mtproto = require('lib/mtproto');
var utility = require('lib/utility');
var security = require('lib/security');
var tl = require('telegram-tl-node');
var logger = require('get-log')('mtproto.EncryptedMessage');

EncryptedMessage.InnerMessage = new tl.TypeBuilder.buildType('message.EncryptedMessage', {
    "predicate": "InnerMessage",
    "params": [
        {
            "name": "server_salt",
            "type": "long"
        }, {
            "name": "session_id",
            "type": "long"
        }, {
            "name": "payload",
            "type": "%Message"
        }
    ],
    "type": "InnerMessage"
});

// To get an instance for `serialization`:
//
//     new EncryptedMessage({message: myMessageBuffer});
// Provide the payload as `Buffer`:
//
// To get an instance for `de-serialization`:
//
//     new EncryptedMessage({buffer: myBuffer});
// Provide a `buffer` containing the plain message from which extract the payload
function EncryptedMessage(options) {
    var opts = options ? options : {};
    this.constructor.super_.call(this, opts.buffer, opts.offset);
    this.authKey = opts.authKey;
    this.messageId = utility.createMessageId();
    if (opts.message) {
        this.body = opts.message;
        this.innerMessage = new EncryptedMessage.InnerMessage({
            props: {
                server_salt: opts.serverSalt,
                session_id: opts.sessionId,
                payload: new mtproto.type.Message({
                    props: {
                        msg_id: this.messageId,
                        seqno: opts.sequenceNumber.generate(true),
                        bytes: this.body.length,
                        body: this.body
                    }
{'fraction_non_alphanumeric': 0.1323459149546106, 'fraction_numerical': 0.0019111323459149545, 'mean_word_length': 2.2357032457496135, 'pattern_counts': {'":': 18, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4916571', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1128, 'n_words': 280}