aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/AffectedHistory.h
blob: f28e2384186897c6b12cd8db2ba00f3e12c32796 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2026
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once

#include "td/telegram/telegram_api.h"

#include "td/utils/common.h"

namespace td {

struct AffectedHistory {
  int32 pts_;
  int32 pts_count_;
  bool is_final_;

  explicit AffectedHistory(tl_object_ptr<telegram_api::messages_affectedHistory> &&affected_history)
      : pts_(affected_history->pts_)
      , pts_count_(affected_history->pts_count_)
      , is_final_(affected_history->offset_ <= 0) {
  }

  explicit AffectedHistory(tl_object_ptr<telegram_api::messages_affectedFoundMessages> &&affected_history)
      : pts_(affected_history->pts_)
      , pts_count_(affected_history->pts_count_)
      , is_final_(affected_history->offset_ <= 0) {
  }
};

}  // namespace td