Converse converse.js

Global

Members

(constant) helpers

Pure functions to help funcitonally parse messages.

License:
  • Mozilla Public License (MPLv2)
Source:
To Do:
  • Other parsing helpers can be made more abstract and placed here.

(constant) renderImage

lit-html directive which attempts to render an element from a URL. It will fall back to rendering an element if it can't.

Source:

Methods

(private) getChatState(stanza)

Returns the XEP-0085 chat state contained in a message stanza

Parameters:
Name Type Description
stanza XMLElement

The message stanza

Source:

(private) getErrorAttributes(stanza)

Returns the human readable error message contained in a groupchat message stanza of type error.

Parameters:
Name Type Description
stanza XMLElement

The message stanza

Source:

(private) getModerationAttributes(stanza, original_stanza) → {Object}

Parameters:
Name Type Description
stanza XMLElement

The message stanza

original_stanza XMLElement

The original stanza, that contains the message stanza, if it was contained, otherwise it's the message stanza itself.

Source:
Returns:
Type
Object

(private) getRetractionAttributes(stanza, original_stanza) → {Object}

Parameters:
Name Type Description
stanza XMLElement

The message stanza

original_stanza XMLElement

The original stanza, that contains the message stanza, if it was contained, otherwise it's the message stanza itself.

Source:
Returns:
Type
Object

(private) getStanzaIDs(stanza) → {Object}

Extract the XEP-0359 stanza IDs from the passed in stanza and return a map containing them.

Parameters:
Name Type Description
stanza XMLElement

The message stanza

Source:
Returns:
Type
Object

(private) isCarbon(stanza) → {Boolean}

Determines whether the passed in stanza is a XEP-0280 Carbon

Parameters:
Name Type Description
stanza XMLElement

The message stanza

Source:
Returns:
Type
Boolean

onDisconnected()

Gets called once strophe's status reaches Strophe.Status.DISCONNECTED. Will either start a teardown process for converse.js or attempt to reconnect.

Source:

Type Definitions

MemberListItem

Either the JID or the nickname (or both) will be available.

Type:
  • Object
Properties:
Name Type Attributes Description
affiliation string
role string <optional>
jid string <optional>
nick string <optional>
Source:

MessageAttributes

The object which st.parseMessage returns

Type:
  • Object
Properties:
Name Type Description
sender 'me' | 'them'

Whether the message was sent by the current user or someone else

references Array.<Object>

A list of objects representing XEP-0372 references

editable Boolean

Is this message editable via XEP-0308?

is_archived Boolean

Is this message from a XEP-0313 MAM archive?

is_carbon Boolean

Is this message a XEP-0280 Carbon?

is_delayed Boolean

Was delivery of this message was delayed as per XEP-0203?

is_encrypted Boolean

Is this message XEP-0384 encrypted?

is_error Boolean

Whether an error was received for this message

is_headline Boolean

Is this a "headline" message?

is_markable Boolean

Can this message be marked with a XEP-0333 chat marker?

is_marker Boolean

Is this message a XEP-0333 Chat Marker?

is_only_emojis Boolean

Does the message body contain only emojis?

is_valid_receipt_request Boolean

Does this message request a XEP-0184 receipt (and is not from us or a carbon or archived message)

is_spoiler Boolean

Is this a XEP-0382 spoiler message?

is_tombstone Boolean

Is this a XEP-0424 tombstone?

encrypted Object

XEP-0384 encryption payload attributes

body String

The contents of the tag of the message stanza

chat_state String

The XEP-0085 chat state notification contained in this message

contact_jid String

The JID of the other person or entity

edited String

An ISO8601 string recording the time that the message was edited per XEP-0308

error_condition String

The defined error condition

error_text String

The error text received from the server

error_type String

The type of error received from the server

from String

The sender JID

fullname String

The full name of the sender

marker String

The XEP-0333 Chat Marker value

marker_id String

The id attribute of a XEP-0333 chat marker

