mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-04 00:15:42 +00:00
Added initial implementation of filter for MTP updates.
This commit is contained in:
@@ -126,6 +126,7 @@ PRIVATE
|
|||||||
api/api_earn.h
|
api/api_earn.h
|
||||||
api/api_editing.cpp
|
api/api_editing.cpp
|
||||||
api/api_editing.h
|
api/api_editing.h
|
||||||
|
api/api_filter_updates.h
|
||||||
api/api_global_privacy.cpp
|
api/api_global_privacy.cpp
|
||||||
api/api_global_privacy.h
|
api/api_global_privacy.h
|
||||||
api/api_hash.cpp
|
api/api_hash.cpp
|
||||||
|
27
Telegram/SourceFiles/api/api_filter_updates.h
Normal file
27
Telegram/SourceFiles/api/api_filter_updates.h
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
This file is part of Telegram Desktop,
|
||||||
|
the official desktop application for the Telegram messaging service.
|
||||||
|
|
||||||
|
For license and copyright information please follow this link:
|
||||||
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace Api {
|
||||||
|
|
||||||
|
template <typename Type>
|
||||||
|
void PerformForUpdate(
|
||||||
|
const MTPUpdates &updates,
|
||||||
|
Fn<void(const Type &)> callback) {
|
||||||
|
updates.match([&](const MTPDupdates &updates) {
|
||||||
|
for (const auto &update : updates.vupdates().v) {
|
||||||
|
update.match([&](const Type &d) {
|
||||||
|
callback(d);
|
||||||
|
}, [](const auto &) {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [](const auto &) {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Api
|
Reference in New Issue
Block a user