Members
(constant) helpers
Pure functions to help functionally parse messages.
- Copyright:
- 2022, the Converse.js contributors
- License:
- Mozilla Public License (MPLv2)
- Source:
- To Do:
-
- Other parsing helpers can be made more abstract and placed here.
punycode :Object
The punycode
object.
Type:
- Object
(constant) renderImage
lit directive which attempts to render an element from a URL. It will fall back to rendering an element if it can't.
- Source:
Methods
_markScrolled()
Called when the chat content is scrolled up or down. We want to record when the user has scrolled away from the bottom, so that we don't automatically scroll away from what the user is reading when new messages are received.
Don't call this method directly, instead, call markScrolled
,
which debounces this method.
- Source:
addCapsNode(stanza)
Given a stanza, adds a XEP-0115 CAPS element
Parameters:
Name | Type | Description |
---|---|---|
stanza |
Element |
- Source:
(private) addResource(presence:)
Adds a new resource and it's associated attributes as taken from the passed in presence stanza. Also updates the presence if the resource has higher priority (and is newer).
Parameters:
Name | Type | Description |
---|---|---|
presence: |
Element | The presence stanza |
applyDragResistance(value, default_value) → {number}
Applies some resistance to value
around the default_value
.
If value is close enough to default_value
, then it is returned, otherwise
value
is returned.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | |
default_value |
number |
- Source:
Returns:
- Type
- number
autoJoinRooms()
Automatically join groupchats, based on the "auto_join_rooms" configuration setting, which is an array of strings (groupchat JIDs) or objects (with groupchat JID and other settings).
- Source:
checkFileTypes(types, url) → {Boolean}
Given the an array of file extensions, check whether a URL points to a file ending in one of them.
Parameters:
Name | Type | Description |
---|---|---|
types |
Array.<String> | An array of file extensions |
url |
String |
- Source:
Returns:
- Type
- Boolean
Example
checkFileTypes(['.gif'], 'https://conversejs.org/cat.gif?foo=bar');
computeAffiliationsDelta(exclude_existing, remove_absentees, new_list, old_list) → {array}
Given two lists of objects with 'jid', 'affiliation' and 'reason' properties, return a new list containing those objects that are new, changed or removed (depending on the 'remove_absentees' boolean).
The affiliations for new and changed members stay the same, for removed members, the affiliation is set to 'none'.
The 'reason' property is not taken into account when comparing whether affiliations have been changed.
Parameters:
Name | Type | Description |
---|---|---|
exclude_existing |
boolean | Indicates whether JIDs from the new list which are also in the old list (regardless of affiliation) should be excluded from the delta. One reason to do this would be when you want to add a JID only if it doesn't have any existing affiliation at all. |
remove_absentees |
boolean | Indicates whether JIDs from the old list which are not in the new list should be considered removed and therefore be included in the delta with affiliation set to 'none'. |
new_list |
array | Array containing the new affiliations |
old_list |
array | Array containing the old affiliations |
Returns:
- Type
- array
(async) confirmDirectMUCInvitation()
Presents a confirmation modal to the user asking them to accept or decline a MUC invitation.
- Source:
(async) connect(credentialsopt) → {Promise.<void>}
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
credentials |
Object |
<optional> |
Properties
|
- Source:
Returns:
- Type
- Promise.<void>
(async) constructPresence(typeopt, toopt, status_messageopt)
Constructs a presence stanza
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
string |
<optional> |
||
to |
string |
<optional> |
null | The JID to which this presence should be sent |
status_message |
string |
<optional> |
- Source:
(async) createPlaceholder(model, options, result)
Create a placeholder message which is used to indicate gaps in the history.
Parameters:
Name | Type | Description |
---|---|---|
model |
_converse.ChatBox | _converse.ChatRoom | |
options |
MAMOptions | |
result |
object | The RSM result object |
- Source:
enableCarbons(reconnecting)
Ask the XMPP server to enable Message Carbons See XEP-0280
Parameters:
Name | Type | Description |
---|---|---|
reconnecting |
Boolean |
- Source:
fetchArchivedMessages(model, optionsopt, should_pageopt)
Fetch XEP-0313 archived messages based on the passed in criteria.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
model |
ChatBox | ChatRoom | |||
options |
MAMOptions |
<optional> |
||
should_page |
'forwards' | 'backwards' | null |
<optional> |
null | Determines whether this function should recursively page through the entire result set if a limited number of results were returned. |
- Source:
fetchFromServer() → {promise}
Fetch the roster from the XMPP server
Fires:
Returns:
- Type
- promise
fetchGIF(url) → {Promise.<ArrayBuffer>}
Makes an HTTP request to fetch a GIF
Parameters:
Name | Type | Description |
---|---|---|
url |
String |
- Source:
Returns:
Returns a promise which resolves with the response data.
- Type
- Promise.<ArrayBuffer>
fetchNewestMessages(model)
Fetches messages that might have been archived after the last archived message in our local cache.
Parameters:
Name | Type | Description |
---|---|---|
model |
_converse.ChatBox | _converse.ChatRoom |
- Source:
fetchRosterContacts() → {promise}
Fetches the roster contacts, first by trying the browser cache, and if that's empty, then by querying the XMPP server.
Returns:
Promise which resolves once the contacts have been fetched.
- Type
- promise
generateBundle()
Generate the cryptographic data used by the X3DH key agreement protocol in order to build a session with other devices.
By generating a bundle, and publishing it via PubSub, we allow other clients to download it and start asynchronous encrypted sessions with us, even if we're offline at that time.
- Source:
generatePreKeys()
Generates, stores and then returns pre-keys.
Pre-keys are one half of a X3DH key exchange and are published as part of the device bundle.
For a new contact or device to establish an encrypted session, it needs to use a pre-key, which it chooses randomly from the list of available ones.
- Source:
getAffiliationList(affiliation, muc_jid) → {Promise.<Array.<MemberListItem>>}
Sends an IQ stanza to the server, asking it for the relevant affiliation list . Returns an array of MemberListItem objects, representing occupants that have the given affiliation. See: https://xmpp.org/extensions/xep-0045.html#modifymember
Parameters:
Name | Type | Description |
---|---|---|
affiliation |
"admin" | "owner" | "member" | |
muc_jid |
String | The JID of the MUC for which the affiliation list should be fetched |
Returns:
- Type
- Promise.<Array.<MemberListItem>>
getAssignableAffiliations(occupant) → {Array.<('owner'|'admin'|'member'|'outcast'|'none')>}
Given an occupant model, see which affiliations may be assigned by that user
Parameters:
Name | Type | Description |
---|---|---|
occupant |
Model |
Returns:
- An array of assignable affiliations
- Type
- Array.<('owner'|'admin'|'member'|'outcast'|'none')>
getAssignableRoles(occupant) → {Array.<('moderator'|'participant'|'visitor')>}
Given an occupant model, see which roles may be assigned to that user.
Parameters:
Name | Type | Description |
---|---|---|
occupant |
Model |
- Source:
Returns:
- An array of assignable roles
- Type
- Array.<('moderator'|'participant'|'visitor')>
getAttributes(stanza) → {Object}
Returns an object containing all attribute names and values for a particular element.
Parameters:
Name | Type | Description |
---|---|---|
stanza |
Element |
- Source:
Returns:
- Type
- Object
getAttributes(stanza) → {Object}
Returns an object containing all attribute names and values for a particular element.
Parameters:
Name | Type | Description |
---|---|---|
stanza |
Element |
Returns:
- Type
- Object
(private) getChatMarker(stanza) → {Boolean}
Determines whether the passed in stanza is a XEP-0333 Chat Marker
Parameters:
Name | Type | Description |
---|---|---|
stanza |
Element | The message stanza |
- Source:
Returns:
- Type
- Boolean
(private) getChatMarker(stanza) → {Boolean}
Determines whether the passed in stanza is a XEP-0333 Chat Marker
Parameters:
Name | Type | Description |
---|---|---|
stanza |
Element | The message stanza |
Returns:
- Type
- Boolean
(private) getChatState(stanza)
Returns the XEP-0085 chat state contained in a message stanza
Parameters:
Name | Type | Description |
---|---|---|
stanza |
Element | The message stanza |
- Source:
getDayIndicator(message)
Given a message object, returns a TemplateResult indicating a new day if the passed in message is more than a day later than its predecessor.
Parameters:
Name | Type | Description |
---|---|---|
message |
_converse.Message |
- Source:
getDirective(text, i, opening)
Given a specific index "i" of "text", return the directive it matches or null otherwise.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
text |
String | The text in which the directive appears |
|
i |
Number | The directive index |
|
opening |
Boolean | true | Whether we're looking for an opening or closing directive |
- Source:
getDirectiveLength(d, i, text)
Given a directive "d", which occurs in "text" at index "i", check that it has a valid closing directive and return the length from start to end of the directive.
Parameters:
Name | Type | Description |
---|---|---|
d |
String | The directive |
i |
Number | The directive index |
text |
String | The text in which the directive appears |
- Source:
(private) getErrorAttributes(stanza)
Returns the human readable error message contained in a groupchat
message stanza of type error
.
Parameters:
Name | Type | Description |
---|---|---|
stanza |
Element | The message stanza |
- Source:
getFilterCriteria() → {String}
Return a string of tab-separated values that are to be used when matching against filter text.
The goal is to be able to filter against the VCard fullname, roster nickname and JID.
Returns:
Lower-cased, tab-separated values
- Type
- String
(async) getHeadingButtons()
Returns a list of objects which represent buttons for the chat's header.
- Source:
Fires:
getHeadingButtons()
Returns a list of objects which represent buttons for the groupchat header.
- Source:
Fires:
(private) getHighestPriorityResource()
Return the resource with the highest priority. If multiple resources have the same priority, take the latest one.
(private) getJIDFromMUCUserData(stanza) → {Object}
Given a MUC stanza, check whether it has extended message information that includes the sender's real JID, as described here: https://xmpp.org/extensions/xep-0313.html#business-storeret-muc-archives
If so, parse and return that data and return the user's JID
Note, this function doesn't check whether this is actually a MAM archived stanza.
Parameters:
Name | Type | Description |
---|---|---|
stanza |
Element | The message stanza |
- Source:
Returns:
- Type
- Object
getMEPActivities(stanza) → {Array}
Parses a message stanza for XEP-0317 MEP notification data
Parameters:
Name | Type | Description |
---|---|---|
stanza |
Element | The message stanza |
- Source:
Returns:
Returns an array of objects representing
- Type
- Array
getMediaURLs(arr, text)
Given an array of MediaURLMetadata objects and text, return an array of MediaURL objects.
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array.<MediaURLMetadata> | |
text |
String |
- Source:
getMessageReferencedByError(attrs)
Given an error <message>
stanza's attributes, find the saved message model which is
referenced by that error.
Parameters:
Name | Type | Description |
---|---|---|
attrs |
Object |
- Source:
getMessageReferencedByError(attrs)
Given an error <message>
stanza's attributes, find the saved message model which is
referenced by that error.
Parameters:
Name | Type | Description |
---|---|---|
attrs |
Object |
(private) getModerationAttributes(stanza, original_stanza) → {Object}
Parameters:
Name | Type | Description |
---|---|---|
stanza |
Element | The message stanza |
original_stanza |
Element | The original stanza, that contains the message stanza, if it was contained, otherwise it's the message stanza itself. |
- Source:
Returns:
- Type
- Object
getNameAndValue(field) → {Object|null}
Given an HTMLElement representing a form field, return it's name and value.
Parameters:
Name | Type | Description |
---|---|---|
field |
HTMLElement |
- Source:
Returns:
- Type
- Object | null
getNextFrameNo() → {number}
Gets the index of the frame "up next"
- Source:
Returns:
- Type
- number
getReferences(stana) → {Reference}
Given a message stanza, find and return any XEP-0372 references
Parameters:
Name | Type | Description |
---|---|---|
stana |
Element | The message stanza |
- Source:
Returns:
- Type
- Reference
(private) getRetractionAttributes(stanza, original_stanza) → {Object}
Parameters:
Name | Type | Description |
---|---|---|
stanza |
Element | The message stanza |
original_stanza |
Element | The original stanza, that contains the message stanza, if it was contained, otherwise it's the message stanza itself. |
- Source:
Returns:
- Type
- Object
getSender(attrs, chatbox) → {'me'|'them'}
Determines whether the sender of this MUC message is the current user or someone else.
Parameters:
Name | Type | Description |
---|---|---|
attrs |
MUCMessageAttributes | |
chatbox |
_converse.ChatRoom |
- Source:
Returns:
- Type
- 'me' | 'them'
(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 |
Element | The message stanza |
- Source:
Returns:
- Type
- Object
handleChatStateNotification()
Event handler for on('contactPresenceChanged'). Will show an HTML5 notification to indicate that the chat status has changed.
- Source:
handleGIFResponse(data)
Starts parsing the GIF stream data by calling parseGIF
and passing in
a map of handler functions.
Parameters:
Name | Type | Description |
---|---|---|
data |
ArrayBuffer | The GIF file data, as returned by the server |
- Source:
handleMessageNotification()
Event handler for the on('message') event. Will call methods to play sounds and show HTML5 notifications.
- Source:
handleMessageStanza(attrs)
Handler method for all incoming single-user chat "message" stanzas.
Parameters:
Name | Type | Description |
---|---|---|
attrs |
MessageAttributes | The message attributes |
- Source:
(async) initUserSettings()
- Source:
insertIntoTextArea(value, replaceopt, positionopt)
Insert a particular string value into the textarea of this chat box.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value |
string | The value to be inserted. |
||
replace |
boolean | string |
<optional> |
false | Whether an existing value
should be replaced. If set to |
position |
number |
<optional> |
The end index of the string to be replaced with the new value. |
- Source:
isAllowedProtocolForMedia(url) → {Boolean}
Given a url, check whether the protocol being used is allowed for rendering the media in the chat (as opposed to just rendering a URL hyperlink).
Parameters:
Name | Type | Description |
---|---|---|
url |
String |
- Source:
Returns:
- Type
- Boolean
(private) isArchived(stanza) → {Boolean}
Determines whether the passed in stanza is a XEP-0313 MAM stanza
Parameters:
Name | Type | Description |
---|---|---|
stanza |
Element | The message stanza |
- Source:
Returns:
- Type
- Boolean
(private) isArchived(stanza) → {Boolean}
Determines whether the passed in stanza is a XEP-0313 MAM stanza
Parameters:
Name | Type | Description |
---|---|---|
stanza |
Element | The message stanza |
Returns:
- Type
- Boolean
(private) isCarbon(stanza) → {Boolean}
Determines whether the passed in stanza is a XEP-0280 Carbon
Parameters:
Name | Type | Description |
---|---|---|
stanza |
Element | The message stanza |
- Source:
Returns:
- Type
- Boolean
isEqualNode(actual, expected) → {Boolean}
Given two XML or HTML elements, determine if they're equal
Parameters:
Name | Type | Description |
---|---|---|
actual |
Element | |
expected |
Element |
- Source:
Returns:
- Type
- Boolean
isHidden() → {boolean}
Indicates whether the chat is hidden and therefore whether a newly received message will be visible to the user or not.
- Source:
Returns:
- Type
- boolean
isHidden() → {boolean}
Indicates whether the chat is hidden and therefore whether a newly received message will be visible to the user or not.
Returns:
- Type
- boolean
isMediaURLDomainAllowed(o) → {Bool}
Accepts a MediaURL object and then checks whether its domain is allowed for rendering in the chat.
Parameters:
Name | Type | Description |
---|---|---|
o |
MediaURL |
- Source:
Returns:
- Type
- Bool
isUniView()
We distinguish between UniView and MultiView instances.
UniView means that only one chat is visible, even though there might be multiple ongoing chats. MultiView means that multiple chats may be visible simultaneously.
- Source:
isValidDirective(d, text, i, opening)
Checks whether a given character "d" at index "i" of "text" is a valid opening or closing directive.
Parameters:
Name | Type | Description |
---|---|---|
d |
String | The potential directive |
text |
String | The text in which the directive appears |
i |
Number | The directive index |
opening |
Boolean | Check for a valid opening or closing directive |
- Source:
onAnimationFrame(timestamp, previous_timestamp, frame_delay)
Inner callback for the requestAnimationFrame
function.
This method gets wrapped by an arrow function so that the previous_timestamp
and
frame_delay
parameters can also be passed in. The timestamp
parameter comes from requestAnimationFrame
.
The purpose of this method is to call renderImage
with the right delay
in order to render the GIF animation.
Note, this method will cause the next upcoming frame to be rendered, not the current one.
This means this.frame_idx
will be incremented before calling this.renderImage
, so
renderImage(0)
needs to be called before this method, otherwise the
animation will incorrectly start from frame #1 (this is done in initPlayer
).
Parameters:
Name | Type | Description |
---|---|---|
timestamp |
DOMHighResTimeStamp | The timestamp as returned by |
previous_timestamp |
DOMHighResTimeStamp | The timestamp from the previous iteration of this method. We need this in order to calculate whether we have waited long enough to show the next frame. |
frame_delay |
Number | The delay (in 1/100th of a second) before the currently being shown frame should be replaced by a new one. |
- Source:
onChatBoxesInitialized()
Roster specific event handler for the chatBoxesInitialized event
- Source:
onClearSession()
Roster specific event handler for the clearSession event
- Source:
onDisconnected()
Gets called once strophe's status reaches Strophe.Status.DISCONNECTED. Will either start a teardown process for converse.js or attempt to reconnect.
onDisconnected()
Gets called once strophe's status reaches Strophe.Status.DISCONNECTED. Will either start a teardown process for converse.js or attempt to reconnect.
onHeadlineMessage(stanza)
Handler method for all incoming messages of type "headline".
Parameters:
Name | Type | Description |
---|---|---|
stanza |
Element |
onIterationEnd() → {Boolean}
Called once we've looped through all frames in the GIF
- Source:
Returns:
- Returns
true
if the GIF is now paused (i.e. further iterations are not desired)
- Type
- Boolean
onMAMPreferences()
Handle returned IQ stanza containing Message Archive Management (XEP-0313) preferences.
XXX: For now we only handle the global default preference. The XEP also provides for per-JID preferences, which is currently not supported in converse.js.
Per JID preferences will be set in chat boxes, so it'll probbaly be handled elsewhere in any case.
- Source:
onMaximized() → {_converse.ChatBoxView|_converse.ChatRoomView}
Handler which gets called when a _converse#ChatBox has it's
minimized
property set to false.
Will trigger _converse#chatBoxMaximized
- Source:
Returns:
onMinimized() → {_converse.ChatBoxView|_converse.ChatRoomView}
Handler which gets called when a _converse#ChatBox has it's
minimized
property set to true.
Will trigger _converse#chatBoxMinimized
- Source:
Returns:
onPresencesInitialized(reconnecting)
Roster specific event handler for the presencesInitialized event
Parameters:
Name | Type | Description |
---|---|---|
reconnecting |
Boolean |
- Source:
onRosterContactsFetched()
Roster specific handler for the rosterContactsFetched promise
- Source:
onStatusInitialized(reconnecting)
Roster specific event handler for the statusInitialized event
Parameters:
Name | Type | Description |
---|---|---|
reconnecting |
Boolean |
- Source:
parseBundle()
Given an XML element representing a user's OMEMO bundle, parse it and return a map.
- Source:
parseEncryptedMessage(stanza, attrs)
Hook handler for { @link parseMessage } and { @link parseMUCMessage }, which
parses the passed in message
stanza for OMEMO attributes and then sets
them on the attrs object.
Parameters:
Name | Type | Description |
---|---|---|
stanza |
Element | The message stanza |
attrs |
MUCMessageAttributes | MessageAttributes |
- Source:
Returns:
(MUCMessageAttributes|MessageAttributes)
parseMUCMessage(stanza, original_stanza, chatbox, _converse) → {Promise.<(MUCMessageAttributes|Error)>}
Parses a passed in message stanza and returns an object of attributes.
Parameters:
Name | Type | Description |
---|---|---|
stanza |
Element | The message stanza |
original_stanza |
Element | The original stanza, that contains the message stanza, if it was contained, otherwise it's the message stanza itself. |
chatbox |
_converse.ChatRoom | |
_converse |
_converse |
- Source:
Returns:
- Type
- Promise.<(MUCMessageAttributes|Error)>
parseMUCPresence(stanza, chatbox) → {MUCPresenceAttributes}
Parses a passed in MUC presence stanza and returns an object of attributes.
Parameters:
Name | Type | Description |
---|---|---|
stanza |
Element | The presence stanza |
chatbox |
_converse.ChatRoom |
- Source:
Returns:
pause()
Pause the gif
- Source:
play()
Start playing the gif
- Source:
(async, private) populateRoster(ignore_cache)
Fetch all the roster groups, and then the roster contacts. Emit an event after fetching is done in each case.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
ignore_cache |
Bool | false | If set to to true, the local cache will be ignored it's guaranteed that the XMPP server will be queried for the roster. |
- Source:
prefixMentions()
Given a message object, return its text with @ chars inserted before the mentioned nicknames.
- Source:
publishDevices()
Send an IQ stanza to the current user's "devices" PEP node to ensure that all devices are published for potential chat partners to see. See: https://xmpp.org/extensions/xep-0384.html#usecases-announcing
- Source:
registerIntervalHandler()
Set an interval of one second and register a handler for it. Required for the auto_away, auto_xa and csi_waiting_time features.
- Source:
rejectPresenceSubscription(jid, message)
Reject or cancel another user's subscription to our presence updates.
Parameters:
Name | Type | Description |
---|---|---|
jid |
String | The Jabber ID of the user whose subscription is being canceled |
message |
String | An optional message to the user |
- Source:
(private) removeResource(name:)
Remove the passed in resource from the resources map. Also redetermines the presence given that there's one less resource.
Parameters:
Name | Type | Description |
---|---|---|
name: |
string | The resource name |
renderImage(show_pause_on_hover)
Draws a gif frame at a specific index inside the canvas.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
show_pause_on_hover |
boolean | true | The frame index |
- Source:
savedLoginInfo(jid) → {Promise}
Fetch the stored SCRAM keys for the given JID, if available.
The user's plaintext password is not stored, nor any material from which the user's plaintext password could be recovered.
Parameters:
Name | Type | Description |
---|---|---|
jid |
String | The XMPP address for which to fetch the SCRAM keys |
- Source:
Returns:
A promise which resolves once we've fetched the previously used login keys.
- Type
- Promise
scrollDown(evopt)
Scrolls the chat down.
This method will always scroll the chat down, regardless of whether the user scrolled up manually or not.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
ev |
Event |
<optional> |
An optional event that is the cause for needing to scroll down. |
- Source:
(private) sendAffiliationIQ(affiliation:, muc_jid:, member:)
Send an IQ stanza specifying an affiliation change.
Parameters:
Name | Type | Description |
---|---|---|
affiliation: |
String | affiliation (could also be stored on the member object). |
muc_jid: |
String | The JID of the MUC in which the affiliation should be set. |
member: |
Object | Map containing the member's jid and optionally a reason and affiliation. |
sendCSI(stat)
Send out a Client State Indication (XEP-0352)
Parameters:
Name | Type | Description |
---|---|---|
stat |
String | The user's chat status |
- Source:
sendMarker(to_jid, id, type, msg_type)
Send out a XEP-0333 chat marker
Parameters:
Name | Type | Description |
---|---|---|
to_jid |
String | |
id |
String | The id of the message being marked |
type |
String | The marker type |
msg_type |
String |
- Source:
sendMarkerForLastMessage(typeopt, force)
Finds the last eligible message and then sends a XEP-0333 chat marker for it.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
'received' | 'displayed' | 'acknowledged' |
<optional> |
'displayed' | |
force |
Boolean | Whether a marker should be sent for the
message, even if it didn't include a |
- Source:
sendMarkerForLastMessage(typeopt, force)
Finds the last eligible message and then sends a XEP-0333 chat marker for it.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
'received' | 'displayed' | 'acknowledged' |
<optional> |
'displayed' | |
force |
Boolean | Whether a marker should be sent for the
message, even if it didn't include a |
sendMarkerForMessage(msg, typeopt, force)
Given the passed in message object, send a XEP-0333 chat marker.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
msg |
_converse.Message | |||
type |
'received' | 'displayed' | 'acknowledged' |
<optional> |
'displayed' | |
force |
Boolean | Whether a marker should be sent for the
message, even if it didn't include a |
- Source:
sendMarkerForMessage(msg, typeopt, force)
Given the passed in message object, send a XEP-0333 chat marker.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
msg |
_converse.Message | |||
type |
'received' | 'displayed' | 'acknowledged' |
<optional> |
'displayed' | |
force |
Boolean | Whether a marker should be sent for the
message, even if it didn't include a |
setAffiliation(affiliation, jids, members) → {Promise}
Send IQ stanzas to the server to set an affiliation for the provided JIDs. See: https://xmpp.org/extensions/xep-0045.html#modifymember
Prosody doesn't accept multiple JIDs' affiliations being set in one IQ stanza, so as a workaround we send a separate stanza for each JID. Related ticket: https://issues.prosody.im/345
Parameters:
Name | Type | Description |
---|---|---|
affiliation |
'outcast' | 'member' | 'admin' | 'owner' | The affiliation to be set |
jids |
String | Array.<String> | The JID(s) of the MUCs in which the affiliations need to be set. |
members |
object | A map of jids, affiliations and optionally reasons. Only those entries with the same affiliation as being currently set will be considered. |
Returns:
A promise which resolves and fails depending on the XMPP server response.
- Type
- Promise
setAffiliations(users) → {Promise}
Send IQ stanzas to the server to modify affiliations for users in this groupchat. See: https://xmpp.org/extensions/xep-0045.html#modifymember
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
users |
Array.<Object> |
Properties
|
Returns:
- Type
- Promise
setUserJID()
Stores the passed in JID for the current user, potentially creating a resource if the JID is bare.
Given that we can only create an XMPP connection if we know the domain of the server connect to and we only know this once we know the JID, we also call initConnection (if necessary) to make sure that the connection is set up.
- Source:
Fires:
(private) shouldNotifyOfGroupMessage(attrs)
Is this a group message for which we should notify the user?
Parameters:
Name | Type | Description |
---|---|---|
attrs |
MUCMessageAttributes |
- Source:
(async, private) shouldNotifyOfMessage(data)
Parameters:
Name | Type | Description |
---|---|---|
data |
MessageData | MUCMessageData |
- Source:
showChatStateNotification()
Creates an HTML5 Notification to inform of a change in a contact's chat state.
- Source:
(private) showMessageNotification(data)
Shows an HTML5 Notification with the passed in message
Parameters:
Name | Type | Description |
---|---|---|
data |
MessageData | MUCMessageData |
- Source:
slideIn(el, duration)
Hides/contracts an element by sliding it into itself
Parameters:
Name | Type | Description |
---|---|---|
el |
HTMLElement | The HTML string |
duration |
Number | The duration amount in milliseconds |
- Source:
slideOut(el, duration)
Shows/expands an element by sliding it out of itself
Parameters:
Name | Type | Description |
---|---|---|
el |
HTMLElement | The HTML string |
duration |
Number | The duration amount in milliseconds |
- Source:
stx()
Tagged template literal function which generates Stanza objects
Similar to the html
function, from Lit.
- Source:
Example
stx`<presence type="${type}"><show>${show}</show></presence>`
throwErrorIfInvalidForward(stanza)
Check whether the passed-in stanza is a forwarded message that is "bare", i.e. it's not forwarded as part of a larger protocol, like MAM.
Parameters:
Name | Type | Description |
---|---|---|
stanza |
Element |
- Source:
toggleRoomInfo()
Show/hide extra information about a groupchat in a listing.
Parameters:
Type | Description |
---|---|
Event |
updateContact(item)
Update or create RosterContact models based on the given item
XML
node received in the resulting IQ stanza from the server.
Parameters:
Name | Type | Description |
---|---|---|
item |
Element |
updateSettingsWithFormData(form, settings)
Given the login <form>
element, parse its data and update the
converse settings with the supplied JID, password and connection URL.
Parameters:
Name | Type | Description |
---|---|---|
form |
HTMLElement | |
settings |
Object | Extra settings that may be passed in and will also be set together with the form settings. |
- Source:
Type Definitions
ArchiveQueryOptions
The options that can be passed in to the _converse.api.archive.query method
Type:
- module:converse-mam~MAMFilterParameters
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
groupchat |
Boolean |
<optional> |
false | Whether the MAM archive is for a groupchat. |
- Source:
ConfigurationSettings
Converse's core configuration values
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
allow_non_roster_messaging |
Boolean |
<optional> |
false | |
allow_url_history_change |
Boolean |
<optional> |
true | |
assets_path |
String |
<optional> |
'/dist' | |
authentication |
'login' | 'prebind' | 'anonymous' | 'external' |
<optional> |
'login' | |
auto_login |
Boolean |
<optional> |
false | Currently only used in connection with anonymous login |
reuse_scram_keys |
Boolean |
<optional> |
false | Save SCRAM keys after login to allow for future auto login |
auto_reconnect |
Boolean |
<optional> |
true | |
blacklisted_plugins |
Array.<String> |
<optional> |
||
clear_cache_on_logout |
Boolean |
<optional> |
false | |
connection_options |
Object |
<optional> |
||
credentials_url |
String |
<optional> |
URL from where login credentials can be fetched |
|
discover_connection_methods |
Boolean |
<optional> |
true | |
geouri_regex |
RegExp |
<optional> |
||
geouri_replacement |
RegExp |
<optional> |
'https://www.openstreetmap.org/?mlat=$1&mlon=$2#map=18/$1/$2' | |
i18n |
String |
<optional> |
||
jid |
String |
<optional> |
||
keepalive |
Boolean |
<optional> |
true | |
loglevel |
'debug' | 'info' | 'eror' |
<optional> |
'info' | |
locales |
Array.<String> |
<optional> |
||
nickname |
String |
<optional> |
||
password |
String |
<optional> |
||
persistent_store |
'IndexedDB' | 'localStorage' |
<optional> |
'IndexedDB' | |
rid |
String |
<optional> |
||
root |
Element |
<optional> |
window.document | |
sid |
String |
<optional> |
||
singleton |
Boolean |
<optional> |
false | |
strict_plugin_dependencies |
Boolean |
<optional> |
false | |
view_mode |
'overlayed' | 'fullscreen' | 'mobile' |
<optional> |
'overlayed' | |
websocket_url |
String |
<optional> |
||
whitelisted_plugins |
Array.<String> |
<optional> |
ConfigurationSettings
Converse's core configuration values
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
allow_non_roster_messaging |
Boolean |
<optional> |
false | |
allow_url_history_change |
Boolean |
<optional> |
true | |
assets_path |
String |
<optional> |
'/dist' | |
authentication |
'login' | 'prebind' | 'anonymous' | 'external' |
<optional> |
'login' | |
auto_login |
Boolean |
<optional> |
false | Currently only used in connection with anonymous login |
reuse_scram_keys |
Boolean |
<optional> |
false | Save SCRAM keys after login to allow for future auto login |
auto_reconnect |
Boolean |
<optional> |
true | |
blacklisted_plugins |
Array.<String> |
<optional> |
||
clear_cache_on_logout |
Boolean |
<optional> |
false | |
connection_options |
Object |
<optional> |
||
credentials_url |
String |
<optional> |
URL from where login credentials can be fetched |
|
discover_connection_methods |
Boolean |
<optional> |
true | |
geouri_regex |
RegExp |
<optional> |
||
geouri_replacement |
RegExp |
<optional> |
'https://www.openstreetmap.org/?mlat=$1&mlon=$2#map=18/$1/$2' | |
i18n |
String |
<optional> |
||
jid |
String |
<optional> |
||
keepalive |
Boolean |
<optional> |
true | |
loglevel |
'debug' | 'info' | 'eror' |
<optional> |
'info' | |
locales |
Array.<String> |
<optional> |
||
nickname |
String |
<optional> |
||
password |
String |
<optional> |
||
persistent_store |
'IndexedDB' | 'localStorage' |
<optional> |
'IndexedDB' | |
rid |
String |
<optional> |
||
root |
Element |
<optional> |
window.document | |
sid |
String |
<optional> |
||
singleton |
Boolean |
<optional> |
false | |
strict_plugin_dependencies |
Boolean |
<optional> |
false | |
view_mode |
'overlayed' | 'fullscreen' | 'mobile' |
<optional> |
'overlayed' | |
websocket_url |
String |
<optional> |
||
whitelisted_plugins |
Array.<String> |
<optional> |
ConnectionOptions
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
cookies |
Cookies |
<optional> |
Allows you to pass in cookies that will be included in HTTP requests. Relevant to both the BOSH and Websocket transports. The passed in value must be a map of cookie names and string values.
Note that cookies can't be set in this way for domains other than the one that's hosting Strophe (i.e. cross-domain). Those cookies need to be set under those domains, for example they can be set server-side by making a XHR call to that domain to ask it to set any necessary cookies. |
mechanisms |
Array.<SASLMechanism> |
<optional> |
Allows you to specify the SASL authentication mechanisms that this instance of Strophe.Connection (and therefore your XMPP client) will support. The value must be an array of objects with Strophe.SASLMechanism prototypes. If nothing is specified, then the following mechanisms (and their priorities) are registered:
|
explicitResourceBinding |
boolean |
<optional> |
If Making this step explicit allows client authors to first finish other stream related tasks, such as setting up an XEP-0198 Stream Management session, before binding the JID resource for this session. |
protocol |
'ws' | 'wss' |
<optional> |
Note: This option is only relevant to Websocket connections, and not BOSH If you want to connect to the current host with a WebSocket connection you
can tell Strophe to use WebSockets through the "protocol" option.
Valid values are
Note that relative URLs NOT starting with a "/" will also include the path of the current site. Also because downgrading security is not permitted by browsers, when using relative URLs both BOSH and WebSocket connections will use their secure variants if the current connection to the site is also secure (https). |
worker |
string |
<optional> |
Note: This option is only relevant to Websocket connections, and not BOSH Set this option to URL from where the shared worker script should be loaded. To run the websocket connection inside a shared worker. This allows you to share a single websocket-based connection between multiple Strophe.Connection instances, for example one per browser tab. The script to use is the one in |
sync |
boolean |
<optional> |
Used to control whether BOSH HTTP requests will be made synchronously or not. The default behaviour is asynchronous. If you want to make requests synchronous, make "sync" evaluate to true.
You can also toggle this on an already established connection.
|
customHeaders |
Array.<string> |
<optional> |
Used to provide custom HTTP headers to be included in the BOSH HTTP requests. |
keepalive |
boolean |
<optional> |
Used to instruct Strophe to maintain the current BOSH session across interruptions such as webpage reloads. It will do this by caching the sessions tokens in sessionStorage, and when "restore" is called it will check whether there are cached tokens with which it can resume an existing session. |
withCredentials |
boolean |
<optional> |
Used to indicate wether cookies should be included in HTTP requests (by default
they're not).
Set this value to |
contentType |
string |
<optional> |
Used to change the default Content-Type, which is "text/xml; charset=utf-8". Can be useful to reduce the amount of CORS preflight requests that are sent to the server. |
ConverseGIFComponentProperties
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
autoplay |
Boolean | |
noloop |
Boolean | |
progress_color |
String | |
nick |
String | |
fallback |
'url' | 'empty' | 'error' | |
src |
String |
- Source:
Cookies
A map of cookie names to string values or to maps of cookie values.
Type:
- Object.<string, string>
Cookies
Type:
- Object.<string, string>
HandlerOptions
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
HandlerOptions.matchBareFromJid |
boolean |
<optional> |
|
HandlerOptions.ignoreNamespaceFragment |
boolean |
<optional> |
HandlerOptions
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
HandlerOptions.matchBareFromJid |
boolean |
<optional> |
|
HandlerOptions.ignoreNamespaceFragment |
boolean |
<optional> |
HeadingButtonAttributes
An object representing a chat heading button
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
standalone |
Boolean | True if shown on its own, false if it must be in the dropdown menu. |
handler |
function | A handler function to be called when the button is clicked. |
a_class |
String | HTML classes to show on the button |
i18n_text |
String | The user-visiible name of the button |
i18n_title |
String | The tooltip text for this button |
icon_class |
String | What kind of CSS class to use for the icon |
name |
String | The internal name of the button |
- Source:
LogLevel
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
DEBUG |
string | |
INFO |
string | |
WARN |
string | |
ERROR |
string | |
FATAL |
string |
MAMFilterParameters
Filter parameters which can be used to filter a MAM XEP-0313 archive
Type:
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
end |
String |
<optional> |
A date string in ISO-8601 format, before which messages should be returned. Implies backward paging. |
start |
String |
<optional> |
A date string in ISO-8601 format, after which messages should be returned. Implies forward paging. |
with |
String |
<optional> |
A JID against which to match messages, according to either their |
- Source:
MAMOptions
A map of MAM related options that may be passed to fetchArchivedMessages
Type:
- Object
- Source:
MAMQueryResult
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
messages |
Array | ||
rsm |
RSM |
<optional> |
An instance of RSM.
You can call |
complete |
Boolean | ||
error |
Error |
<optional> |
- Source:
MUCHat
Object representing a XEP-0371 Hat
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
title |
String | |
uri |
String |
- Source:
MUCMessageAttributes
The object which parseMUCMessage returns
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
sender |
'me' | 'them' | Whether the message was sent by the current user or someone else |
activities |
Array.<Object> | A list of objects representing XEP-0316 MEP notification data |
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_spoiler |
Boolean | Is this a XEP-0382 spoiler message? |
is_tombstone |
Boolean | Is this a XEP-0424 tombstone? |
is_unstyled |
Boolean | Whether XEP-0393 styling hints should be ignored |
is_valid_receipt_request |
Boolean | Does this message request a XEP-0184 receipt (and is not from us or a carbon or archived message) |
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 |
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 |
nick |
String | The MUC nickname of the sender |
occupant_id |
String | The XEP-0421 occupant ID |
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 |
received |
String | An ISO8601 string recording the time that the message was received |
replace_id |
String | The |
retracted |
String | An ISO8601 string recording the time that the message was retracted |
retracted_id |
String | The |
spoiler_hint |
String | The XEP-0382 spoiler hint |
stanza_id |
String | The XEP-0359 Stanza ID. Note: the key is actualy |
subject |
String | The |
thread |
String | The |
time |
String | The time (in ISO8601 format), either given by the XEP-0203 |
to |
String | The recipient JID |
type |
String | The type of message |
- Source:
MUCMessageData
An object containing the parsed MUCMessageAttributes and current ChatRoom.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
attrs |
MUCMessageAttributes | |
chatbox |
ChatRoom |
- Source:
MUCPresenceAttributes
The object which parseMUCPresence returns
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
show |
"offline|online" | |
hats |
Array.<MUCHat> | An array of XEP-0317 hats |
states |
Array.<string> | |
from |
String | The sender JID (${muc_jid}/${nick}) |
nick |
String | The nickname of the sender |
occupant_id |
String | The XEP-0421 occupant ID |
type |
String | The type of presence |
- Source:
MediaURLData
An object representing a URL found in a chat message
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
is_audio |
Boolean | |
is_image |
Boolean | |
is_video |
Boolean | |
end |
String | |
start |
String | |
url |
String |
- Source:
MediaURLData
An object representing a URL found in a chat message
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
is_audio |
Boolean | |
is_image |
Boolean | |
is_video |
Boolean | |
end |
String | |
start |
String | |
url |
String |
MediaURLMetadata
An object representing the metadata of a URL found in a chat message
The actual URL is not saved, it can be extracted via the start
and end
indexes.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
is_audio |
Boolean | |
is_image |
Boolean | |
is_video |
Boolean | |
end |
String | |
start |
String |
- Source:
MediaURLMetadata
An object representing the metadata of a URL found in a chat message
The actual URL is not saved, it can be extracted via the start
and end
indexes.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
is_audio |
Boolean | |
is_image |
Boolean | |
is_video |
Boolean | |
end |
String | |
start |
String |
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:
MessageActionAttributes
An object which represents a message action (as shown in the message dropdown);
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
i18n_text |
String | |
handler |
function | |
button_class |
String | |
icon_class |
String | |
name |
String |
- Source:
MessageAttributes
The object which 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_spoiler |
Boolean | Is this a XEP-0382 spoiler message? |
is_tombstone |
Boolean | Is this a XEP-0424 tombstone? |
is_unstyled |
Boolean | Whether XEP-0393 styling hints should be ignored |
is_valid_receipt_request |
Boolean | Does this message request a XEP-0184 receipt (and is not from us or a carbon or archived message) |
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 |
msgid |
String | The root |
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 |
received |
String | An ISO8601 string recording the time that the message was received |
replace_id |
String | The |
retracted |
String | An ISO8601 string recording the time that the message was retracted |
retracted_id |
String | The |
spoiler_hint |
String | The XEP-0382 spoiler hint |
stanza_id |
String | The XEP-0359 Stanza ID. Note: the key is actualy |
subject |
String | The |
thread |
String | The |
time |
String | The time (in ISO8601 format), either given by the XEP-0203 |
to |
String | The recipient JID |
type |
String | The type of message |
- Source:
MessageAttributes
The object which 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_spoiler |
Boolean | Is this a XEP-0382 spoiler message? |
is_tombstone |
Boolean | Is this a XEP-0424 tombstone? |
is_unstyled |
Boolean | Whether XEP-0393 styling hints should be ignored |
is_valid_receipt_request |
Boolean | Does this message request a XEP-0184 receipt (and is not from us or a carbon or archived message) |
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 |
msgid |
String | The root |
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 |
received |
String | An ISO8601 string recording the time that the message was received |
replace_id |
String | The |
retracted |
String | An ISO8601 string recording the time that the message was retracted |
retracted_id |
String | The |
spoiler_hint |
String | The XEP-0382 spoiler hint |
stanza_id |
String | The XEP-0359 Stanza ID. Note: the key is actualy |
subject |
String | The |
thread |
String | The |
time |
String | The time (in ISO8601 format), either given by the XEP-0203 |
to |
String | The recipient JID |
type |
String | The type of message |
MessageData
An object containing the original message stanza, as well as the parsed attributes.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
stanza |
Element | |
stanza |
MessageAttributes | |
chatbox |
ChatBox |
- Source:
MessageData
An object containing the original message stanza, as well as the parsed attributes.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
stanza |
Element | |
stanza |
MessageAttributes | |
chatbox |
ChatBox |
NS
Common namespace constants from the XMPP RFCs and XEPs.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
NS.HTTPBIND |
string | HTTP BIND namespace from XEP 124. |
NS.BOSH |
string | BOSH namespace from XEP 206. |
NS.CLIENT |
string | Main XMPP client namespace. |
NS.AUTH |
string | Legacy authentication namespace. |
NS.ROSTER |
string | Roster operations namespace. |
NS.PROFILE |
string | Profile namespace. |
NS.DISCO_INFO |
string | Service discovery info namespace from XEP 30. |
NS.DISCO_ITEMS |
string | Service discovery items namespace from XEP 30. |
NS.MUC |
string | Multi-User Chat namespace from XEP 45. |
NS.SASL |
string | XMPP SASL namespace from RFC 3920. |
NS.STREAM |
string | XMPP Streams namespace from RFC 3920. |
NS.BIND |
string | XMPP Binding namespace from RFC 3920 and RFC 6120. |
NS.SESSION |
string | XMPP Session namespace from RFC 3920. |
NS.XHTML_IM |
string | XHTML-IM namespace from XEP 71. |
NS.XHTML |
string | XHTML body namespace from XEP 71. |
NS.STANZAS |
string | |
NS.FRAMING |
string |
OccupantData
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
jid |
String |
<optional> |
|
nick |
String |
<optional> |
|
occupant_id |
String |
<optional> |
The XEP-0421 unique occupant id |
- Source:
Password
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
Password.name |
string | |
Password.ck |
string | |
Password.sk |
string | |
Password.iter |
number | |
Password.salt |
string |
Password
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
Password.name |
string | |
Password.ck |
string | |
Password.sk |
string | |
Password.iter |
number | |
salt |
string |
Reference
An object representing XEP-0372 reference data
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
begin |
string | |
end |
string | |
type |
string | |
value |
String | |
uri |
String |
- Source:
Reference
An object representing XEP-0372 reference data
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
begin |
string | |
end |
string | |
type |
string | |
value |
String | |
uri |
String |
RichTextComponentProperties
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
embed_audio |
Boolean | Whether URLs that point to audio files should render as audio players. |
embed_videos |
Boolean | Whether URLs that point to video files should render as video players. |
mentions |
Array | An array of objects representing chat mentions |
nick |
String | The current user's nickname, relevant for mentions |
offset |
Number | The text offset, in case this is a nested RichText element. |
onImgClick |
function | |
onImgLoad |
function | |
render_styling |
Boolean | Whether XEP-0393 message styling hints should be rendered |
show_images |
Boolean | Whether URLs that point to image files should render as images |
hide_media_urls |
Boolean | If media URLs are rendered as media, then this option determines
whether the original URL is also still shown or not.
Only relevant in conjunction with |
show_me_message |
Boolean | Whether text that starts with /me should be rendered in the 3rd person. |
text |
String | The text that will get transformed. |
- Source:
SASLAnonymous
SASL ANONYMOUS authentication.
SASLData
Type:
- Object.<string, any>
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
SASLData.keys |
Object |
<optional> |
SASLExternal
SASL EXTERNAL authentication.
The EXTERNAL mechanism allows a client to request the server to use credentials established by means external to the mechanism to authenticate the client. The external means may be, for instance, TLS services.
SASLOAuthBearer
SASL OAuth Bearer authentication.
SASLPlain
SASL PLAIN authentication.
SASLSHA1
SASL SCRAM SHA 1 authentication.
SASLSHA256
SASL SCRAM SHA 256 authentication.
SASLSHA384
SASL SCRAM SHA 384 authentication.
SASLSHA512
SASL SCRAM SHA 512 authentication.
SASLXOAuth2
SASL X-OAuth2 authentication.
StanzaAttrs
Type:
- Object.<string, (string|number)>
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
StanzaAttrs.xmlns |
string |
<optional> |
Status
Connection status constants for use by the connection handler callback.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
Status.ERROR |
connstatus | An error has occurred |
Status.CONNECTING |
connstatus | The connection is currently being made |
Status.CONNFAIL |
connstatus | The connection attempt failed |
Status.AUTHENTICATING |
connstatus | The connection is authenticating |
Status.AUTHFAIL |
connstatus | The authentication attempt failed |
Status.CONNECTED |
connstatus | The connection has succeeded |
Status.DISCONNECTED |
connstatus | The connection has been terminated |
Status.DISCONNECTING |
connstatus | The connection is currently being terminated |
Status.ATTACHED |
connstatus | The connection has been attached |
Status.REDIRECT |
connstatus | The connection has been redirected |
Status.CONNTIMEOUT |
connstatus | The connection has timed out |
Status.BINDREQUIRED |
connstatus | The JID resource needs to be bound for this session |
Status.ATTACHFAIL |
connstatus | Failed to attach to a pre-existing session |
Status.RECONNECTING |
connstatus | Not used by Strophe, but added for integrators |
WebsocketLike
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
|
||
WebsocketLike.close |
function | |
WebsocketLike.onopen |
function | |
|
||
|
||
|
||
WebsocketLike.readyState |
string |
XHTMLAttrs
Type:
- 'a' | 'blockquote' | 'br' | 'cite' | 'em' | 'img' | 'li' | 'ol' | 'p' | 'span' | 'strong' | 'ul' | 'body'
connectionCallback(connection)
Parameters:
Name | Type | Description |
---|---|---|
connection |
Connection |
connectionCallback(connection)
Parameters:
Name | Type | Description |
---|---|---|
connection |
Connection |
connectionCallback(connection)
Parameters:
Name | Type | Description |
---|---|---|
connection |
Connection |
connstatus
Type:
- number
Events
affiliationChanged
Example
const el = document.querySelector('converse-muc-affiliation-form');
el.addEventListener('affiliationChanged', () => { ... });
converse-loaded
Once Converse.js has loaded, it'll dispatch a custom event with the name converse-loaded
.
You can listen for this event in order to be informed as soon as converse.js has been
loaded and parsed, which would mean it's safe to call converse.initialize
.
Example
window.addEventListener('converse-loaded', () => converse.initialize());
roleChanged
- Source:
Example
const el = document.querySelector('converse-muc-role-form');
el.addEventListener('roleChanged', () => { ... });