mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-30 06:59:01 +01:00
Change response type of sendEncrypted* to updateNewOutgoingEncryptedMessage
This commit is contained in:
parent
29a6e5e87e
commit
5fe3467b19
@ -257,7 +257,7 @@ trait ResponseHandler
|
||||
} elseif ($responseType === 'messages.SentEncryptedMessage') {
|
||||
$body = $request->getBodyOrEmpty();
|
||||
try {
|
||||
$this->API->getSecretChatController($body['peer'])->handleSent($body, $response);
|
||||
$response = $this->API->getSecretChatController($body['peer'])->handleSent($body, $response);
|
||||
} catch (SecretPeerNotInDbException) {
|
||||
}
|
||||
}
|
||||
|
@ -392,7 +392,7 @@ final class SecretChatController implements Stringable
|
||||
$this->randomIdMap[$randomId] = [$seq, true];
|
||||
}
|
||||
|
||||
public function handleSent(array $request, array $response): void
|
||||
public function handleSent(array $request, array $response): array
|
||||
{
|
||||
$lock = $this->sentMutex->acquire((string) $request['seq']);
|
||||
try {
|
||||
@ -401,11 +401,12 @@ final class SecretChatController implements Stringable
|
||||
$msg['message']['date'] = $response['date'];
|
||||
if (isset($response['file'])) {
|
||||
$msg['message']['file'] = $response['file'];
|
||||
$update['message']['decrypted_message']['media']['file'] = $response['file'];
|
||||
$msg['message']['decrypted_message']['media']['file'] = $response['file'];
|
||||
}
|
||||
$this->outgoing[$request['seq']] = $msg;
|
||||
EventLoop::queue($this->API->saveUpdate(...), $msg);
|
||||
}
|
||||
return $msg;
|
||||
} finally {
|
||||
EventLoop::queue($lock->release(...));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user