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
df0c55ed
Commit
df0c55ed
authored
Apr 04, 2015
by
JC Brand
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into anon_login
parents
a2be2567
5a488333
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
8 deletions
+33
-8
converse.js
converse.js
+5
-6
docs/CHANGES.rst
docs/CHANGES.rst
+1
-0
spec/chatbox.js
spec/chatbox.js
+27
-2
No files found.
converse.js
View file @
df0c55ed
...
...
@@ -1260,12 +1260,11 @@
* (string) state - The chat state (consts ACTIVE, COMPOSING, PAUSED, INACTIVE, GONE)
* (no_save) no_save - Just do the cleanup or setup but don't actually save the state.
*/
if
(
_
.
contains
([
ACTIVE
,
INACTIVE
,
GONE
],
state
))
{
if
(
typeof
this
.
chat_state_timeout
!==
'
undefined
'
)
{
clearTimeout
(
this
.
chat_state_timeout
);
delete
this
.
chat_state_timeout
;
}
}
else
if
(
state
===
COMPOSING
)
{
if
(
state
===
COMPOSING
)
{
this
.
chat_state_timeout
=
setTimeout
(
$
.
proxy
(
this
.
setChatState
,
this
),
converse
.
TIMEOUTS
.
PAUSED
,
PAUSED
);
}
else
if
(
state
===
PAUSED
)
{
...
...
docs/CHANGES.rst
View file @
df0c55ed
...
...
@@ -10,6 +10,7 @@ Changelog
* #356 Fix the plugin extend function. [floriancargoet]
* #357 Fix the known bug where a state notification reopens a chat box. [floriancargoet]
* #358 Bugfix. Chat rooms show the same occupants bug. [floriancargoet]
* #359 Fix a timeout bug in chat state notifications. [floriancargoet]
0.9.1 (2015-03-26)
------------------
...
...
spec/chatbox.js
View file @
df0c55ed
...
...
@@ -781,6 +781,8 @@
var
contact_jid
=
mock
.
cur_names
[
0
].
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
test_utils
.
openChatBoxFor
(
contact_jid
);
var
view
=
this
.
chatboxviews
.
get
(
contact_jid
);
spyOn
(
converse
.
connection
,
'
send
'
);
spyOn
(
view
,
'
setChatState
'
).
andCallThrough
();
runs
(
function
()
{
expect
(
view
.
model
.
get
(
'
chat_state
'
)).
toBe
(
'
active
'
);
view
.
keyPressed
({
...
...
@@ -788,16 +790,39 @@
keyCode
:
1
});
expect
(
view
.
model
.
get
(
'
chat_state
'
)).
toBe
(
'
composing
'
);
spyOn
(
converse
.
connection
,
'
send
'
);
expect
(
converse
.
connection
.
send
).
toHaveBeenCalled
();
var
$stanza
=
$
(
converse
.
connection
.
send
.
argsForCall
[
0
][
0
].
tree
());
expect
(
$stanza
.
children
().
prop
(
'
tagName
'
)).
toBe
(
'
composing
'
);
});
waits
(
250
);
runs
(
function
()
{
expect
(
view
.
model
.
get
(
'
chat_state
'
)).
toBe
(
'
paused
'
);
expect
(
converse
.
connection
.
send
).
toHaveBeenCalled
();
var
$stanza
=
$
(
converse
.
connection
.
send
.
argsForCall
[
0
][
0
].
tree
());
var
$stanza
=
$
(
converse
.
connection
.
send
.
argsForCall
[
1
][
0
].
tree
());
expect
(
$stanza
.
attr
(
'
to
'
)).
toBe
(
contact_jid
);
expect
(
$stanza
.
children
().
length
).
toBe
(
1
);
expect
(
$stanza
.
children
().
prop
(
'
tagName
'
)).
toBe
(
'
paused
'
);
// Test #359. A paused notification should not be sent
// out if the user simply types longer than the
// timeout.
view
.
keyPressed
({
target
:
view
.
$el
.
find
(
'
textarea.chat-textarea
'
),
keyCode
:
1
});
expect
(
view
.
setChatState
).
toHaveBeenCalled
();
expect
(
view
.
model
.
get
(
'
chat_state
'
)).
toBe
(
'
composing
'
);
});
waits
(
100
);
runs
(
function
()
{
view
.
keyPressed
({
target
:
view
.
$el
.
find
(
'
textarea.chat-textarea
'
),
keyCode
:
1
});
expect
(
view
.
model
.
get
(
'
chat_state
'
)).
toBe
(
'
composing
'
);
});
waits
(
150
);
runs
(
function
()
{
expect
(
view
.
model
.
get
(
'
chat_state
'
)).
toBe
(
'
composing
'
);
});
},
converse
));
...
...
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