This commit is contained in:
John Preston 2015-04-16 18:00:16 +03:00
commit 196b643e7d
2 changed files with 16 additions and 1 deletions

View File

@ -5096,8 +5096,9 @@ void HistoryReply::drawReplyTo(QPainter &p, int32 x, int32 y, int32 w, bool sele
}
replyToName.drawElided(p, x + st::msgReplyBarSkip + previewSkip, y + st::msgReplyPadding.top(), w - st::msgReplyBarSkip - previewSkip);
HistoryMessage *replyToAsMsg = replyToMsg->toHistoryMessage();
if (likeService) {
} else if (replyToMsg->getMedia() || replyToMsg->serviceMsg()) {
} else if ((replyToAsMsg && replyToAsMsg->justMedia()) || replyToMsg->serviceMsg()) {
style::color date(selected ? (out() ? st::msgOutSelectDateColor : st::msgInSelectDateColor) : (out() ? st::msgOutDateColor : st::msgInDateColor));
p.setPen(date->p);
} else {

View File

@ -620,6 +620,7 @@ private:
ItemAnimations &itemAnimations();
class HistoryReply; // dynamic_cast optimize
class HistoryMessage; // dynamic_cast optimize
class HistoryMedia;
class HistoryItem : public HistoryElem {
@ -735,6 +736,12 @@ public:
virtual const HistoryReply *toHistoryReply() const { // dynamic_cast optimize
return 0;
}
virtual HistoryMessage *toHistoryMessage() { // dynamic_cast optimize
return 0;
}
virtual const HistoryMessage *toHistoryMessage() const { // dynamic_cast optimize
return 0;
}
virtual ~HistoryItem();
@ -1244,6 +1251,13 @@ public:
return from();
}
HistoryMessage *toHistoryMessage() { // dynamic_cast optimize
return this;
}
const HistoryMessage *toHistoryMessage() const { // dynamic_cast optimize
return this;
}
~HistoryMessage();
protected: