Compare commits
1 commit
1d870fbe54
...
9d95d08ab7
Author | SHA1 | Date | |
---|---|---|---|
9d95d08ab7 |
3 changed files with 7 additions and 1 deletions
|
@ -111,6 +111,9 @@ struct Client {
|
|||
get_roster_response);
|
||||
co_return;
|
||||
}
|
||||
[[nodiscard]] auto Roster() const -> const std::vector<iq::RosterItem>& {
|
||||
return this->roster.items;
|
||||
}
|
||||
|
||||
private:
|
||||
bool active = true;
|
||||
|
|
|
@ -6,6 +6,7 @@ struct XmlLanguage : std::string {
|
|||
static constexpr auto kDefaultName = "lang";
|
||||
static constexpr auto kDefaultNamespace = "xml";
|
||||
using std::string::basic_string;
|
||||
constexpr XmlLanguage() : std::string{"en"} {};
|
||||
constexpr XmlLanguage(std::string str) : std::string(std::move(str)) {
|
||||
}
|
||||
static constexpr auto Parse(std::string_view view) -> XmlLanguage {
|
||||
|
|
|
@ -41,7 +41,9 @@ TEST(Parse, Message) {
|
|||
}
|
||||
|
||||
TEST(Serialize, Message) {
|
||||
auto expected = CreateTestData()->write_to_string();
|
||||
auto expected =
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<message from=\"user1@server.i2p\" to=\"user2@server.i2p\" type=\"chat\" id=\"1\" "
|
||||
"xml:lang=\"en\"><body>hello</body></message>\n";
|
||||
xmlpp::Document doc;
|
||||
auto node = doc.create_root_node("message");
|
||||
Serialization<Message<BareJid, BareJid>>::Serialize(node, kMessage);
|
||||
|
|
Loading…
Reference in a new issue