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
9a2ed106
Commit
9a2ed106
authored
Jun 07, 2015
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix. Don't reconnect when disconnect was due to auth err.
parent
94514dfe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
converse.js
converse.js
+15
-10
No files found.
converse.js
View file @
9a2ed106
...
...
@@ -583,6 +583,7 @@
this
.
onConnectStatusChanged
=
function
(
status
,
condition
,
reconnect
)
{
converse
.
log
(
"
Status changed to:
"
+
PRETTY_CONNECTION_STATUS
[
status
]);
if
(
status
===
Strophe
.
Status
.
CONNECTED
||
status
===
Strophe
.
Status
.
ATTACHED
)
{
delete
converse
.
disconnection_cause
;
if
((
typeof
reconnect
!==
'
undefined
'
)
&&
(
reconnect
))
{
converse
.
log
(
status
===
Strophe
.
Status
.
CONNECTED
?
'
Reconnected
'
:
'
Reattached
'
);
converse
.
onReconnected
();
...
...
@@ -591,8 +592,8 @@
converse
.
onConnected
();
}
}
else
if
(
status
===
Strophe
.
Status
.
DISCONNECTED
)
{
if
(
converse
.
auto_reconnect
)
{
converse
.
reconnect
();
if
(
converse
.
disconnection_cause
==
Strophe
.
Status
.
CONNFAIL
&&
converse
.
auto_reconnect
)
{
converse
.
reconnect
(
condition
);
}
else
{
converse
.
renderLoginPanel
();
}
...
...
@@ -605,6 +606,9 @@
}
else
if
(
status
===
Strophe
.
Status
.
AUTHFAIL
)
{
converse
.
giveFeedback
(
__
(
'
Authentication Failed
'
),
'
error
'
);
converse
.
connection
.
disconnect
(
__
(
'
Authentication Failed
'
));
converse
.
disconnection_cause
=
Strophe
.
Status
.
AUTHFAIL
;
}
else
if
(
status
===
Strophe
.
Status
.
CONNFAIL
)
{
converse
.
disconnection_cause
=
Strophe
.
Status
.
CONNFAIL
;
}
else
if
(
status
===
Strophe
.
Status
.
DISCONNECTING
)
{
// FIXME: what about prebind?
if
(
!
converse
.
connection
.
connected
)
{
...
...
@@ -1363,6 +1367,9 @@
},
sendMessage
:
function
(
text
)
{
if
(
!
converse
.
connection
.
authenticated
)
{
return
this
.
showHelpMessages
([
'
Sorry, the connection has been lost, and your message could not be sent
'
],
'
error
'
);
}
var
match
=
text
.
replace
(
/^
\s
*/
,
""
).
match
(
/^
\/(
.*
)\s
*$/
),
msgs
;
if
(
match
)
{
if
(
match
[
1
]
===
"
clear
"
)
{
...
...
@@ -4972,21 +4979,19 @@
},
getPrettyStatus
:
function
(
stat
)
{
var
pretty_status
;
if
(
stat
===
'
chat
'
)
{
pretty_status
=
__
(
'
online
'
);
return
__
(
'
online
'
);
}
else
if
(
stat
===
'
dnd
'
)
{
pretty_status
=
__
(
'
busy
'
);
return
__
(
'
busy
'
);
}
else
if
(
stat
===
'
xa
'
)
{
pretty_status
=
__
(
'
away for long
'
);
return
__
(
'
away for long
'
);
}
else
if
(
stat
===
'
away
'
)
{
pretty_status
=
__
(
'
away
'
);
return
__
(
'
away
'
);
}
else
if
(
stat
===
'
offline
'
)
{
pretty_status
=
__
(
'
offline
'
);
return
__
(
'
offline
'
);
}
else
{
pretty_status
=
__
(
stat
)
||
__
(
'
online
'
);
return
__
(
stat
)
||
__
(
'
online
'
);
}
return
pretty_status
;
},
updateStatusUI
:
function
(
model
)
{
...
...
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