mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
NB Broken! Moving from registerPeerObserver() to base::Subscriber.
This commit is contained in:
@@ -48,6 +48,8 @@ void FinishCallback() {
|
||||
}
|
||||
ObservedEventRegistrator<PeerUpdate::Flags, PeerUpdateHandler> creator(StartCallback, FinishCallback);
|
||||
|
||||
base::Observable<PeerUpdate, PeerUpdatedHandler> PeerUpdatedObservable;
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace internal {
|
||||
@@ -116,10 +118,20 @@ void peerUpdatedSendDelayed() {
|
||||
for_const (auto &update, allList) {
|
||||
creator.notify(update.flags, update);
|
||||
}
|
||||
for (auto &update : smallList) {
|
||||
PeerUpdated().notify(std_::move(update), true);
|
||||
}
|
||||
for (auto &update : allList) {
|
||||
PeerUpdated().notify(std_::move(update), true);
|
||||
}
|
||||
if (SmallUpdates->isEmpty()) {
|
||||
std::swap(smallList, *SmallUpdates);
|
||||
SmallUpdates->resize(0);
|
||||
}
|
||||
}
|
||||
|
||||
base::Observable<PeerUpdate, PeerUpdatedHandler> &PeerUpdated() {
|
||||
return PeerUpdatedObservable;
|
||||
}
|
||||
|
||||
} // namespace Notify
|
||||
|
Reference in New Issue
Block a user