2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fixed sending polls as reply to other messages.

Fixes #5550.
This commit is contained in:
23rd
2019-02-17 14:43:46 +03:00
committed by John Preston
parent bdfb9b4143
commit 193e454fd4
4 changed files with 25 additions and 1 deletions

View File

@@ -35,6 +35,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_poll.h"
#include "data/data_channel.h"
#include "data/data_chat.h"
#include "data/data_drafts.h"
#include "data/data_user.h"
#include "dialogs/dialogs_key.h"
@@ -636,7 +637,14 @@ void PeerMenuCreatePoll(not_null<PeerData*> peer) {
if (std::exchange(*lock, true)) {
return;
}
const auto options = ApiWrap::SendOptions(peer->owner().history(peer));
auto options = ApiWrap::SendOptions(peer->owner().history(peer));
if (const auto id = App::main()->currentReplyToIdFor(options.history)) {
options.replyTo = id;
}
if (const auto localDraft = options.history->localDraft()) {
options.clearDraft = localDraft->textWithTags.text.isEmpty();
}
Auth().api().createPoll(result, options, crl::guard(box, [=] {
box->closeBox();
}), crl::guard(box, [=](const RPCError &error) {