class

XMPP::DirectInvitation

Inherits Reference / Object

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("romeo@example.org", "courtyard@chat.example.org", 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

Constructors

new(client : Client)
Source

Instance methods

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). Options such as reason, password, and thread are carried as attributes on the invite payload.

Source