mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
fix: various message improvements
This commit is contained in:
parent
c102f4c0e5
commit
040794586b
2 changed files with 11 additions and 8 deletions
|
@ -73,6 +73,7 @@ public:
|
||||||
// 2 - show with SHIFT or CTRL pressed
|
// 2 - show with SHIFT or CTRL pressed
|
||||||
showReactionsPanelInContextMenu = 1;
|
showReactionsPanelInContextMenu = 1;
|
||||||
showViewsPanelInContextMenu = 1;
|
showViewsPanelInContextMenu = 1;
|
||||||
|
showHideMessageInContextMenu = 0;
|
||||||
showUserMessagesInContextMenu = 2;
|
showUserMessagesInContextMenu = 2;
|
||||||
showMessageDetailsInContextMenu = 2;
|
showMessageDetailsInContextMenu = 2;
|
||||||
|
|
||||||
|
|
|
@ -1156,13 +1156,15 @@ void HistoryItem::setCommentsItemId(FullMsgId id) {
|
||||||
|
|
||||||
void HistoryItem::setServiceText(PreparedServiceText &&prepared) {
|
void HistoryItem::setServiceText(PreparedServiceText &&prepared) {
|
||||||
auto text = std::move(prepared.text);
|
auto text = std::move(prepared.text);
|
||||||
if (!text.text.isEmpty()) {
|
|
||||||
const auto settings = &AyuSettings::getInstance();
|
const auto settings = &AyuSettings::getInstance();
|
||||||
text = text.append(QString(" (%1)").arg(QLocale().toString(
|
const auto timeString = QString(" (%1)").arg(QLocale().toString(
|
||||||
base::unixtime::parse(_date),
|
base::unixtime::parse(_date),
|
||||||
settings->showMessageSeconds ? QLocale::system().timeFormat(QLocale::LongFormat).remove(" t")
|
settings->showMessageSeconds ? QLocale::system().timeFormat(QLocale::LongFormat).remove(" t")
|
||||||
: QLocale::system().timeFormat(QLocale::ShortFormat)
|
: QLocale::system().timeFormat(QLocale::ShortFormat)
|
||||||
)));
|
));
|
||||||
|
if (!text.text.isEmpty() && !text.text.contains(timeString)) {
|
||||||
|
text = text.append(timeString);
|
||||||
}
|
}
|
||||||
|
|
||||||
AddComponents(HistoryServiceData::Bit());
|
AddComponents(HistoryServiceData::Bit());
|
||||||
|
@ -2706,7 +2708,7 @@ void HistoryItem::setAyuHint(const QString &hint) {
|
||||||
else {
|
else {
|
||||||
const auto data = Get<HistoryServiceData>();
|
const auto data = Get<HistoryServiceData>();
|
||||||
auto prepared = PreparedServiceText{
|
auto prepared = PreparedServiceText{
|
||||||
.text = _text.append(" ").append(hint),
|
.text = _text.append(QString(" (%1)").arg(hint)),
|
||||||
.links = data->textLinks
|
.links = data->textLinks
|
||||||
};
|
};
|
||||||
setServiceText(std::move(prepared));
|
setServiceText(std::move(prepared));
|
||||||
|
|
Loading…
Add table
Reference in a new issue