Radix Relay
Hybrid mesh communications with Signal Protocol encryption
Loading...
Searching...
No Matches
semver_utils.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <algorithm>
4
#include <optional>
5
#include <string>
6
#include <vector>
7
8
namespace
radix_relay::nostr
{
9
16
[[nodiscard]]
inline
auto
extract_version_from_tags
(
const
std::vector<std::vector<std::string>> &tags)
17
-> std::optional<std::string>
18
{
19
auto
it = std::find_if(
20
tags.begin(), tags.end(), [](
const
auto
&tag) { return tag.size() >= 2 and tag[0] ==
"radix_version"
; });
21
22
if
(it != tags.end()) {
return
(*it)[1]; }
23
return
std::nullopt;
24
}
25
26
}
// namespace radix_relay::nostr
radix_relay::nostr
Definition
events.hpp:5
radix_relay::nostr::extract_version_from_tags
auto extract_version_from_tags(const std::vector< std::vector< std::string > > &tags) -> std::optional< std::string >
Extracts Radix protocol version from Nostr event tags.
Definition
semver_utils.hpp:16
lib
nostr
include
nostr
semver_utils.hpp
Generated by
1.9.8