mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Fixed Api requests for statistics with non-default DC.
This commit is contained in:
@@ -1120,6 +1120,10 @@ void ApplyChannelUpdate(
|
||||
channel,
|
||||
update.vnotify_settings());
|
||||
|
||||
if (update.vstats_dc()) {
|
||||
channel->owner().applyStatsDcId(channel, update.vstats_dc()->v);
|
||||
}
|
||||
|
||||
if (const auto sendAs = update.vdefault_send_as()) {
|
||||
session->sendAsPeers().setChosen(channel, peerFromMTP(*sendAs));
|
||||
} else {
|
||||
|
@@ -4532,6 +4532,15 @@ uint64 Session::wallpapersHash() const {
|
||||
return _wallpapersHash;
|
||||
}
|
||||
|
||||
MTP::DcId Session::statsDcId(not_null<ChannelData*> channel) {
|
||||
const auto it = _channelStatsDcIds.find(channel);
|
||||
return (it == end(_channelStatsDcIds)) ? MTP::DcId(0) : it->second;
|
||||
}
|
||||
|
||||
void Session::applyStatsDcId(not_null<ChannelData*> channel, MTP::DcId dcId) {
|
||||
_channelStatsDcIds[channel] = dcId;
|
||||
}
|
||||
|
||||
void Session::webViewResultSent(WebViewResultSent &&sent) {
|
||||
return _webViewResultSent.fire(std::move(sent));
|
||||
}
|
||||
|
@@ -730,6 +730,9 @@ public:
|
||||
[[nodiscard]] auto peerDecorationsUpdated() const
|
||||
-> rpl::producer<not_null<PeerData*>>;
|
||||
|
||||
void applyStatsDcId(not_null<ChannelData*>, MTP::DcId);
|
||||
[[nodiscard]] MTP::DcId statsDcId(not_null<ChannelData*>);
|
||||
|
||||
void clearLocalStorage();
|
||||
|
||||
private:
|
||||
@@ -1014,6 +1017,8 @@ private:
|
||||
base::flat_map<not_null<UserData*>, TimeId> _watchingForOffline;
|
||||
base::Timer _watchForOfflineTimer;
|
||||
|
||||
base::flat_map<not_null<ChannelData*>, MTP::DcId> _channelStatsDcIds;
|
||||
|
||||
rpl::event_stream<WebViewResultSent> _webViewResultSent;
|
||||
|
||||
rpl::event_stream<not_null<PeerData*>> _peerDecorationsUpdated;
|
||||
|
Reference in New Issue
Block a user