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
8namespace 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
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.