1 //
2 // Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2021
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 #pragma once
8 
9 #include "td/telegram/td_api.h"
10 
11 namespace td {
12 
13 enum class PublicDialogType : int32 { HasUsername, IsLocationBased };
14 
get_public_dialog_type(const td_api::object_ptr<td_api::PublicChatType> & type)15 inline PublicDialogType get_public_dialog_type(const td_api::object_ptr<td_api::PublicChatType> &type) {
16   if (type == nullptr || type->get_id() == td_api::publicChatTypeHasUsername::ID) {
17     return PublicDialogType::HasUsername;
18   }
19   return PublicDialogType::IsLocationBased;
20 }
21 
22 }  // namespace td
23