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
32621b83
Commit
32621b83
authored
Dec 19, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clear chat_state timer when closing chat
parent
6c6ef1f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
12 deletions
+20
-12
spec/chatbox.js
spec/chatbox.js
+5
-6
src/converse-chatview.js
src/converse-chatview.js
+13
-4
src/converse-core.js
src/converse-core.js
+2
-2
No files found.
spec/chatbox.js
View file @
32621b83
...
...
@@ -1182,10 +1182,9 @@
}));
it
(
"
will indicate when it has a time difference of more than a day between it and its predecessor
"
,
mock
.
initConverseWithPromises
(
null
,
[
'
rosterGroupsFetched
'
],
{},
function
(
done
,
_converse
)
{
mock
.
initConverseWithPromises
(
null
,
[
'
rosterGroupsFetched
'
],
{},
function
(
done
,
_converse
)
{
test_utils
.
createContacts
(
_converse
,
'
current
'
);
test_utils
.
openControlBox
();
...
...
@@ -1897,8 +1896,8 @@
expect
(
$stanza
.
children
().
get
(
0
).
tagName
).
toBe
(
'
inactive
'
);
expect
(
$stanza
.
children
().
get
(
1
).
tagName
).
toBe
(
'
no-store
'
);
expect
(
$stanza
.
children
().
get
(
2
).
tagName
).
toBe
(
'
no-permanent-store
'
);
done
();
}).
catch
(
_
.
partial
(
_converse
.
log
,
_
,
Strophe
.
LogLevel
.
FATAL
)
);
}).
catch
(
_
.
partial
(
_converse
.
log
,
_
,
Strophe
.
LogLevel
.
FATAL
))
.
then
(
done
);
}));
it
(
"
is sent when the user a minimizes a chat box
"
,
...
...
src/converse-chatview.js
View file @
32621b83
...
...
@@ -577,7 +577,10 @@
}
else
{
this
.
showStatusNotification
(
message
.
get
(
'
fullname
'
)
+
'
'
+
__
(
'
is typing
'
));
}
this
.
clear_status_timeout
=
window
.
setTimeout
(
this
.
clearStatusNotification
.
bind
(
this
),
30000
);
this
.
clear_status_timeout
=
window
.
setTimeout
(
this
.
clearStatusNotification
.
bind
(
this
),
30000
);
}
else
if
(
message
.
get
(
'
chat_state
'
)
===
_converse
.
PAUSED
)
{
if
(
message
.
get
(
'
sender
'
)
===
'
me
'
)
{
this
.
showStatusNotification
(
__
(
'
Stopped typing on the other device
'
));
...
...
@@ -749,10 +752,16 @@
}
if
(
state
===
_converse
.
COMPOSING
)
{
this
.
chat_state_timeout
=
window
.
setTimeout
(
this
.
setChatState
.
bind
(
this
),
_converse
.
TIMEOUTS
.
PAUSED
,
_converse
.
PAUSED
);
this
.
setChatState
.
bind
(
this
),
_converse
.
TIMEOUTS
.
PAUSED
,
_converse
.
PAUSED
);
}
else
if
(
state
===
_converse
.
PAUSED
)
{
this
.
chat_state_timeout
=
window
.
setTimeout
(
this
.
setChatState
.
bind
(
this
),
_converse
.
TIMEOUTS
.
INACTIVE
,
_converse
.
INACTIVE
);
this
.
setChatState
.
bind
(
this
),
_converse
.
TIMEOUTS
.
INACTIVE
,
_converse
.
INACTIVE
);
}
if
(
!
no_save
&&
this
.
model
.
get
(
'
chat_state
'
)
!==
state
)
{
this
.
model
.
set
(
'
chat_state
'
,
state
);
...
...
@@ -864,7 +873,7 @@
if
(
_converse
.
connection
.
connected
)
{
// Immediately sending the chat state, because the
// model is going to be destroyed afterwards.
this
.
model
.
set
(
'
chat_state
'
,
_converse
.
INACTIVE
);
this
.
setChatState
(
_converse
.
INACTIVE
);
this
.
sendChatState
();
}
try
{
...
...
src/converse-core.js
View file @
32621b83
...
...
@@ -170,8 +170,6 @@
}
else
if
(
level
===
Strophe
.
LogLevel
.
WARN
)
{
if
(
_converse
.
debug
)
{
logger
.
warn
(
`
${
prefix
}
${
moment
().
format
()}
WARNING:
${
message
}
`
,
style
);
}
else
{
logger
.
warn
(
`
${
prefix
}
WARNING:
${
message
}
`
,
style
);
}
}
else
if
(
level
===
Strophe
.
LogLevel
.
FATAL
)
{
if
(
_converse
.
debug
)
{
...
...
@@ -249,7 +247,9 @@
// out or disconnecting in the previous session.
// This happens in tests. We therefore first clean up.
Backbone
.
history
.
stop
();
_converse
.
chatboxviews
.
closeAllChatBoxes
();
delete
_converse
.
controlboxtoggle
;
delete
_converse
.
chatboxviews
;
_converse
.
connection
.
reset
();
_converse
.
off
();
_converse
.
stopListening
();
...
...
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