"Fossies" - the Fresh Open Source Software Archive

Member "tdesktop-4.8.3/Telegram/SourceFiles/api/api_self_destruct.h" (1 Jun 2023, 927 Bytes) of package /linux/misc/tdesktop-4.8.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "api_self_destruct.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2 This file is part of Telegram Desktop,
    3 the official desktop application for the Telegram messaging service.
    4 
    5 For license and copyright information please follow this link:
    6 https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
    7 */
    8 #pragma once
    9 
   10 #include "mtproto/sender.h"
   11 
   12 class ApiWrap;
   13 
   14 namespace Api {
   15 
   16 class SelfDestruct final {
   17 public:
   18     explicit SelfDestruct(not_null<ApiWrap*> api);
   19 
   20     void reload();
   21     void updateAccountTTL(int days);
   22     void updateDefaultHistoryTTL(TimeId period);
   23 
   24     [[nodiscard]] rpl::producer<int> daysAccountTTL() const;
   25     [[nodiscard]] rpl::producer<TimeId> periodDefaultHistoryTTL() const;
   26     [[nodiscard]] TimeId periodDefaultHistoryTTLCurrent() const;
   27 
   28 private:
   29     MTP::Sender _api;
   30     struct {
   31         mtpRequestId requestId = 0;
   32         rpl::variable<int> days = 0;
   33     } _accountTTL;
   34 
   35     struct {
   36         mtpRequestId requestId = 0;
   37         rpl::variable<TimeId> period = 0;
   38     } _defaultHistoryTTL;
   39 
   40 };
   41 
   42 } // namespace Api