mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-04 08:25:38 +00:00
Save correct starsPerMessage for admins.
This commit is contained in:
@@ -999,6 +999,10 @@ not_null<PeerData*> Session::processChat(const MTPChat &data) {
|
||||
= data.vsend_paid_messages_stars().has_value();
|
||||
if (!hasStarsPerMessage) {
|
||||
channel->setStarsPerMessage(0);
|
||||
} else if (const auto count = data.vsend_paid_messages_stars()->v) {
|
||||
_commonStarsPerMessage[channel] = count;
|
||||
} else {
|
||||
_commonStarsPerMessage.remove(channel);
|
||||
}
|
||||
const auto storiesState = minimal
|
||||
? std::optional<Data::Stories::PeerSourceState>()
|
||||
@@ -5137,6 +5141,11 @@ rpl::producer<SentFromScheduled> Session::sentFromScheduled() const {
|
||||
return _sentFromScheduled.events();
|
||||
}
|
||||
|
||||
int Session::commonStarsPerMessage(not_null<ChannelData*> channel) const {
|
||||
const auto i = _commonStarsPerMessage.find(channel);
|
||||
return (i != end(_commonStarsPerMessage)) ? i->second : 0;
|
||||
}
|
||||
|
||||
void Session::clearLocalStorage() {
|
||||
_cache->close();
|
||||
_cache->clear();
|
||||
|
Reference in New Issue
Block a user