tdlight/td/telegram/GroupCallVideoPayload.cpp

32 lines
828 B
C++
Raw Normal View History

2021-01-12 15:05:25 +01:00
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2021
//
// 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/GroupCallVideoPayload.h"
#include "td/utils/JsonBuilder.h"
namespace td {
2021-04-30 16:49:00 +02:00
void get_group_call_video_payload(string json, string &endpoint) {
2021-01-12 15:05:25 +01:00
auto r_value = json_decode(json);
if (r_value.is_error()) {
2021-04-30 16:49:00 +02:00
return;
2021-01-12 15:05:25 +01:00
}
auto value = r_value.move_as_ok();
if (value.type() != JsonValue::Type::Object) {
2021-04-30 16:49:00 +02:00
return;
2021-01-12 15:05:25 +01:00
}
auto &value_object = value.get_object();
2021-04-30 16:49:00 +02:00
auto r_endpoint = get_json_object_string_field(value_object, "endpoint", true);
if (r_endpoint.is_ok()) {
endpoint = r_endpoint.move_as_ok();
2021-01-12 15:05:25 +01:00
}
}
} // namespace td