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

@ -17,7 +17,7 @@ pub async fn bind<S: AsyncRead + AsyncWrite + Unpin>(
if stream.stream_features.can_bind() {
let resource = stream
.jid
.resource()
.resource_str()
.and_then(|resource| Some(resource.to_owned()));
let iq = Iq::from_set(BIND_REQ_ID, BindQuery::new(resource));
stream.send_stanza(iq).await?;