2021-12-21 12:06:15 +01:00
|
|
|
//
|
2024-01-01 01:07:21 +01:00
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
|
2021-12-21 12:06:15 +01:00
|
|
|
//
|
|
|
|
// 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)
|
|
|
|
//
|
|
|
|
#include "td/telegram/MessageTtl.h"
|
|
|
|
|
|
|
|
namespace td {
|
|
|
|
|
|
|
|
bool MessageTtl::is_empty() const {
|
|
|
|
return period_ == 0;
|
|
|
|
}
|
|
|
|
|
2022-12-28 19:46:16 +01:00
|
|
|
int32 MessageTtl::get_message_auto_delete_time_object() const {
|
2021-12-21 12:06:15 +01:00
|
|
|
return period_;
|
|
|
|
}
|
|
|
|
|
2022-11-29 13:44:12 +01:00
|
|
|
int32 MessageTtl::get_input_ttl_period() const {
|
|
|
|
return period_;
|
|
|
|
}
|
|
|
|
|
2021-12-21 12:06:15 +01:00
|
|
|
bool operator==(const MessageTtl &lhs, const MessageTtl &rhs) {
|
|
|
|
return lhs.period_ == rhs.period_;
|
|
|
|
}
|
|
|
|
|
|
|
|
StringBuilder &operator<<(StringBuilder &string_builder, const MessageTtl &message_ttl) {
|
|
|
|
return string_builder << "MessageTtl[" << message_ttl.period_ << "]";
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace td
|