|
@@ -226,7 +226,7 @@ const ChatRoomMixin = {
|
|
|
* *Hook* which allows plugins to update an outgoing MUC join presence stanza
|
|
|
* @event _converse#constructedMUCPresence
|
|
|
* @param { _converse.ChatRoom } - The MUC from which this message stanza is being sent.
|
|
|
- * @param { XMLElement } stanza - The stanza which will be sent out
|
|
|
+ * @param { Element } stanza - The stanza which will be sent out
|
|
|
*/
|
|
|
stanza = await api.hook('constructedMUCPresence', this, stanza);
|
|
|
return stanza;
|
|
@@ -507,7 +507,7 @@ const ChatRoomMixin = {
|
|
|
* Handles incoming message stanzas from the service that hosts this MUC
|
|
|
* @private
|
|
|
* @method _converse.ChatRoom#handleMessageFromMUCHost
|
|
|
- * @param { XMLElement } stanza
|
|
|
+ * @param { Element } stanza
|
|
|
*/
|
|
|
handleMessageFromMUCHost (stanza) {
|
|
|
if (this.isEntered()) {
|
|
@@ -528,7 +528,7 @@ const ChatRoomMixin = {
|
|
|
* Handles XEP-0452 MUC Mention Notification messages
|
|
|
* @private
|
|
|
* @method _converse.ChatRoom#handleForwardedMentions
|
|
|
- * @param { XMLElement } stanza
|
|
|
+ * @param { Element } stanza
|
|
|
*/
|
|
|
handleForwardedMentions (stanza) {
|
|
|
if (this.isEntered()) {
|
|
@@ -558,7 +558,7 @@ const ChatRoomMixin = {
|
|
|
* Parses an incoming message stanza and queues it for processing.
|
|
|
* @private
|
|
|
* @method _converse.ChatRoom#handleMessageStanza
|
|
|
- * @param { XMLElement } stanza
|
|
|
+ * @param { Element } stanza
|
|
|
*/
|
|
|
async handleMessageStanza (stanza) {
|
|
|
stanza = stanza.tree?.() ?? stanza;
|
|
@@ -709,8 +709,8 @@ const ChatRoomMixin = {
|
|
|
* or error message within a specific timeout period.
|
|
|
* @private
|
|
|
* @method _converse.ChatRoom#sendTimedMessage
|
|
|
- * @param { _converse.Message|XMLElement } message
|
|
|
- * @returns { Promise<XMLElement>|Promise<_converse.TimeoutError> } Returns a promise
|
|
|
+ * @param { _converse.Message|Element } message
|
|
|
+ * @returns { Promise<Element>|Promise<_converse.TimeoutError> } Returns a promise
|
|
|
* which resolves with the reflected message stanza or with an error stanza or {@link _converse.TimeoutError}.
|
|
|
*/
|
|
|
sendTimedMessage (el) {
|
|
@@ -793,7 +793,7 @@ const ChatRoomMixin = {
|
|
|
* Retract someone else's message in this groupchat.
|
|
|
* @private
|
|
|
* @method _converse.ChatRoom#retractOtherMessage
|
|
|
- * @param { _converse.Message } message - The message which we're retracting.
|
|
|
+ * @param { _converse.ChatRoomMessage } message - The message which we're retracting.
|
|
|
* @param { string } [reason] - The reason for retracting the message.
|
|
|
* @example
|
|
|
* const room = await api.rooms.get(jid);
|
|
@@ -828,7 +828,7 @@ const ChatRoomMixin = {
|
|
|
* Sends an IQ stanza to the XMPP server to retract a message in this groupchat.
|
|
|
* @private
|
|
|
* @method _converse.ChatRoom#sendRetractionIQ
|
|
|
- * @param { _converse.Message } message - The message which we're retracting.
|
|
|
+ * @param { _converse.ChatRoomMessage } message - The message which we're retracting.
|
|
|
* @param { string } [reason] - The reason for retracting the message.
|
|
|
*/
|
|
|
sendRetractionIQ (message, reason) {
|
|
@@ -1243,7 +1243,7 @@ const ChatRoomMixin = {
|
|
|
* 'roomconfig' data.
|
|
|
* @private
|
|
|
* @method _converse.ChatRoom#autoConfigureChatRoom
|
|
|
- * @returns { Promise<XMLElement> }
|
|
|
+ * @returns { Promise<Element> }
|
|
|
* Returns a promise which resolves once a response IQ has
|
|
|
* been received.
|
|
|
*/
|
|
@@ -1262,7 +1262,7 @@ const ChatRoomMixin = {
|
|
|
* has been received.
|
|
|
* @private
|
|
|
* @method _converse.ChatRoom#fetchRoomConfiguration
|
|
|
- * @returns { Promise<XMLElement> }
|
|
|
+ * @returns { Promise<Element> }
|
|
|
*/
|
|
|
fetchRoomConfiguration () {
|
|
|
return api.sendIQ($iq({ 'to': this.get('jid'), 'type': 'get' }).c('query', { xmlns: Strophe.NS.MUC_OWNER }));
|
|
@@ -1273,7 +1273,7 @@ const ChatRoomMixin = {
|
|
|
* @private
|
|
|
* @method _converse.ChatRoom#sendConfiguration
|
|
|
* @param { Array } config - The groupchat configuration
|
|
|
- * @returns { Promise<XMLElement> } - A promise which resolves with
|
|
|
+ * @returns { Promise<Element> } - A promise which resolves with
|
|
|
* the `result` stanza received from the XMPP server.
|
|
|
*/
|
|
|
sendConfiguration (config = []) {
|
|
@@ -1715,7 +1715,7 @@ const ChatRoomMixin = {
|
|
|
* Given a presence stanza, update the occupant model based on its contents.
|
|
|
* @private
|
|
|
* @method _converse.ChatRoom#updateOccupantsOnPresence
|
|
|
- * @param { XMLElement } pres - The presence stanza
|
|
|
+ * @param { Element } pres - The presence stanza
|
|
|
*/
|
|
|
updateOccupantsOnPresence (pres) {
|
|
|
const data = parseMUCPresence(pres, this);
|
|
@@ -1902,7 +1902,7 @@ const ChatRoomMixin = {
|
|
|
* the `from` attribute. Doesn't check the `type` attribute.
|
|
|
* @private
|
|
|
* @method _converse.ChatRoom#isOwnMessage
|
|
|
- * @param { Object|XMLElement|_converse.Message } msg
|
|
|
+ * @param { Object|Element|_converse.Message } msg
|
|
|
* @returns { boolean }
|
|
|
*/
|
|
|
isOwnMessage (msg) {
|
|
@@ -2150,7 +2150,7 @@ const ChatRoomMixin = {
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
- * @param {String} actor - The nickname of the actor that caused the notification
|
|
|
+ * @param { String } actor - The nickname of the actor that caused the notification
|
|
|
* @param {String|Array<String>} states - The state or states representing the type of notificcation
|
|
|
*/
|
|
|
removeNotification (actor, states) {
|
|
@@ -2174,8 +2174,8 @@ const ChatRoomMixin = {
|
|
|
*
|
|
|
* The state can be a XEP-0085 Chat State or a XEP-0045 join/leave
|
|
|
* state.
|
|
|
- * @param {String} actor - The nickname of the actor that causes the notification
|
|
|
- * @param {String} state - The state representing the type of notificcation
|
|
|
+ * @param { String } actor - The nickname of the actor that causes the notification
|
|
|
+ * @param { String } state - The state representing the type of notificcation
|
|
|
*/
|
|
|
updateNotifications (actor, state) {
|
|
|
const actors_per_state = this.notifications.toJSON();
|
|
@@ -2223,7 +2223,7 @@ const ChatRoomMixin = {
|
|
|
/**
|
|
|
* Given {@link MessageAttributes} look for XEP-0316 Room Notifications and create info
|
|
|
* messages for them.
|
|
|
- * @param { XMLElement } stanza
|
|
|
+ * @param { Element } stanza
|
|
|
*/
|
|
|
handleMEPNotification (attrs) {
|
|
|
if (attrs.from !== this.get('jid') || !attrs.activities) {
|
|
@@ -2320,7 +2320,7 @@ const ChatRoomMixin = {
|
|
|
|
|
|
/**
|
|
|
* Handle a presence stanza that disconnects the user from the MUC
|
|
|
- * @param { XMLElement } stanza
|
|
|
+ * @param { Element } stanza
|
|
|
*/
|
|
|
handleDisconnection (stanza) {
|
|
|
const is_self = stanza.querySelector("status[code='110']") !== null;
|
|
@@ -2455,7 +2455,7 @@ const ChatRoomMixin = {
|
|
|
* @private
|
|
|
* @method _converse.ChatRoom#createInfoMessage
|
|
|
* @param { string } code - The MUC status code
|
|
|
- * @param { XMLElement } stanza - The original stanza that contains the code
|
|
|
+ * @param { Element } stanza - The original stanza that contains the code
|
|
|
* @param { Boolean } is_self - Whether this stanza refers to our own presence
|
|
|
*/
|
|
|
createInfoMessage (code, stanza, is_self) {
|
|
@@ -2498,7 +2498,7 @@ const ChatRoomMixin = {
|
|
|
* Create info messages based on a received presence or message stanza
|
|
|
* @private
|
|
|
* @method _converse.ChatRoom#createInfoMessages
|
|
|
- * @param { XMLElement } stanza
|
|
|
+ * @param { Element } stanza
|
|
|
*/
|
|
|
createInfoMessages (stanza) {
|
|
|
const codes = sizzle(`x[xmlns="${Strophe.NS.MUC_USER}"] status`, stanza).map(s => s.getAttribute('code'));
|
|
@@ -2517,7 +2517,7 @@ const ChatRoomMixin = {
|
|
|
* implied by) the server.
|
|
|
* @param { String } reason - The reason provided for the disconnection
|
|
|
* @param { String } actor - The person (if any) responsible for this disconnection
|
|
|
- * @param { Integer } status - The status code (see `ROOMSTATUS`)
|
|
|
+ * @param { number } status - The status code (see `ROOMSTATUS`)
|
|
|
*/
|
|
|
setDisconnectionState (message, reason, actor, status=ROOMSTATUS.DISCONNECTED) {
|
|
|
this.session.save({
|
|
@@ -2554,7 +2554,7 @@ const ChatRoomMixin = {
|
|
|
* `connection_status` value for this {@link _converse.ChatRoom} as
|
|
|
* well as any additional output that can be shown to the user.
|
|
|
* @private
|
|
|
- * @param { XMLElement } stanza - The presence stanza
|
|
|
+ * @param { Element } stanza - The presence stanza
|
|
|
*/
|
|
|
onErrorPresence (stanza) {
|
|
|
const __ = _converse.__;
|
|
@@ -2619,7 +2619,7 @@ const ChatRoomMixin = {
|
|
|
* Listens for incoming presence stanzas from the service that hosts this MUC
|
|
|
* @private
|
|
|
* @method _converse.ChatRoom#onPresenceFromMUCHost
|
|
|
- * @param { XMLElement } stanza - The presence stanza
|
|
|
+ * @param { Element } stanza - The presence stanza
|
|
|
*/
|
|
|
onPresenceFromMUCHost (stanza) {
|
|
|
if (stanza.getAttribute('type') === 'error') {
|
|
@@ -2638,7 +2638,7 @@ const ChatRoomMixin = {
|
|
|
* Handles incoming presence stanzas coming from the MUC
|
|
|
* @private
|
|
|
* @method _converse.ChatRoom#onPresence
|
|
|
- * @param { XMLElement } stanza
|
|
|
+ * @param { Element } stanza
|
|
|
*/
|
|
|
onPresence (stanza) {
|
|
|
if (stanza.getAttribute('type') === 'error') {
|
|
@@ -2671,7 +2671,7 @@ const ChatRoomMixin = {
|
|
|
* user is the groupchat's owner.
|
|
|
* @private
|
|
|
* @method _converse.ChatRoom#onOwnPresence
|
|
|
- * @param { XMLElement } pres - The stanza
|
|
|
+ * @param { Element } pres - The stanza
|
|
|
*/
|
|
|
async onOwnPresence (stanza) {
|
|
|
await this.occupants.fetched;
|