XMPP::MessageCorrection
MessageCorrection is a high-level client for XEP-0308 - Last Message Correction.
A corrected chat message replaces an earlier one by referencing its id. Receivers with support treat the new body as authoritative.
corrector = XMPP::MessageCorrection.new(client) corrector.correct(to: "juliet@capulet.lit", original_id: id, body: "My pardon")
Incoming corrections are handled like any other message:
client.on("message") do |s, m| if replace = m.as(XMPP::Stanza::Message).get(XMPP::Stanza::Replace) replace.id # the id of the message being corrected end end
See: https://xmpp.org/extensions/xep-0308.html
Constructors
new(client : Client)
SourceInstance methods
correct sends a corrected message whose body supersedes the message identified by original_id.