From e7e84860cc4d2dae972775c89d6ab650e275241c Mon Sep 17 00:00:00 2001 From: sha512sum Date: Wed, 9 Oct 2024 16:04:58 +0000 Subject: [PATCH] Send presence in examples/src/connect.cpp --- examples/src/connect.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/src/connect.cpp b/examples/src/connect.cpp index 5c4e064..a7abdce 100644 --- a/examples/src/connect.cpp +++ b/examples/src/connect.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -13,6 +14,11 @@ auto Coroutine() -> boost::asio::awaitable { auto client = co_await larra::xmpp::client::CreateClient>( larra::xmpp::PlainUserAccount{.jid = {.username = "test1", .server = "localhost"}, .password = "test1"}, {.useTls = larra::xmpp::client::Options::kNever}); + co_await std::visit( + [](auto& client) -> boost::asio::awaitable { + co_await client.Send(larra::xmpp::presence::c2s::Available{}); + }, + client); } catch(const std::exception& err) { SPDLOG_ERROR("{}", err.what()); co_return;