-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export chat messages photos and documents.
Also rename .visit() with .match() in MTP types. Also add base::match_method() and base::match() for base::variant. Also add base::match() and .match() for base::optional_variant.
- Loading branch information
1 parent
0e9793b
commit 83786dd
Showing
13 changed files
with
559 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
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 | ||
|
||
#include <rpl/details/callable.h> | ||
|
||
namespace base { | ||
|
||
template <typename Data, typename Method, typename ...Methods> | ||
inline decltype(auto) match_method( | ||
Data &&data, | ||
Method &&method, | ||
Methods &&...methods) { | ||
if constexpr (rpl::details::is_callable_plain_v<Method, Data&&>) { | ||
return std::forward<Method>(method)(std::forward<Data>(data)); | ||
} else { | ||
return match_method( | ||
std::forward<Data>(data), | ||
std::forward<Methods>(methods)...); | ||
} | ||
} | ||
|
||
} // namespace base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.