class
XMPP::DirectInvitation
- XMPP::DirectInvitation
- Reference
- Object
Overview
DirectInvitation is a high-level client for XEP-0249 - Direct MUC Invitations.
A direct invitation is a person-to-person message carrying a Stanza::DirectInvite payload that points the recipient at a room. Send one to a user with the room JID you want them to join.
inviter = XMPP::DirectInvitation.new(client) inviter.invite("[email protected]", "[email protected]", reason: "Watching you, Montague")
Incoming direct invitations are handled like any other message:
client.on("message") do |s, m| if invite = m.as(XMPP::Stanza::Message).get(XMPP::Stanza::DirectInvite) # invite.jid is the room to join end end
See: https://xmpp.org/extensions/xep-0249.html
Defined in:
xmpp/direct_invitation.crConstructors
Instance Method Summary
-
#invite(to : String, jid : String, reason : String | Nil = nil, password : String | Nil = nil, thread : String | Nil = nil, continue : Bool = false)
invite sends a direct invitation for the given room (jid) to the recipient (to).
Constructor Detail
Instance Method Detail
invite sends a direct invitation for the given room (jid) to the recipient (to). Options such as reason, password, and thread are carried as attributes on the invite payload.