mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-13 04:37:11 +02:00
Improved toast phrase for forwarded messages to self.
This commit is contained in:
parent
a3ba1ba2a1
commit
98a71cce89
1 changed files with 11 additions and 1 deletions
|
@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "boxes/share_box.h"
|
||||
#include "chat_helpers/compose/compose_show.h"
|
||||
#include "chat_helpers/message_field.h"
|
||||
#include "chat_helpers/share_message_phrase_factory.h"
|
||||
#include "ui/wrap/slide_wrap.h"
|
||||
#include "ui/widgets/fields/input_field.h"
|
||||
#include "api/api_chat_participants.h"
|
||||
|
@ -218,13 +219,22 @@ void ForwardToSelf(
|
|||
const auto history = session->data().history(session->user());
|
||||
auto resolved = history->resolveForwardDraft(draft);
|
||||
if (!resolved.items.empty()) {
|
||||
const auto count = resolved.items.size();
|
||||
auto action = Api::SendAction(history);
|
||||
action.clearDraft = false;
|
||||
action.generateLocal = false;
|
||||
session->api().forwardMessages(
|
||||
std::move(resolved),
|
||||
action,
|
||||
[=] { show->showToast(tr::lng_share_done(tr::now)); });
|
||||
[=] {
|
||||
auto phrase = rpl::variable<TextWithEntities>(
|
||||
ChatHelpers::ForwardedMessagePhrase({
|
||||
.toCount = 1,
|
||||
.singleMessage = (count == 1),
|
||||
.to1 = session->user(),
|
||||
})).current();
|
||||
show->showToast(std::move(phrase));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue