2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Use info toast to show proxy / psa about text.

This commit is contained in:
John Preston
2020-04-30 15:20:50 +04:00
parent 067e52f5d1
commit f76e094e98
7 changed files with 88 additions and 84 deletions

View File

@@ -2730,7 +2730,7 @@ void History::cacheTopPromotion(
const QString &message) {
const auto changed = (isTopPromoted() != promoted);
cacheTopPromoted(promoted);
if (_topPromotedType != type || _topPromotedMessage != message) {
if (topPromotionType() != type || _topPromotedMessage != message) {
_topPromotedType = type;
_topPromotedMessage = message;
cloudDraftTextCache.clear();
@@ -2739,8 +2739,20 @@ void History::cacheTopPromotion(
}
}
QString History::topPromotionType() const {
return _topPromotedType;
QStringRef History::topPromotionType() const {
return topPromotionAboutShown()
? _topPromotedType.midRef(5)
: _topPromotedType.midRef(0);
}
bool History::topPromotionAboutShown() const {
return _topPromotedType.startsWith("seen^");
}
void History::markTopPromotionAboutShown() {
if (!topPromotionAboutShown()) {
_topPromotedType = "seen^" + _topPromotedType;
}
}
QString History::topPromotionMessage() const {