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
14708af7
Commit
14708af7
authored
May 14, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor callback method into instance method
parent
d0ddda82
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
src/converse-muc-views.js
src/converse-muc-views.js
+15
-12
No files found.
src/converse-muc-views.js
View file @
14708af7
...
...
@@ -1509,6 +1509,17 @@ converse.plugins.add('converse-muc-views', {
return
notification
;
},
insertNotification
(
message
)
{
this
.
content
.
insertAdjacentHTML
(
'
beforeend
'
,
tpl_info
({
'
isodate
'
:
(
new
Date
()).
toISOString
(),
'
extra_classes
'
:
'
chat-event
'
,
'
message
'
:
message
})
);
},
showNotificationsforUser
(
notification
)
{
/* Given the notification object generated by
* parseXUserElement, display any relevant messages and
...
...
@@ -1527,21 +1538,13 @@ converse.plugins.add('converse-muc-views', {
this
.
model
.
save
(
'
connection_status
'
,
converse
.
ROOMSTATUS
.
DISCONNECTED
);
return
;
}
notification
.
messages
.
forEach
(
message
=>
{
this
.
content
.
insertAdjacentHTML
(
'
beforeend
'
,
tpl_info
({
'
isodate
'
:
(
new
Date
()).
toISOString
(),
'
extra_classes
'
:
'
chat-event
'
,
'
message
'
:
message
}));
});
if
(
notification
.
reason
)
{
this
.
showChatEvent
(
__
(
'
The reason given is: "%1$s".
'
,
notification
.
reason
));
}
if
(
_
.
get
(
notification
.
messages
,
'
length
'
))
{
notification
.
messages
.
forEach
(
message
=>
this
.
insertNotification
(
message
));
this
.
scrollDown
();
}
if
(
notification
.
reason
)
{
this
.
showChatEvent
(
__
(
'
The reason given is: "%1$s".
'
,
notification
.
reason
));
}
},
onOccupantAdded
(
occupant
)
{
...
...
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