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
c1662c63
Commit
c1662c63
authored
Jan 31, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly disconnect upon "host-unknown" error.
parent
25e570c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
docs/CHANGES.md
docs/CHANGES.md
+1
-0
src/converse-core.js
src/converse-core.js
+12
-9
No files found.
docs/CHANGES.md
View file @
c1662c63
...
...
@@ -8,6 +8,7 @@
-
Bugfix. Cancel button shown while registration form is being fetched wasn't working
properly. [jcbrand]
-
Bugfix. Login form wasn't rendered after logging out (when
`auto_reconnect`
is
`true`
). [jcbrand]
-
Properly disconnect upon "host-unknown" error. [jcbrand]
## 2.0.4 (2016-12-13)
-
#737: Bugfix. Translations weren't being applied. [jcbrand]
...
...
src/converse-core.js
View file @
c1662c63
...
...
@@ -420,6 +420,7 @@
this
.
onDisconnected
=
function
(
condition
)
{
if
(
_
.
includes
([
converse
.
LOGOUT
,
Strophe
.
Status
.
AUTHFAIL
],
converse
.
disconnection_cause
)
||
converse
.
disconnection_reason
===
"
host-unknown
"
||
!
converse
.
auto_reconnect
)
{
return
this
.
disconnect
();
}
...
...
@@ -435,9 +436,10 @@
return
'
reconnecting
'
;
};
this
.
setDisconnectionCause
=
function
(
connection_status
)
{
if
(
typeof
converse
.
disconnection_cause
===
"
undefined
"
)
{
converse
.
disconnection_cause
=
connection_status
;
this
.
setDisconnectionCause
=
function
(
cause
,
reason
,
override
)
{
if
(
_
.
isUndefined
(
converse
.
disconnection_cause
)
||
override
)
{
converse
.
disconnection_cause
=
cause
;
converse
.
disconnection_reason
=
reason
;
}
};
...
...
@@ -447,6 +449,7 @@
// By default we always want to send out an initial presence stanza.
converse
.
send_initial_presence
=
true
;
delete
converse
.
disconnection_cause
;
delete
converse
.
disconnection_reason
;
if
(
converse
.
connection
.
reconnecting
)
{
converse
.
log
(
status
===
Strophe
.
Status
.
CONNECTED
?
'
Reconnected
'
:
'
Reattached
'
);
converse
.
onConnected
(
true
);
...
...
@@ -460,7 +463,7 @@
converse
.
onConnected
();
}
}
else
if
(
status
===
Strophe
.
Status
.
DISCONNECTED
)
{
converse
.
setDisconnectionCause
(
status
);
converse
.
setDisconnectionCause
(
status
,
condition
);
converse
.
onDisconnected
(
condition
);
}
else
if
(
status
===
Strophe
.
Status
.
ERROR
)
{
converse
.
giveFeedback
(
...
...
@@ -474,11 +477,11 @@
}
else
if
(
status
===
Strophe
.
Status
.
AUTHFAIL
)
{
converse
.
giveFeedback
(
__
(
'
Authentication failed.
'
),
'
error
'
);
converse
.
connection
.
disconnect
(
__
(
'
Authentication Failed
'
));
converse
.
disconnection_cause
=
Strophe
.
Status
.
AUTHFAIL
;
converse
.
setDisconnectionCause
(
status
,
condition
,
true
)
;
}
else
if
(
status
===
Strophe
.
Status
.
CONNFAIL
)
{
converse
.
setDisconnectionCause
(
status
);
converse
.
setDisconnectionCause
(
status
,
condition
);
}
else
if
(
status
===
Strophe
.
Status
.
DISCONNECTING
)
{
converse
.
setDisconnectionCause
(
status
);
converse
.
setDisconnectionCause
(
status
,
condition
);
if
(
condition
)
{
converse
.
giveFeedback
(
__
(
"
Disconnected
"
),
'
warn
'
,
...
...
@@ -541,7 +544,7 @@
this
.
logOut
=
function
()
{
converse
.
chatboxviews
.
closeAllChatBoxes
();
converse
.
disconnection_cause
=
converse
.
LOGOUT
;
converse
.
setDisconnectionCause
(
converse
.
LOGOUT
,
undefined
,
true
)
;
if
(
typeof
converse
.
connection
!==
'
undefined
'
)
{
converse
.
connection
.
disconnect
();
}
...
...
@@ -1831,7 +1834,7 @@
throw
new
Error
(
"
initConnection: If you use auto_login and
"
+
"
authentication='login' then you also need to provide a password.
"
);
}
converse
.
disconnection_cause
=
Strophe
.
Status
.
AUTHFAIL
;
converse
.
setDisconnectionCause
(
Strophe
.
Status
.
AUTHFAIL
,
undefined
,
true
)
;
converse
.
disconnect
();
return
;
}
...
...
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