@@ -931,6 +931,7 @@ void PeerData::setBarSettings(const MTPPeerSettings &data) {
931931}
932932
933933void PeerData::setBarSettings (PeerBarSettings which) {
934+ const auto wasSettings = _barSettings.current ();
934935 const auto was = hideLinks ();
935936 _barSettings.set (which);
936937 if (was && !hideLinks ()) {
@@ -947,6 +948,9 @@ void PeerData::setBarSettings(PeerBarSettings which) {
947948 }
948949 }
949950 }
951+ if (_barSettings.current () != wasSettings) {
952+ session ().changes ().peerUpdated (this , UpdateFlag::BarSettings);
953+ }
950954}
951955
952956int PeerData::paysPerMessage () const {
@@ -981,6 +985,24 @@ bool PeerData::hideLinks() const {
981985 return !settings || (*settings & PeerBarSetting::ReportSpam);
982986}
983987
988+ bool PeerData::hideEmojiStatus () const {
989+ if (const auto to = migrateTo ()) {
990+ return to->hideEmojiStatus ();
991+ }
992+ const auto settings = barSettings ();
993+ return settings && (*settings & PeerBarSetting::ReportSpam);
994+ }
995+
996+ bool PeerData::keepIncomingUnread () const {
997+ if (const auto to = migrateTo ()) {
998+ return to->keepIncomingUnread ();
999+ }
1000+ // WHY: unknown settings hold too, as every reading host requests them
1001+ // and requestPeerSettings() always ends with known settings.
1002+ const auto settings = barSettings ();
1003+ return !settings || (*settings & PeerBarSetting::ReportSpam);
1004+ }
1005+
9841006QString PeerData::requestChatTitle () const {
9851007 return _barDetails ? _barDetails->requestChatTitle : QString ();
9861008}
0 commit comments