Closed yuanshengyong closed 12 months ago
You can use QXmppClient::send()
(see https://doc.qxmpp.org/qxmpp-1/classQXmppClient.html#a750350f089a0e45e1aee3d032e84980c).
for example, like this (untested)
QXmppMessage msg;
client->send(std::move(msg)).then(this, [](auto result) {
if (auto success = std::get_if<QXmpp::SendSuccess>(&result)) {
qDebug() << "Sent packet" << "got acknowledgement from local server:" << success->acknowledged;
} else {
auto error = std::get<QXmppError>(result);
qDebug() << "Error sending message:" << error.description;
}
})
Hello, may I ask how to confirm that this message has been sent normally after calling the sendpacket interface? Currently, only group chat and errors will receive the messageReceived signal