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
a8ef1d29
Commit
a8ef1d29
authored
Oct 16, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #1058 Send inactive CSN when user switches tab
parent
09c3d30c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
8 deletions
+39
-8
CHANGES.md
CHANGES.md
+1
-0
dist/converse.js
dist/converse.js
+20
-3
src/converse-chatview.js
src/converse-chatview.js
+16
-3
src/converse-singleton.js
src/converse-singleton.js
+2
-2
No files found.
CHANGES.md
View file @
a8ef1d29
...
...
@@ -7,6 +7,7 @@
-
Don't show duplicate notification messages
-
New config setting
[
show_images_inline
](
https://conversejs.org/docs/html/configuration.html#show-images-inline
)
-
#537 Render
`xmpp:`
URI as link
-
#1058 Send an inactive chat state notification when the user switches to another tab
-
#1062 Collapse multiple join/leave messages into one
-
#1063 URLs in the topic / subject are not clickable
-
#1140 Add support for destroyed chatrooms
...
...
dist/converse.js
View file @
a8ef1d29
...
...
@@ -61157,7 +61157,11 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
function onWindowStateChanged(data) {
if (_converse.chatboxviews) {
_converse.chatboxviews.each(view => view.onWindowStateChanged(data.state));
_converse.chatboxviews.each(view => {
if (view.model.get('id') !== 'controlbox') {
view.onWindowStateChanged(data.state);
}
});
}
}
...
...
@@ -62382,8 +62386,21 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
},
onWindowStateChanged(state) {
if (this.model.get('num_unread', 0) && !this.model.isHidden()) {
this.model.clearUnreadMsgCounter();
if (state === 'visible') {
if (!this.model.isHidden()) {
this.setChatState(_converse.ACTIVE);
if (this.model.get('num_unread', 0)) {
this.model.clearUnreadMsgCounter();
}
}
} else if (state === 'hidden') {
this.setChatState(_converse.INACTIVE, {
'silent': true
});
this.model.sendChatState();
_converse.connection.flush();
}
}
src/converse-chatview.js
View file @
a8ef1d29
...
...
@@ -91,7 +91,11 @@
function
onWindowStateChanged
(
data
)
{
if
(
_converse
.
chatboxviews
)
{
_converse
.
chatboxviews
.
each
(
view
=>
view
.
onWindowStateChanged
(
data
.
state
));
_converse
.
chatboxviews
.
each
(
view
=>
{
if
(
view
.
model
.
get
(
'
id
'
)
!==
'
controlbox
'
)
{
view
.
onWindowStateChanged
(
data
.
state
);
}
});
}
}
_converse
.
api
.
listen
.
on
(
'
windowStateChanged
'
,
onWindowStateChanged
);
...
...
@@ -1266,8 +1270,17 @@
},
onWindowStateChanged
(
state
)
{
if
(
this
.
model
.
get
(
'
num_unread
'
,
0
)
&&
!
this
.
model
.
isHidden
())
{
this
.
model
.
clearUnreadMsgCounter
();
if
(
state
===
'
visible
'
)
{
if
(
!
this
.
model
.
isHidden
())
{
this
.
setChatState
(
_converse
.
ACTIVE
);
if
(
this
.
model
.
get
(
'
num_unread
'
,
0
))
{
this
.
model
.
clearUnreadMsgCounter
();
}
}
}
else
if
(
state
===
'
hidden
'
)
{
this
.
setChatState
(
_converse
.
INACTIVE
,
{
'
silent
'
:
true
});
this
.
model
.
sendChatState
();
_converse
.
connection
.
flush
();
}
}
});
...
...
src/converse-singleton.js
View file @
a8ef1d29
...
...
@@ -55,8 +55,8 @@
}
if
(
_converse
.
isSingleton
())
{
const
any_chats_visible
=
_converse
.
chatboxes
.
filter
(
(
cb
)
=>
cb
.
get
(
'
id
'
)
!=
'
controlbox
'
)
.
filter
(
(
cb
)
=>
!
cb
.
get
(
'
hidden
'
)).
length
>
0
;
.
filter
(
cb
=>
cb
.
get
(
'
id
'
)
!=
'
controlbox
'
)
.
filter
(
cb
=>
!
cb
.
get
(
'
hidden
'
)).
length
>
0
;
if
(
any_chats_visible
)
{
return
!
chatbox
.
get
(
'
hidden
'
);
...
...
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