Make replies backward-compatible again

This commit is contained in:
Sebastian Wolf 2023-11-19 14:24:19 +01:00 committed by Denis Fedoseev
parent 749f05816c
commit bdc0423bf3

View file

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