Fix dice unqouted forward to opened chat
This commit is contained in:
parent
1488e02ac5
commit
0e0b99e40c
3 changed files with 15 additions and 13 deletions
|
|
@ -229,7 +229,10 @@ void SendExistingPhoto(
|
|||
forwarding);
|
||||
}
|
||||
|
||||
bool SendDice(Api::MessageToSend &message, Fn<void()> doneCallback) {
|
||||
bool SendDice(
|
||||
Api::MessageToSend &message,
|
||||
Fn<void()> doneCallback,
|
||||
bool forwarding) {
|
||||
const auto full = message.textWithTags.text.midRef(0).trimmed();
|
||||
auto length = 0;
|
||||
if (!Ui::Emoji::Find(full.data(), full.data() + full.size(), &length)
|
||||
|
|
@ -350,7 +353,9 @@ bool SendDice(Api::MessageToSend &message, Fn<void()> doneCallback) {
|
|||
).send();
|
||||
return history->sendRequestId;
|
||||
});
|
||||
api->finishForwarding(message.action);
|
||||
if (!forwarding) {
|
||||
api->finishForwarding(message.action);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,10 @@ void SendExistingPhoto(
|
|||
Fn<void()> doneCallback = nullptr,
|
||||
bool forwarding = false);
|
||||
|
||||
bool SendDice(Api::MessageToSend &message, Fn<void()> doneCallback = nullptr);
|
||||
bool SendDice(
|
||||
Api::MessageToSend &message,
|
||||
Fn<void()> doneCallback = nullptr,
|
||||
bool forwarding = false);
|
||||
|
||||
void FillMessagePostFlags(
|
||||
const SendAction &action,
|
||||
|
|
|
|||
|
|
@ -4063,20 +4063,15 @@ void ApiWrap::forwardMessagesUnquoted(
|
|||
}
|
||||
|
||||
auto message = ApiWrap::MessageToSend(history);
|
||||
message.textWithTags = TextWithTags{
|
||||
dice->emoji(),
|
||||
TextWithTags::Tags()
|
||||
};
|
||||
message.textWithTags.text = dice->emoji();
|
||||
message.action.options = action.options;
|
||||
message.action.clearDraft = false;
|
||||
|
||||
auto doneCallback = [=] () {
|
||||
Api::SendDice(message, [=] {
|
||||
if (shared && !--shared->requestsLeft) {
|
||||
shared->callback();
|
||||
}
|
||||
};
|
||||
|
||||
SendDice(message, std::move(doneCallback));
|
||||
}, true); // forwarding
|
||||
};
|
||||
|
||||
const auto forwardMessageUnquoted = [&] (not_null<HistoryItem *> item) {
|
||||
|
|
@ -4104,8 +4099,7 @@ void ApiWrap::forwardMessagesUnquoted(
|
|||
if (shared && !--shared->requestsLeft) {
|
||||
shared->callback();
|
||||
}
|
||||
},
|
||||
true); // forwarding
|
||||
}, true); // forwarding
|
||||
};
|
||||
|
||||
const auto sendAccumulated = [&] {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue