JIDs now have typed and stringy methods for node/domain/resource access

Jid now has typed with_resource and stringy with_resource_str
Jid now has is_full, is_bare
This commit is contained in:
xmppftw xmppftw 2023-06-21 18:30:25 +02:00
commit 4266368a98
8 changed files with 177 additions and 39 deletions

View file

@ -109,13 +109,13 @@ impl Client {
jid: Jid,
password: String,
) -> Result<XMPPStream, Error> {
let username = jid.node().unwrap();
let username = jid.node_str().unwrap();
let password = password;
// TCP connection
let tcp_stream = match server {
ServerConfig::UseSrv => {
connect_with_srv(jid.domain(), "_xmpp-client._tcp", 5222).await?
connect_with_srv(jid.domain_str(), "_xmpp-client._tcp", 5222).await?
}
ServerConfig::Manual { host, port } => connect_to_host(host.as_str(), port).await?,
};