Skip fwd_info for msgs from chat with yourself.

Server doesn't add fwd_info if a non-forwarded message is forwarded
from chat with yourself so don't add it locally as well.
This commit is contained in:
John Preston 2017-04-30 15:42:04 +03:00
parent d2c6de3df6
commit 4659b664e7

View File

@ -454,10 +454,13 @@ HistoryMessage::HistoryMessage(History *history, MsgId id, MTPDmessage::Flags fl
: HistoryItem(history, id, newForwardedFlags(history->peer, from, fwd) | flags, date, from) {
CreateConfig config;
config.authorIdOriginal = fwd->authorOriginal()->id;
config.fromIdOriginal = fwd->fromOriginal()->id;
if (fwd->authorOriginal()->isChannel()) {
config.originalId = fwd->idOriginal();
if (fwd->Has<HistoryMessageForwarded>() || !fwd->history()->peer->isSelf()) {
// Server doesn't add "fwd_from" to non-forwarded messages from chat with yourself.
config.authorIdOriginal = fwd->authorOriginal()->id;
config.fromIdOriginal = fwd->fromOriginal()->id;
if (fwd->authorOriginal()->isChannel()) {
config.originalId = fwd->idOriginal();
}
}
auto fwdViaBot = fwd->viaBot();
if (fwdViaBot) config.viaBotId = peerToUser(fwdViaBot->id);