Sending secret messages

To send messages/files/service messages, simply use the sendEncrypted methods with objects that use the same layer used by the other client (specified by the number after the underscore in decryptedMessage object names, to obtain the layer that must be used for a secret chat use the following wrapper method).

$secret_chat=$MadelineProto->get_secret_chat($chat);/*
[
'key' => [ // The authorization key
'auth_key' => 'string', // 256 bytes long
'fingerprint' => 10387574747492, // a 64 bit signed integer
'visualization_orig' => 'string', // 16 bytes long
'visualization_46' => 'string', // 20 bytes long
// The two visualization strings must be concatenated to generate a visual fingerprint
],
'admin' => false, // Am I the creator of the chat?
'user_id' => 101374607, // The user id of the other user
'InputEncryptedChat' => [...], // An inputEncryptedChat object that represents the current chat
'in_seq_no_x' => number, // in_seq_no must be multiplied by two and incremented by this before being sent over the network
'out_seq_no_x' => number, // out_seq_no must be multiplied by two and incremeneted this begore being sent over the network
'layer' => number, // The secret chat TL layer used by the other client
'ttl' => number, // The default time to live of messages in this chat
'ttr' => 100, // Time left before rekeying must be done, decremented by one every time a message as encrypted/decrypted with this key
'updated' => time(), // Last time the key of the current chat was changed
'incoming' => [], // Incoming messages, TL serialized strings
'outgoing' => [], // Outgoing messages, TL serialized strings
'created' => time(), // When was this chat created
'rekeying' => [0] // Info for rekeying
];
*/