2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Display channel posts in discussion groups.

This commit is contained in:
John Preston
2019-05-24 09:55:16 +02:00
parent 50778790fe
commit 9c1ce702bb
5 changed files with 39 additions and 19 deletions

View File

@@ -553,8 +553,16 @@ int HistoryMessage::viewsCount() const {
return HistoryItem::viewsCount();
}
bool HistoryMessage::displayForwardedAsOriginal() const {
if (const auto forwarded = Get<HistoryMessageForwarded>()) {
const auto peer = history()->peer;
return peer->isSelf() || (peer->isMegagroup() && (peer == from()));
}
return false;
}
PeerData *HistoryMessage::displayFrom() const {
return history()->peer->isSelf()
return displayForwardedAsOriginal()
? senderOriginal()
: author().get();
}