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

improved messages to self: always not unread, show sending clock icon

This commit is contained in:
John Preston
2015-10-27 20:29:39 -04:00
parent ad21781c7c
commit bb416b520a
6 changed files with 50 additions and 30 deletions

View File

@@ -831,7 +831,7 @@ public:
}
bool unread() const {
if ((out() && (id > 0 && id < _history->outboxReadBefore)) || (!out() && id > 0 && id < _history->inboxReadBefore)) return false;
return (id > 0 && !out() && channelId() != NoChannel) ? true : (_flags & MTPDmessage_flag_unread);
return (id > 0 && !out() && channelId() != NoChannel) ? true : (history()->peer->isSelf() ? false : (_flags & MTPDmessage_flag_unread));
}
bool notifyByFrom() const {
return _flags & MTPDmessage_flag_notify_by_from;
@@ -858,7 +858,7 @@ public:
return _history->isChannel() && isImportantChannelMessage(id, _flags);
}
virtual bool needCheck() const {
return out();
return out() || (id < 0 && history()->peer->isSelf());
}
virtual bool hasPoint(int32 x, int32 y) const {
return false;
@@ -898,6 +898,9 @@ public:
}
virtual void setViewsCount(int32 count) {
}
virtual void setId(MsgId newId) {
id = newId;
}
virtual void drawInDialog(Painter &p, const QRect &r, bool act, const HistoryItem *&cacheFor, Text &cache) const = 0;
virtual QString notificationHeader() const {
return QString();
@@ -1524,6 +1527,7 @@ public:
void drawInfo(Painter &p, int32 right, int32 bottom, bool selected, InfoDisplayType type) const;
void setViewsCount(int32 count);
void setId(MsgId newId);
void draw(Painter &p, uint32 selection) const;
virtual void drawMessageText(Painter &p, const QRect &trect, uint32 selection) const;
@@ -1564,6 +1568,8 @@ public:
int32 result = _timeWidth;
if (!_viewsText.isEmpty()) {
result += st::msgDateViewsSpace + _viewsWidth + st::msgDateCheckSpace + st::msgViewsImg.pxWidth();
} else if (id < 0 && history()->peer->isSelf()) {
result += st::msgDateCheckSpace + st::msgCheckImg.pxWidth();
}
if (out() && !fromChannel()) {
result += st::msgDateCheckSpace + st::msgCheckImg.pxWidth();
@@ -1574,6 +1580,8 @@ public:
int32 result = 0;
if (!_viewsText.isEmpty()) {
result += st::msgDateViewsSpace + _viewsWidth + st::msgDateCheckSpace + st::msgViewsImg.pxWidth();
} else if (id < 0 && history()->peer->isSelf()) {
result += st::msgDateCheckSpace + st::msgCheckImg.pxWidth();
}
return result;
}