1
0
mirror of https://gitlab.com/xmpp-rs/xmpp-rs.git synced 2024-06-12 11:14:02 +02:00

xmpp: add MucUser payload in send_room_private_message Messages

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2023-06-07 18:51:12 +02:00
parent b8ba74e336
commit d52ace59a9
No known key found for this signature in database
GPG Key ID: DEDA74AEECA9D0F2

View File

@ -259,12 +259,16 @@ impl Agent {
&mut self,
room: BareJid,
recipient: RoomNick,
type_: MessageType,
lang: &str,
text: &str,
) {
let recipient = room.with_resource(recipient);
self.send_message(recipient.into(), type_, lang, text).await
let recipient: Jid = room.with_resource(recipient).into();
let mut message = Message::new(Some(recipient)).with_payload(MucUser::new());
message.type_ = MessageType::Chat;
message
.bodies
.insert(String::from(lang), Body(String::from(text)));
let _ = self.client.send_stanza(message.into()).await;
}
fn make_initial_presence(disco: &DiscoInfoResult, node: &str) -> Presence {