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
a660f853
Commit
a660f853
authored
May 20, 2015
by
thierrytiti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XEP-0352: Client State Indication
XEP-0352 support added to Auto Away Mode
parent
e35c5a4f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
converse.js
converse.js
+19
-1
docs/CHANGES.rst
docs/CHANGES.rst
+1
-1
No files found.
converse.js
View file @
a660f853
...
...
@@ -354,17 +354,29 @@
// Module-level functions
// ----------------------
this
.
autoAwayReset
=
function
(){
this
.
autoAwayReset
=
function
(){
if
(
converse
.
_idleCounter
>
0
)
{
converse
.
_idleCounter
=
0
;
if
(
converse
.
_autoAway
>
0
)
{
converse
.
_autoAway
=
0
;
if
(
converse
.
HAS_CSI
)
{
converse
.
connection
.
send
(
$build
(
"
active
"
,
{
xmlns
:
'
urn:xmpp:csi:0
'
}));
}
converse
.
xmppstatus
.
setStatus
(
'
online
'
);
}
}
};
this
.
registerAutoAwayHandler
=
function
(){
if
(
converse
.
auto_away
>
0
||
converse
.
auto_xa
>
0
){
if
(
converse
.
features
.
findWhere
({
'
var
'
:
'
urn:xmpp:csi
'
}))
{
// The server supports XEP-0352 Client State Indication
converse
.
HAS_CSI
=
true
;
}
else
{
converse
.
HAS_CSI
=
false
;
}
if
(
converse
.
auto_xa
>
0
&&
converse
.
auto_xa
<
converse
.
auto_away
)
converse
.
auto_xa
=
converse
.
auto_away
;
converse
.
_idleCounter
=
0
;
converse
.
_autoAway
=
0
;
...
...
@@ -381,10 +393,16 @@
converse
.
_idleCounter
++
;
}
if
(
converse
.
auto_away
>
0
&&
converse
.
_autoAway
!=
1
&&
converse
.
_idleCounter
>
converse
.
auto_away
&&
converse
.
_idleCounter
<=
converse
.
auto_xa
){
if
(
converse
.
HAS_CSI
)
{
converse
.
connection
.
send
(
$build
(
"
inactive
"
,
{
xmlns
:
'
urn:xmpp:csi:0
'
}));
}
converse
.
_autoAway
=
1
;
converse
.
xmppstatus
.
setStatus
(
'
away
'
);
}
else
if
(
converse
.
auto_xa
>
0
&&
converse
.
_autoAway
!=
2
&&
converse
.
_idleCounter
>
converse
.
auto_xa
){
if
(
converse
.
HAS_CSI
)
{
converse
.
connection
.
send
(
$build
(
"
inactive
"
,
{
xmlns
:
'
urn:xmpp:csi:0
'
}));
}
converse
.
_autoAway
=
2
;
converse
.
xmppstatus
.
setStatus
(
'
xa
'
);
}
...
...
docs/CHANGES.rst
View file @
a660f853
...
...
@@ -8,7 +8,7 @@ Changelog
* Bugfix. Manual login doesn't work when only websocket_url is set and not bosh_service_url. [jcbrand]
* Bugfix. clearSessions during unload event would throw an error when not logged in. [gbonvehi]
* #389 Allow login panel placeholders and roster item 'Name' translations. [gbonvehi]
* Add automatic Away mode [thierrytiti]
* Add automatic Away mode
and XEP-0352 support
[thierrytiti]
0.9.3 (2015-05-01)
------------------
...
...
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