import { xml } from '@xmpp/client' ; import { Element } from 'ltx' ; export class StanzaBuilder { static buildRoomMessage ( from , roomJid , content = [ ] ) { return xml ( 'message' , { from , to : roomJid , type : 'groupchat' } , ... content ) ; } static buildRoomMessageWithBody ( from , roomJid , body , content = [ ] ) { return StanzaBuilder . buildRoomMessage ( from , roomJid , [ xml ( 'body' , { } , body ) , ... content ] ) ; } static buildRoomMessageWithThread ( from , roomJid , body , thread ) { return StanzaBuilder . buildRoomMessageWithBody ( from , roomJid , body , [ xml ( 'thread' , { } , thread ) ] ) ; } }