Liking cljdoc? Tell your friends :D

clj-symphony.message

Operations related to MessageMLv2 messages, which combine one or more of:

  1. a human-readable message (formatted using a subset of HTML called 'PresentationML')
  2. a machine readable JSON blob called the 'entity data'
  3. an attachment

See:

Operations related to MessageMLv2 messages, which combine one or more of:

 1. a human-readable message (formatted using a subset of HTML called 'PresentationML')
 2. a machine readable JSON blob called the 'entity data'
 3. an attachment

See:

 * https://rest-api.symphony.com/docs/messagemlv2 for details on PresentationML's formatting capabilities
 * https://rest-api.symphony.com/docs/objects for details on MessageMLv2's entity data capabilities
raw docstring

deregister-listener!clj

(deregister-listener! c l)

Deregisters a previously-registered message listener. Once deregistered, a listener should be discarded (they cannot be reused). Returns true if a valid message listener was deregistered, false otherwise.

Deregisters a previously-registered message listener.  Once deregistered, a
listener should be discarded (they cannot be reused). Returns `true` if a
valid message listener was deregistered, `false` otherwise.
sourceraw docstring

entity-idsclj

(entity-ids text)

Returns an ordered sequence of all entity ids found in the given PresentationML.

Returns an ordered sequence of all entity ids found in the given PresentationML.
sourceraw docstring

escapeclj

(escape s)

Escapes the given string as content in a MessageMLv2 message.

Escapes the given string as content in a MessageMLv2 message.
sourceraw docstring

mentionscljmultimethod

(mentions m)

Returns the list of user ids mentioned in the message (or nil if there aren't any). Note that due to a bug in Symphony, @mentions of cross-pod users that the author of the message isn't connected to will be missing from the result.

Returns the list of user ids mentioned in the message (or nil if there aren't any). Note that due to a bug in
Symphony, @mentions of cross-pod users that the author of the message isn't connected to will be missing from the
result.
sourceraw docstring

msgobj->mapclj

(msgobj->map m)

Converts a org.symphonyoss.symphony.clients.model.SymMessage object into a map with these keys:

KeyDescription
:message-idThe id of the message.
:timestampThe timestamp of the message.
:stream-idThe stream id of the stream the message was sent to.
:user-idThe user id of the user who sent the message.
:typeThe 'type' of the message. (seems to be unused??)
:textThe PresentationML 'text' of the message.
:attachmentThe attachment for the message (if any).
:entity-dataThe parsed JSON 'entity data' for the message as a map (if any).
Converts a `org.symphonyoss.symphony.clients.model.SymMessage` object into a
map with these keys:

| Key              | Description                                                      |
|------------------|------------------------------------------------------------------|
| `:message-id`    | The id of the message.                                           |
| `:timestamp`     | The timestamp of the message.                                    |
| `:stream-id`     | The stream id of the stream the message was sent to.             |
| `:user-id`       | The user id of the user who sent the message.                    |
| `:type`          | The 'type' of the message. *(seems to be unused??)*              |
| `:text`          | The PresentationML 'text' of the message.                        |
| `:attachment`    | The attachment for the message (if any).                         |
| `:entity-data`   | The parsed JSON 'entity data' for the message as a map (if any). |
sourceraw docstring

register-listener!clj

(register-listener! c f)

Registers f, a function with 1 parameter, as a message listener (callback), and returns a handle to that listener so that it can be deregistered later on, if needed. Listeners registered in this manner are not scoped to any particular stream - they will be sent all messages from all streams that the authenticated connection user is a participant in.

The argument passed to f is a map generated by msgobj->map.

The value returned by f (if any) is ignored.

Registers f, a function with 1 parameter, as a message listener (callback),
and returns a handle to that listener so that it can be deregistered later on,
if needed.  Listeners registered in this manner are not scoped to any
particular stream - they will be sent all messages from all streams that the
authenticated connection user is a participant in.

The argument passed to f is a map generated by [[msgobj->map]].

The value returned by f (if any) is ignored.
sourceraw docstring

sanitise-tagclj

(sanitise-tag s)

Sanitises the given string for use in a Symphony hashtag or cashtag.

Sanitises the given string for use in a Symphony hashtag or cashtag.
sourceraw docstring

sanitize-tagclj

English (simplified) version of sanitise-tag. See that fn for details.

English (simplified) version of sanitise-tag.  See that fn for details.
sourceraw docstring

send-message!clj

(send-message! c s m)
(send-message! c s m ed)
(send-message! c s m ed a)

Sends a message to the stream s (which can be anything supported by clj-symphony.stream/stream-id).

  • m is a String containing MessageMLv2
  • ed is a map or a JSON String containing entity data (a map will be converted to a String)
  • a is an attachment (something compatible with clojure.java.io/file)
Sends a message to the stream `s` (which can be anything supported by [[clj-symphony.stream/stream-id]]).

* `m` is a String containing MessageMLv2
* `ed` is a map or a JSON String containing entity data (a map will be converted to a String)
* `a` is an attachment (something compatible with [clojure.java.io/file](https://clojure.github.io/clojure/clojure.java.io-api.html))
sourceraw docstring

to-plain-textclj

(to-plain-text text)

Converts a MessageML message to plain text, by stripping most tags, converting <p> and <br/> tags into newlines, and unescaping HTML entities into their Unicode equivalents.

Converts a MessageML message to plain text, by stripping most tags,
converting `<p>` and `<br/>` tags into newlines, and unescaping HTML entities
into their Unicode equivalents.
sourceraw docstring

tokensclj

(tokens m)

Returns the tokens (words) in the given MessageML message, in all lower case. Splits on whitespace and punctuation (via the Java regex pattern [\p{Punct}\s]+). Note that message content that contains whitespace within a single tag will also be split - this is especially noticable for @mentions containing a person's first and last names.

Returns the tokens (words) in the given MessageML message, in all lower case.  Splits on whitespace and punctuation
(via the Java regex pattern `[\p{Punct}\s]+`).  Note that message content that contains whitespace within a single
tag will also be split - this is especially noticable for @mentions containing a person's first and last names.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close