2019-11-11 17:14:32 +01:00
|
|
|
//
|
2024-01-01 01:07:21 +01:00
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
|
2019-11-11 17:14:32 +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/DialogAdministrator.h"
|
|
|
|
|
2024-04-02 02:52:34 +02:00
|
|
|
#include "td/telegram/UserManager.h"
|
2019-11-11 17:14:32 +01:00
|
|
|
|
|
|
|
namespace td {
|
|
|
|
|
|
|
|
td_api::object_ptr<td_api::chatAdministrator> DialogAdministrator::get_chat_administrator_object(
|
2024-04-02 02:52:34 +02:00
|
|
|
const UserManager *user_manager) const {
|
|
|
|
CHECK(user_manager != nullptr);
|
2019-11-11 17:14:32 +01:00
|
|
|
CHECK(user_id_.is_valid());
|
|
|
|
return td_api::make_object<td_api::chatAdministrator>(
|
2024-04-02 02:52:34 +02:00
|
|
|
user_manager->get_user_id_object(user_id_, "get_chat_administrator_object"), rank_, is_creator_);
|
2019-11-11 17:14:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
StringBuilder &operator<<(StringBuilder &string_builder, const DialogAdministrator &administrator) {
|
2020-10-01 18:28:10 +02:00
|
|
|
return string_builder << "ChatAdministrator[" << administrator.user_id_ << ", title = " << administrator.rank_
|
2019-12-07 21:38:05 +01:00
|
|
|
<< ", is_owner = " << administrator.is_creator_ << "]";
|
2019-11-11 17:14:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace td
|