Page MenuHomePhorge

discovery.hpp
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

discovery.hpp

/*
* Copyright (C) 2020 Tusooa Zhu
*
* This file is part of libkazv.
*
* libkazv is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* libkazv is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with libkazv. If not, see <https://www.gnu.org/licenses/>.
*/
#include "types.hpp"
namespace Kazv
{
struct Result {
Status status;
std::optional<std::string> homeserver;
std::optional<std::string> identityServer;
};
Result parseHomeserver(Response r);
auto GetWellKnownJob::parse(Response r) -> Result
{
if (r.statusCode == 404) {
return Result{SUCC};
} else if (r.statusCode != 200
|| !isBodyJson(r.body)) {
return Result{FAIL};
} else {
return Result{FAIL};
}
}
}

File Metadata

Mime Type
text/x-c++
Expires
Fri, Jul 18, 7:39 AM (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
241568
Default Alt Text
discovery.hpp (1 KB)

Event Timeline