Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
b1ffb34b
Commit
b1ffb34b
authored
Feb 02, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add docstrings
parent
7870fc53
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
src/converse-chatboxes.js
src/converse-chatboxes.js
+21
-4
src/converse-chatview.js
src/converse-chatview.js
+3
-1
No files found.
src/converse-chatboxes.js
View file @
b1ffb34b
...
...
@@ -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,13 +168,16 @@
},
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
));
},
newMessageWillBeHidden
()
{
/* Returns a boolean to indicate whether a newly received
* message will be visible to the user or not.
*/
* message will be visible to the user or not.
*/
return
this
.
get
(
'
hidden
'
)
||
this
.
get
(
'
minimized
'
)
||
this
.
isScrolledUp
()
||
...
...
@@ -256,8 +270,11 @@
onMessage
(
message
)
{
/* Handler method for all incoming single-user chat "message"
* stanzas.
*/
* stanzas.
*
* Parameters:
* (XMLElement) message - The incoming message stanza
*/
let
contact_jid
,
delay
,
resource
,
from_jid
=
message
.
getAttribute
(
'
from
'
),
to_jid
=
message
.
getAttribute
(
'
to
'
);
...
...
src/converse-chatview.js
View file @
b1ffb34b
...
...
@@ -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
(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment