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
86c20ce2
Commit
86c20ce2
authored
Jun 23, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
muc: When exiting, don't wait for confirmation before cleaning up
During logout we don't have enough time.
parent
53643ab5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
25 deletions
+25
-25
src/converse-muc.js
src/converse-muc.js
+25
-25
No files found.
src/converse-muc.js
View file @
86c20ce2
...
...
@@ -134,6 +134,14 @@
//
// New functions which don't exist yet can also be added.
_tearDown
:
function
()
{
var
rooms
=
this
.
chatboxes
.
where
({
'
type
'
:
CHATROOMS_TYPE
});
_
.
each
(
rooms
,
function
(
room
)
{
room
.
save
({
'
connection_status
'
:
ROOMSTATUS
.
DISCONNECTED
});
});
this
.
__super__
.
_tearDown
.
call
(
this
,
arguments
);
},
Features
:
{
addClientFeatures
:
function
()
{
var
_converse
=
this
.
__super__
.
_converse
;
...
...
@@ -1226,14 +1234,16 @@
return
this
;
},
cleanup
:
function
()
{
if
(
this
.
model
.
collection
&&
this
.
model
.
collection
.
browserStorage
)
{
this
.
model
.
save
(
'
connection_status
'
,
ROOMSTATUS
.
DISCONNECTED
);
}
else
{
this
.
model
.
set
(
'
connection_status
'
,
ROOMSTATUS
.
DISCONNECTED
);
sendUnavailablePresence
:
function
(
exit_msg
)
{
var
presence
=
$pres
({
type
:
"
unavailable
"
,
from
:
_converse
.
connection
.
jid
,
to
:
this
.
getRoomJIDAndNick
()
});
if
(
exit_msg
!==
null
)
{
presence
.
c
(
"
status
"
,
exit_msg
);
}
this
.
removeHandlers
();
_converse
.
ChatBoxView
.
prototype
.
close
.
apply
(
this
,
arguments
);
_converse
.
connection
.
sendPresence
(
presence
);
},
leave
:
function
(
exit_msg
)
{
...
...
@@ -1246,26 +1256,16 @@
this
.
hide
();
this
.
occupantsview
.
model
.
reset
();
this
.
occupantsview
.
model
.
browserStorage
.
_clear
();
if
(
!
_converse
.
connection
.
connected
||
this
.
model
.
get
(
'
connection_status
'
)
===
ROOMSTATUS
.
DISCONNECTED
)
{
// Don't send out a stanza if we're not connected.
this
.
cleanup
();
return
;
if
(
_converse
.
connection
.
connected
)
{
this
.
sendUnavailablePresence
(
exit_msg
);
}
var
presence
=
$pres
({
type
:
"
unavailable
"
,
from
:
_converse
.
connection
.
jid
,
to
:
this
.
getRoomJIDAndNick
()
});
if
(
exit_msg
!==
null
)
{
presence
.
c
(
"
status
"
,
exit_msg
);
if
(
utils
.
isPersistableModel
(
this
.
model
))
{
this
.
model
.
save
(
'
connection_status
'
,
ROOMSTATUS
.
DISCONNECTED
);
}
else
{
this
.
model
.
set
(
'
connection_status
'
,
ROOMSTATUS
.
DISCONNECTED
);
}
_converse
.
connection
.
sendPresence
(
presence
,
this
.
cleanup
.
bind
(
this
),
this
.
cleanup
.
bind
(
this
),
2000
);
this
.
removeHandlers
();
_converse
.
ChatBoxView
.
prototype
.
close
.
apply
(
this
,
arguments
);
},
renderConfigurationForm
:
function
(
stanza
)
{
...
...
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