mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 13:47:05 +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
|
||||
showReactionsPanelInContextMenu = 1;
|
||||
showViewsPanelInContextMenu = 1;
|
||||
showHideMessageInContextMenu = 0;
|
||||
showUserMessagesInContextMenu = 2;
|
||||
showMessageDetailsInContextMenu = 2;
|
||||
|
||||
|
|
|
@ -1156,13 +1156,15 @@ void HistoryItem::setCommentsItemId(FullMsgId id) {
|
|||
|
||||
void HistoryItem::setServiceText(PreparedServiceText &&prepared) {
|
||||
auto text = std::move(prepared.text);
|
||||
if (!text.text.isEmpty()) {
|
||||
const auto settings = &AyuSettings::getInstance();
|
||||
text = text.append(QString(" (%1)").arg(QLocale().toString(
|
||||
base::unixtime::parse(_date),
|
||||
settings->showMessageSeconds ? QLocale::system().timeFormat(QLocale::LongFormat).remove(" t")
|
||||
: QLocale::system().timeFormat(QLocale::ShortFormat)
|
||||
)));
|
||||
|
||||
const auto settings = &AyuSettings::getInstance();
|
||||
const auto timeString = QString(" (%1)").arg(QLocale().toString(
|
||||
base::unixtime::parse(_date),
|
||||
settings->showMessageSeconds ? QLocale::system().timeFormat(QLocale::LongFormat).remove(" t")
|
||||
: QLocale::system().timeFormat(QLocale::ShortFormat)
|
||||
));
|
||||
if (!text.text.isEmpty() && !text.text.contains(timeString)) {
|
||||
text = text.append(timeString);
|
||||
}
|
||||
|
||||
AddComponents(HistoryServiceData::Bit());
|
||||
|
@ -2706,7 +2708,7 @@ void HistoryItem::setAyuHint(const QString &hint) {
|
|||
else {
|
||||
const auto data = Get<HistoryServiceData>();
|
||||
auto prepared = PreparedServiceText{
|
||||
.text = _text.append(" ").append(hint),
|
||||
.text = _text.append(QString(" (%1)").arg(hint)),
|
||||
.links = data->textLinks
|
||||
};
|
||||
setServiceText(std::move(prepared));
|
||||
|
|
Loading…
Add table
Reference in a new issue