Ivan-lis
c52d237dc4
All checks were successful
PR Check / on-push-commit-check (push) Successful in 13m52s
30 lines
1,020 B
C++
30 lines
1,020 B
C++
#include <larra/roster.hpp>
|
|
#include <larra/serialization/auto.hpp>
|
|
|
|
namespace larra::xmpp::serialization {
|
|
namespace iq = larra::xmpp::iq;
|
|
|
|
template <>
|
|
constexpr auto kSerializationConfig<iq::RosterItem> = SerializationConfig<iq::RosterItem>{};
|
|
template <>
|
|
constexpr auto kSerializationConfig<iq::Roster> = SerializationConfig<iq::Roster>{}.With<"items">({Config<std::vector<iq::RosterItem>>{}});
|
|
} // namespace larra::xmpp::serialization
|
|
|
|
namespace larra::xmpp::iq {
|
|
namespace S = larra::xmpp::serialization;
|
|
|
|
auto operator<<(xmlpp::Element* element, const RosterItem& self) -> void {
|
|
S::Serialize(element, self);
|
|
}
|
|
auto RosterItem::Parse(xmlpp::Element* element) -> RosterItem {
|
|
return S::Parse<RosterItem>(element);
|
|
}
|
|
|
|
auto operator<<(xmlpp::Element* element, const Roster& self) -> void {
|
|
element->set_attribute("xmlns", Roster::kDefaultNamespace);
|
|
S::Serialize(element, self);
|
|
}
|
|
auto Roster::Parse(xmlpp::Element* element) -> Roster {
|
|
return S::Parse<Roster>(element);
|
|
}
|
|
} // namespace larra::xmpp::iq
|