tdlight/td/telegram/GroupCallParticipantOrder.h

65 lines
2.1 KiB
C
Raw Normal View History

2021-03-15 16:32:28 +01:00
//
2022-12-31 22:28:08 +01:00
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
2021-03-15 16:32:28 +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)
//
#pragma once
#include "td/utils/common.h"
#include "td/utils/StringBuilder.h"
namespace td {
class GroupCallParticipantOrder {
bool has_video_ = false;
int32 active_date_ = 0;
int32 joined_date_ = 0;
int64 raise_hand_rating_ = 0;
2021-03-15 16:32:28 +01:00
friend StringBuilder &operator<<(StringBuilder &string_builder,
const GroupCallParticipantOrder &group_call_participant_order);
friend bool operator==(const GroupCallParticipantOrder &lhs, const GroupCallParticipantOrder &rhs);
friend bool operator<(const GroupCallParticipantOrder &lhs, const GroupCallParticipantOrder &rhs);
public:
GroupCallParticipantOrder() = default;
GroupCallParticipantOrder(bool has_video, int32 active_date, int64 raise_hand_rating, int32 joined_date)
: has_video_(has_video)
, active_date_(active_date)
, joined_date_(joined_date)
, raise_hand_rating_(raise_hand_rating) {
2021-03-15 16:32:28 +01:00
}
static GroupCallParticipantOrder min();
2021-03-15 16:32:28 +01:00
static GroupCallParticipantOrder max();
bool is_valid() const;
bool has_video() const {
return has_video_;
}
string get_group_call_participant_order_object() const;
2021-03-15 16:32:28 +01:00
};
bool operator==(const GroupCallParticipantOrder &lhs, const GroupCallParticipantOrder &rhs);
bool operator!=(const GroupCallParticipantOrder &lhs, const GroupCallParticipantOrder &rhs);
bool operator<(const GroupCallParticipantOrder &lhs, const GroupCallParticipantOrder &rhs);
bool operator<=(const GroupCallParticipantOrder &lhs, const GroupCallParticipantOrder &rhs);
bool operator>(const GroupCallParticipantOrder &lhs, const GroupCallParticipantOrder &rhs);
bool operator>=(const GroupCallParticipantOrder &lhs, const GroupCallParticipantOrder &rhs);
StringBuilder &operator<<(StringBuilder &string_builder, const GroupCallParticipantOrder &group_call_participant_order);
} // namespace td