Commit b1ffb34b authored by JC Brand's avatar JC Brand

Add docstrings

parent 7870fc53
......@@ -117,6 +117,17 @@
},
getMessageAttributes (message, delay, original_stanza) {
/* Parses a passed in message stanza and returns an object
* of attributes.
*
* Parameters:
* (XMLElement) message - The message stanza
* (XMLElement) delay - The <delay> node from the
* stanza, if there was one.
* (XMLElement) original_stanza - The original stanza,
* that contains the message stanza, if it was
* contained, otherwise it's the message stanza itself.
*/
delay = delay || message.querySelector('delay');
const type = message.getAttribute('type'),
body = this.getMessageBody(message);
......@@ -157,6 +168,9 @@
},
createMessage (message, delay, original_stanza) {
/* Create a Backbone.Message object inside this chat box
* based on the identified message stanza.
*/
return this.messages.create(this.getMessageAttributes.apply(this, arguments));
},
......@@ -257,6 +271,9 @@
onMessage (message) {
/* Handler method for all incoming single-user chat "message"
* stanzas.
*
* Parameters:
* (XMLElement) message - The incoming message stanza
*/
let contact_jid, delay, resource,
from_jid = message.getAttribute('from'),
......
......@@ -946,7 +946,9 @@
},
renderToolbar (toolbar, options) {
if (!_converse.show_toolbar) { return; }
if (!_converse.show_toolbar) {
return this;
}
toolbar = toolbar || tpl_toolbar;
options = _.assign(
this.model.toJSON(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment