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
bb0c0fcd
Commit
bb0c0fcd
authored
May 21, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove message views when messages get reset
parent
b4b7fedf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
6 deletions
+14
-6
src/converse-chatview.js
src/converse-chatview.js
+4
-1
src/converse-mam-views.js
src/converse-mam-views.js
+2
-1
src/converse-muc-views.js
src/converse-muc-views.js
+4
-1
src/headless/converse-chatboxes.js
src/headless/converse-chatboxes.js
+1
-1
src/headless/converse-muc.js
src/headless/converse-muc.js
+3
-2
No files found.
src/converse-chatview.js
View file @
bb0c0fcd
...
...
@@ -339,7 +339,10 @@ converse.plugins.add('converse-chatview', {
this
.
initDebounced
();
this
.
model
.
messages
.
on
(
'
add
'
,
this
.
onMessageAdded
,
this
);
this
.
model
.
messages
.
on
(
'
rendered
'
,
this
.
scrollDown
,
this
);
this
.
model
.
messages
.
on
(
'
reset
'
,
()
=>
(
this
.
content
.
innerHTML
=
''
));
this
.
model
.
messages
.
on
(
'
reset
'
,
()
=>
{
this
.
content
.
innerHTML
=
''
;
this
.
removeAll
();
});
this
.
model
.
on
(
'
show
'
,
this
.
show
,
this
);
this
.
model
.
on
(
'
destroy
'
,
this
.
remove
,
this
);
...
...
src/converse-mam-views.js
View file @
bb0c0fcd
...
...
@@ -152,7 +152,7 @@ converse.plugins.add('converse-mam-views', {
*/
const
{
_converse
}
=
this
;
/*
Event handlers
*/
/*
*********************** BEGIN Event Handlers ***********************
*/
_converse
.
api
.
listen
.
on
(
'
afterMessagesFetched
'
,
chatbox
=>
chatbox
.
fetchNewestMessages
());
_converse
.
api
.
listen
.
on
(
'
reconnected
'
,
()
=>
{
...
...
@@ -161,5 +161,6 @@ converse.plugins.add('converse-mam-views', {
);
_
.
each
(
private_chats
,
view
=>
view
.
model
.
fetchNewestMessages
())
});
/************************ END Event Handlers ************************/
}
});
src/converse-muc-views.js
View file @
bb0c0fcd
...
...
@@ -541,7 +541,10 @@ converse.plugins.add('converse-muc-views', {
this
.
model
.
messages
.
on
(
'
add
'
,
this
.
onMessageAdded
,
this
);
this
.
model
.
messages
.
on
(
'
rendered
'
,
this
.
scrollDown
,
this
);
this
.
model
.
messages
.
on
(
'
reset
'
,
()
=>
(
this
.
content
.
innerHTML
=
''
));
this
.
model
.
messages
.
on
(
'
reset
'
,
()
=>
{
this
.
content
.
innerHTML
=
''
;
this
.
removeAll
();
});
this
.
model
.
on
(
'
change:affiliation
'
,
this
.
renderHeading
,
this
);
this
.
model
.
on
(
'
change:connection_status
'
,
this
.
onConnectionStatusChanged
,
this
);
...
...
src/headless/converse-chatboxes.js
View file @
bb0c0fcd
...
...
@@ -301,7 +301,6 @@ converse.plugins.add('converse-chatboxes', {
this
.
messages
.
browserStorage
=
new
Backbone
.
BrowserStorage
.
session
(
`converse.messages-
${
this
.
get
(
'
jid
'
)}
-
${
_converse
.
bare_jid
}
`
);
this
.
messages
.
chatbox
=
this
;
this
.
messages
.
fetched
=
u
.
getResolveablePromise
();
this
.
messages
.
on
(
'
change:upload
'
,
(
message
)
=>
{
if
(
message
.
get
(
'
upload
'
)
===
_converse
.
SUCCESS
)
{
...
...
@@ -323,6 +322,7 @@ converse.plugins.add('converse-chatboxes', {
},
fetchMessages
()
{
this
.
messages
.
fetched
=
u
.
getResolveablePromise
();
const
resolve
=
this
.
messages
.
fetched
.
resolve
;
this
.
messages
.
fetch
({
'
add
'
:
true
,
...
...
src/headless/converse-muc.js
View file @
bb0c0fcd
...
...
@@ -216,8 +216,8 @@ converse.plugins.add('converse-muc', {
this
.
initFeatures
();
this
.
initOccupants
();
this
.
initMessages
();
this
.
registerHandlers
();
this
.
initMessages
();
},
async
onConnectionStatusChanged
()
{
...
...
@@ -1532,10 +1532,11 @@ converse.plugins.add('converse-muc', {
*/
_converse
.
chatboxes
.
filter
(
m
=>
(
m
.
get
(
'
type
'
)
===
_converse
.
CHATROOMS_TYPE
))
.
forEach
(
m
=>
m
.
save
(
'
connection_status
'
,
converse
.
ROOMSTATUS
.
DISCONNECTED
))
.
forEach
(
room
=>
{
room
.
save
(
'
connection_status
'
,
converse
.
ROOMSTATUS
.
DISCONNECTED
);
room
.
clearMessages
();
room
.
registerHandlers
();
room
.
fetchMessages
();
room
.
join
();
});
}
...
...
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