mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Add some General topic phrases.
This commit is contained in:
parent
993b501996
commit
77b2572854
4 changed files with 49 additions and 6 deletions
|
@ -1557,9 +1557,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
"lng_action_topic_created_inside" = "Topic created";
|
||||
"lng_action_topic_closed_inside" = "Topic closed";
|
||||
"lng_action_topic_reopened_inside" = "Topic reopened";
|
||||
"lng_action_topic_hidden_inside" = "Topic hidden";
|
||||
"lng_action_topic_unhidden_inside" = "Topic unhidden";
|
||||
"lng_action_topic_created" = "«{topic}» was created";
|
||||
"lng_action_topic_closed" = "«{topic}» was closed";
|
||||
"lng_action_topic_reopened" = "«{topic}» was reopened";
|
||||
"lng_action_topic_hidden" = "«{topic}» was hidden";
|
||||
"lng_action_topic_unhidden" = "«{topic}» was unhidden";
|
||||
"lng_action_topic_placeholder" = "topic";
|
||||
"lng_action_topic_renamed" = "{from} renamed the {link} to «{title}»";
|
||||
"lng_action_topic_icon_changed" = "{from} changed the {link} icon to {emoji}";
|
||||
|
@ -3162,6 +3166,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
"lng_admin_log_topics_changed" = "{from} changed topic {topic} to {new_topic}";
|
||||
"lng_admin_log_topics_closed" = "{from} closed topic {topic}";
|
||||
"lng_admin_log_topics_reopened" = "{from} reopened topic {topic}";
|
||||
"lng_admin_log_topics_hidden" = "{from} hid topic {topic}";
|
||||
"lng_admin_log_topics_unhidden" = "{from} unhid topic {topic}";
|
||||
"lng_admin_log_topics_deleted" = "{from} deleted topic {topic}";
|
||||
"lng_admin_log_topics_pinned" = "{from} pinned topic {topic}";
|
||||
"lng_admin_log_topics_unpinned" = "{from} unpinned topic {topic}";
|
||||
|
|
|
@ -630,6 +630,14 @@ TextWithEntities GenerateDefaultBannedRightsChangeText(
|
|||
});
|
||||
}
|
||||
|
||||
[[nodiscard]] bool IsTopicHidden(const MTPForumTopic &topic) {
|
||||
return topic.match([](const MTPDforumTopic &data) {
|
||||
return data.is_hidden();
|
||||
}, [](const MTPDforumTopicDeleted &) {
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
[[nodiscard]] TextWithEntities GenerateTopicLink(
|
||||
not_null<ChannelData*> channel,
|
||||
const MTPForumTopic &topic) {
|
||||
|
@ -1713,6 +1721,19 @@ void GenerateItems(
|
|||
nowLink,
|
||||
Ui::Text::WithEntities));
|
||||
}
|
||||
const auto wasHidden = IsTopicHidden(data.vprev_topic());
|
||||
const auto nowHidden = IsTopicHidden(data.vnew_topic());
|
||||
if (nowHidden != wasHidden) {
|
||||
addSimpleServiceMessage((nowHidden
|
||||
? tr::lng_admin_log_topics_hidden
|
||||
: tr::lng_admin_log_topics_unhidden)(
|
||||
tr::now,
|
||||
lt_from,
|
||||
fromLinkText,
|
||||
lt_topic,
|
||||
nowLink,
|
||||
Ui::Text::WithEntities));
|
||||
}
|
||||
};
|
||||
|
||||
const auto createDeleteTopic = [&](const LogDeleteTopic &data) {
|
||||
|
|
|
@ -674,6 +674,10 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
|||
result.text = { mtpIsTrue(*closed)
|
||||
? tr::lng_action_topic_closed_inside(tr::now)
|
||||
: tr::lng_action_topic_reopened_inside(tr::now) };
|
||||
} else if (const auto hidden = action.vhidden()) {
|
||||
result.text = { mtpIsTrue(*hidden)
|
||||
? tr::lng_action_topic_hidden_inside(tr::now)
|
||||
: tr::lng_action_topic_unhidden_inside(tr::now) };
|
||||
} else if (!action.vtitle()) {
|
||||
if (const auto icon = action.vicon_emoji_id()) {
|
||||
if (const auto iconId = icon->v) {
|
||||
|
|
|
@ -676,16 +676,12 @@ auto Element::contextDependentServiceText() -> TextWithLinks {
|
|||
if (!info) {
|
||||
return {};
|
||||
}
|
||||
const auto created = !info->closed
|
||||
&& !info->reopened
|
||||
&& !info->renamed
|
||||
&& !info->reiconed;
|
||||
if (_delegate->elementContext() == Context::Replies) {
|
||||
if (created) {
|
||||
if (info->created()) {
|
||||
return { { tr::lng_action_topic_created_inside(tr::now) } };
|
||||
}
|
||||
return {};
|
||||
} else if (created) {
|
||||
} else if (info->created()) {
|
||||
return{};
|
||||
}
|
||||
const auto peerId = item->history()->peer->id;
|
||||
|
@ -750,6 +746,22 @@ auto Element::contextDependentServiceText() -> TextWithLinks {
|
|||
wrapParentTopic(),
|
||||
Ui::Text::WithEntities),
|
||||
};
|
||||
} else if (info->hidden) {
|
||||
return {
|
||||
tr::lng_action_topic_hidden(
|
||||
tr::now,
|
||||
lt_topic,
|
||||
wrapParentTopic(),
|
||||
Ui::Text::WithEntities),
|
||||
};
|
||||
} else if (info->unhidden) {
|
||||
return {
|
||||
tr::lng_action_topic_unhidden(
|
||||
tr::now,
|
||||
lt_topic,
|
||||
wrapParentTopic(),
|
||||
Ui::Text::WithEntities),
|
||||
};
|
||||
} else if (info->renamed) {
|
||||
return {
|
||||
tr::lng_action_topic_renamed(
|
||||
|
|
Loading…
Add table
Reference in a new issue