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
d6ef4fc5
Commit
d6ef4fc5
authored
Jul 01, 2016
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method hook for adding more attrs to send to the message template
parent
1666a45c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
src/converse-chatview.js
src/converse-chatview.js
+17
-9
No files found.
src/converse-chatview.js
View file @
d6ef4fc5
...
...
@@ -254,6 +254,12 @@
)(
this
.
renderMessage
(
attrs
));
},
getExtraMessageTemplateAttributes
:
function
(
attrs
)
{
// Provides a hook for sending more attributes to the
// message template.
return
{};
},
renderMessage
:
function
(
attrs
)
{
/* Renders a chat message based on the passed in attributes.
*
...
...
@@ -286,15 +292,17 @@
// are mentioned.
extra_classes
+=
'
mentioned
'
;
}
return
$
(
template
({
msgid
:
attrs
.
msgid
,
'
sender
'
:
attrs
.
sender
,
'
time
'
:
msg_time
.
format
(
'
hh:mm
'
),
'
isodate
'
:
msg_time
.
format
(),
'
username
'
:
username
,
'
message
'
:
''
,
'
extra_classes
'
:
extra_classes
})).
children
(
'
.chat-msg-content
'
).
first
().
text
(
text
)
return
$
(
template
(
_
.
extend
(
this
.
getExtraMessageTemplateAttributes
(
attrs
),
{
'
msgid
'
:
attrs
.
msgid
,
'
sender
'
:
attrs
.
sender
,
'
time
'
:
msg_time
.
format
(
'
hh:mm
'
),
'
isodate
'
:
msg_time
.
format
(),
'
username
'
:
username
,
'
message
'
:
''
,
'
extra_classes
'
:
extra_classes
})
)).
children
(
'
.chat-msg-content
'
).
first
().
text
(
text
)
.
addHyperlinks
()
.
addEmoticons
(
converse
.
visible_toolbar_buttons
.
emoticons
).
parent
();
},
...
...
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