module
XMPP::Me
Overview
Me provides helpers for XEP-0245 - The /me Command.
XEP-0245 is a purely client-side convention: a message whose body begins with the exact string "/me " indicates that the sender is performing a third-person action. A conforming client sends such a body verbatim and, when displaying one received from another user, replaces the "/me " prefix with the sender's identity (nickname, local part, etc.) preceded by an asterisk.
body = XMPP::Me.body("dances a jig") # => "/me dances a jig" text = XMPP::Me.display("Juliet", body) # => "* Juliet dances a jig"
See: https://xmpp.org/extensions/xep-0245.html
Defined in:
xmpp/me.crConstant Summary
-
PREFIX =
"/me " -
The literal prefix that marks a body as a /me command.
Class Method Summary
-
.body(text : String) : String
body wraps the given text in the /me prefix for sending.
-
.display(identity : String, text : String) : String
display renders a /me command for presentation, replacing the prefix with the speaker's identity.
Class Method Detail
display renders a /me command for presentation, replacing the prefix with the speaker's identity. If the text does not start with the /me prefix it is returned unchanged.