Почта v2: ReceiveOutcomingMessage без авторизации и атомарная вставка пары

This commit is contained in:
AidarKC
2026-05-02 16:46:22 +03:00
parent e73328461e
commit b7e6cf7437
6 changed files with 123 additions and 18 deletions
+9 -2
View File
@@ -1325,8 +1325,15 @@ export class AuthService {
}
async sendMessagePair({ incomingBlobB64, outgoingBlobB64 }) {
const response = await this.ws.request('SendMessagePair', { incomingBlobB64, outgoingBlobB64 });
if (response.status !== 200) throw opError('SendMessagePair', response);
const body = { incomingBlobB64, outgoingBlobB64 };
const primaryOp = 'ReceiveOutcomingMessage';
let response = await this.ws.request(primaryOp, body);
if (response.status === 404) {
response = await this.ws.request('SendMessagePair', body);
if (response.status !== 200) throw opError('SendMessagePair', response);
return response.payload || {};
}
if (response.status !== 200) throw opError(primaryOp, response);
return response.payload || {};
}