mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-03 08:05:12 +00:00
Improved toast phrase for forwarded messages to self.
This commit is contained in:
@@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||||||
#include "boxes/share_box.h"
|
#include "boxes/share_box.h"
|
||||||
#include "chat_helpers/compose/compose_show.h"
|
#include "chat_helpers/compose/compose_show.h"
|
||||||
#include "chat_helpers/message_field.h"
|
#include "chat_helpers/message_field.h"
|
||||||
|
#include "chat_helpers/share_message_phrase_factory.h"
|
||||||
#include "ui/wrap/slide_wrap.h"
|
#include "ui/wrap/slide_wrap.h"
|
||||||
#include "ui/widgets/fields/input_field.h"
|
#include "ui/widgets/fields/input_field.h"
|
||||||
#include "api/api_chat_participants.h"
|
#include "api/api_chat_participants.h"
|
||||||
@@ -218,13 +219,22 @@ void ForwardToSelf(
|
|||||||
const auto history = session->data().history(session->user());
|
const auto history = session->data().history(session->user());
|
||||||
auto resolved = history->resolveForwardDraft(draft);
|
auto resolved = history->resolveForwardDraft(draft);
|
||||||
if (!resolved.items.empty()) {
|
if (!resolved.items.empty()) {
|
||||||
|
const auto count = resolved.items.size();
|
||||||
auto action = Api::SendAction(history);
|
auto action = Api::SendAction(history);
|
||||||
action.clearDraft = false;
|
action.clearDraft = false;
|
||||||
action.generateLocal = false;
|
action.generateLocal = false;
|
||||||
session->api().forwardMessages(
|
session->api().forwardMessages(
|
||||||
std::move(resolved),
|
std::move(resolved),
|
||||||
action,
|
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));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user