msgid String

The root id attribute of the stanza

nick String

The roster nickname of the sender

oob_desc String

The description of the XEP-0066 out of band data

oob_url String

The URL of the XEP-0066 out of band data

origin_id String

The XEP-0359 Origin ID

receipt_id String

The id attribute of a XEP-0184 element

received String

An ISO8601 string recording the time that the message was received

replace_id String

The id attribute of a XEP-0308 element

retracted String

An ISO8601 string recording the time that the message was retracted

retracted_id String

The id attribute of a XEP-424 element

spoiler_hint String

The XEP-0382 spoiler hint

stanza_id String

The XEP-0359 Stanza ID. Note: the key is actualy stanza_id ${by_jid} and there can be multiple.

subject String

The element value

thread String

The element value

time String

The time (in ISO8601 format), either given by the XEP-0203 element, or of receipt.

to String

The recipient JID

type String

The type of message

Source:

MUCMessageAttributes

The object which st.parseMUCMessage returns

Type:
  • Object
Properties:
Name Type Description
sender 'me' | 'them'

Whether the message was sent by the current user or someone else

references Array.<Object>

A list of objects representing XEP-0372 references

editable Boolean

Is this message editable via XEP-0308?

is_archived Boolean

Is this message from a XEP-0313 MAM archive?

is_carbon Boolean

Is this message a XEP-0280 Carbon?

is_delayed Boolean

Was delivery of this message was delayed as per XEP-0203?

is_encrypted Boolean

Is this message XEP-0384 encrypted?

is_error Boolean

Whether an error was received for this message

is_headline Boolean

Is this a "headline" message?

is_markable Boolean

Can this message be marked with a XEP-0333 chat marker?

is_marker Boolean

Is this message a XEP-0333 Chat Marker?

is_only_emojis Boolean

Does the message body contain only emojis?

is_valid_receipt_request Boolean

Does this message request a XEP-0184 receipt (and is not from us or a carbon or archived message)

is_spoiler Boolean

Is this a XEP-0382 spoiler message?

is_tombstone Boolean

Is this a XEP-0424 tombstone?

encrypted Object

XEP-0384 encryption payload attributes

body String

The contents of the tag of the message stanza

chat_state String

The XEP-0085 chat state notification contained in this message

edited String

An ISO8601 string recording the time that the message was edited per XEP-0308

error_condition String

The defined error condition

error_text String

The error text received from the server

error_type String

The type of error received from the server

from String

The sender JID (${muc_jid}/${nick})

from_muc String

The JID of the MUC from which this message was sent

from_real_jid String

The real JID of the sender, if available

fullname String

The full name of the sender

marker String

The XEP-0333 Chat Marker value

marker_id String

The id attribute of a XEP-0333 chat marker

moderated String

The type of XEP-0425 moderation (if any) that was applied

moderated_by String

The JID of the user that moderated this message

moderated_id String

The XEP-0359 Stanza ID of the message that this one moderates

moderation_reason String

The reason provided why this message moderates another

msgid String

The root id attribute of the stanza

nick String

The MUC nickname of the sender

oob_desc String

The description of the XEP-0066 out of band data

oob_url String

The URL of the XEP-0066 out of band data

origin_id String

The XEP-0359 Origin ID

receipt_id String

The id attribute of a XEP-0184 element

received String

An ISO8601 string recording the time that the message was received

replace_id String

The id attribute of a XEP-0308 element

retracted String

An ISO8601 string recording the time that the message was retracted

retracted_id String

The id attribute of a XEP-424 element

spoiler_hint String

The XEP-0382 spoiler hint

stanza_id String

The XEP-0359 Stanza ID. Note: the key is actualy stanza_id ${by_jid} and there can be multiple.

subject String

The element value

thread String

The element value

time String

The time (in ISO8601 format), either given by the XEP-0203 element, or of receipt.

to String

The recipient JID

type String

The type of message

Source: