init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#include "chat_helpers/share_message_phrase_factory.h"
|
||||
|
||||
#include "data/data_peer.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "ui/text/text_utilities.h"
|
||||
|
||||
namespace ChatHelpers {
|
||||
|
||||
rpl::producer<TextWithEntities> ForwardedMessagePhrase(
|
||||
const ForwardedMessagePhraseArgs &args) {
|
||||
if (args.toCount <= 1) {
|
||||
Assert(args.to1);
|
||||
|
||||
if (args.to1->isSelf()) {
|
||||
if (args.toSelfWithPremiumIsEmpty && args.to1->isPremium()) {
|
||||
return {};
|
||||
}
|
||||
return (args.singleMessage
|
||||
? tr::lng_share_message_to_saved_messages
|
||||
: tr::lng_share_messages_to_saved_messages)(
|
||||
tr::rich);
|
||||
} else {
|
||||
return (args.singleMessage
|
||||
? tr::lng_share_message_to_chat
|
||||
: tr::lng_share_messages_to_chat)(
|
||||
lt_chat,
|
||||
rpl::single(TextWithEntities{ args.to1->name() }),
|
||||
tr::rich);
|
||||
}
|
||||
} else if ((args.toCount == 2) && (args.to1 && args.to2)) {
|
||||
return (args.singleMessage
|
||||
? tr::lng_share_message_to_two_chats
|
||||
: tr::lng_share_messages_to_two_chats)(
|
||||
lt_user,
|
||||
rpl::single(TextWithEntities{ args.to1->name() }),
|
||||
lt_chat,
|
||||
rpl::single(TextWithEntities{ args.to2->name() }),
|
||||
tr::rich);
|
||||
} else {
|
||||
return (args.singleMessage
|
||||
? tr::lng_share_message_to_many_chats
|
||||
: tr::lng_share_messages_to_many_chats)(
|
||||
lt_count,
|
||||
rpl::single(args.toCount) | tr::to_count(),
|
||||
tr::rich);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // namespace ChatHelpers
|
||||
Reference in New Issue
Block a user