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
f60b4fc2
Commit
f60b4fc2
authored
Feb 25, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`auto_away` shouldn't change the user's status if it's set to `dnd`
Fixes #620
parent
9779e839
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
7 deletions
+43
-7
docs/CHANGES.md
docs/CHANGES.md
+1
-0
spec/converse.js
spec/converse.js
+39
-5
src/converse-core.js
src/converse-core.js
+3
-2
No files found.
docs/CHANGES.md
View file @
f60b4fc2
...
...
@@ -57,6 +57,7 @@
[
muc_show_join_leave
](
https://conversejs.org/docs/html/configuration.html#muc-show-join-leave
)
-
#366 Show the chat room occupant's JID in the tooltip (if you're allowed to see it). [jcbrand]
-
#610, #785 Add presence priority handling [w3host, jcbrand]
-
#620
`auto_away`
shouldn't change the user's status if it's set to
`dnd`
. [jcbrand]
-
#694 The
`notification_option`
wasn't being used consistently. [jcbrand]
-
#745 New config option
[
priority
](
https://conversejs.org/docs/html/configuration.html#priority
)
[
jcbrand
]
-
#770 Allow setting contact attrs on chats.open [Ape]
...
...
spec/converse.js
View file @
f60b4fc2
...
...
@@ -96,13 +96,31 @@
_converse
.
auto_xa
=
6
;
expect
(
_converse
.
xmppstatus
.
getStatus
()).
toBe
(
'
online
'
);
while
(
i
<=
_converse
.
auto_away
)
{
_converse
.
onEverySecond
();
i
++
;
}
expect
(
_converse
.
auto_changed_status
).
toBe
(
true
);
while
(
i
<=
_converse
.
auto_xa
)
{
expect
(
_converse
.
xmppstatus
.
getStatus
()).
toBe
(
'
away
'
);
_converse
.
onEverySecond
();
i
++
;
}
expect
(
_converse
.
xmppstatus
.
getStatus
()).
toBe
(
'
xa
'
);
expect
(
_converse
.
auto_changed_status
).
toBe
(
true
);
_converse
.
onUserActivity
();
expect
(
_converse
.
xmppstatus
.
getStatus
()).
toBe
(
'
online
'
);
expect
(
_converse
.
auto_changed_status
).
toBe
(
false
);
// Check that it also works for the chat feature
_converse
.
xmppstatus
.
setStatus
(
'
chat
'
);
i
=
0
;
while
(
i
<=
_converse
.
auto_away
)
{
_converse
.
onEverySecond
();
i
++
;
}
expect
(
_converse
.
auto_changed_status
).
toBe
(
true
);
while
(
i
<=
_converse
.
auto_xa
)
{
expect
(
_converse
.
xmppstatus
.
getStatus
()).
toBe
(
'
away
'
);
_converse
.
onEverySecond
();
...
...
@@ -115,10 +133,26 @@
expect
(
_converse
.
xmppstatus
.
getStatus
()).
toBe
(
'
online
'
);
expect
(
_converse
.
auto_changed_status
).
toBe
(
false
);
// Reset values
_converse
.
auto_away
=
0
;
_converse
.
auto_xa
=
0
;
_converse
.
auto_changed_status
=
false
;
// Check that it doesn't work for 'dnd'
_converse
.
xmppstatus
.
setStatus
(
'
dnd
'
);
i
=
0
;
while
(
i
<=
_converse
.
auto_away
)
{
_converse
.
onEverySecond
();
i
++
;
}
expect
(
_converse
.
xmppstatus
.
getStatus
()).
toBe
(
'
dnd
'
);
expect
(
_converse
.
auto_changed_status
).
toBe
(
false
);
while
(
i
<=
_converse
.
auto_xa
)
{
expect
(
_converse
.
xmppstatus
.
getStatus
()).
toBe
(
'
dnd
'
);
_converse
.
onEverySecond
();
i
++
;
}
expect
(
_converse
.
xmppstatus
.
getStatus
()).
toBe
(
'
dnd
'
);
expect
(
_converse
.
auto_changed_status
).
toBe
(
false
);
_converse
.
onUserActivity
();
expect
(
_converse
.
xmppstatus
.
getStatus
()).
toBe
(
'
dnd
'
);
expect
(
_converse
.
auto_changed_status
).
toBe
(
false
);
}));
});
...
...
src/converse-core.js
View file @
f60b4fc2
...
...
@@ -350,11 +350,12 @@
}
if
(
_converse
.
auto_away
>
0
&&
_converse
.
idle_seconds
>
_converse
.
auto_away
&&
stat
!==
'
away
'
&&
stat
!==
'
xa
'
)
{
stat
!==
'
away
'
&&
stat
!==
'
xa
'
&&
stat
!==
'
dnd
'
)
{
_converse
.
auto_changed_status
=
true
;
_converse
.
xmppstatus
.
setStatus
(
'
away
'
);
}
else
if
(
_converse
.
auto_xa
>
0
&&
_converse
.
idle_seconds
>
_converse
.
auto_xa
&&
stat
!==
'
xa
'
)
{
_converse
.
idle_seconds
>
_converse
.
auto_xa
&&
stat
!==
'
xa
'
&&
stat
!==
'
dnd
'
)
{
_converse
.
auto_changed_status
=
true
;
_converse
.
xmppstatus
.
setStatus
(
'
xa
'
);
}
...
...
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