Make replies backward-compatible again

This commit is contained in:
Sebastian Wolf 2023-11-19 14:24:19 +01:00
parent 00deaa79fd
commit ea89ef4fcd
No known key found for this signature in database
GPG key ID: CEA9522B5F38A90A

View file

@ -411,19 +411,10 @@ QVariantMap TDLibWrapper::newSendMessageRequest(qlonglong chatId, qlonglong repl
request.insert(_TYPE, "sendMessage");
request.insert(CHAT_ID, chatId);
if (replyToMessageId) {
if (versionNumber > VERSION_NUMBER(1,8,14)) {
QVariantMap replyTo;
if (versionNumber > VERSION_NUMBER(1,8,20)) {
replyTo.insert(_TYPE, TYPE_INPUT_MESSAGE_REPLY_TO_MESSAGE);
} else {
replyTo.insert(_TYPE, TYPE_MESSAGE_REPLY_TO_MESSAGE);
}
replyTo.insert(CHAT_ID, chatId);
replyTo.insert(MESSAGE_ID, replyToMessageId);
request.insert(REPLY_TO, replyTo);
} else {
request.insert(REPLY_TO_MESSAGE_ID, replyToMessageId);
}
QVariantMap replyTo;
replyTo.insert(_TYPE, TYPE_INPUT_MESSAGE_REPLY_TO_MESSAGE);
replyTo.insert(MESSAGE_ID, replyToMessageId);
request.insert(REPLY_TO, replyTo);
}
return request;
}