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
5136b0c1
Commit
5136b0c1
authored
May 07, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix two failing tests (and a bug)
parent
e6ba62d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
11 deletions
+31
-11
spec/chatroom.js
spec/chatroom.js
+28
-9
src/converse-chatboxes.js
src/converse-chatboxes.js
+3
-2
No files found.
spec/chatroom.js
View file @
5136b0c1
...
...
@@ -282,6 +282,7 @@
null
,
[
'
rosterGroupsFetched
'
],
{},
function
(
done
,
_converse
)
{
var
IQ_stanzas
=
_converse
.
connection
.
IQ_stanzas
;
var
sent_IQ
,
IQ_id
;
var
sendIQ
=
_converse
.
connection
.
sendIQ
;
spyOn
(
_converse
.
connection
,
'
sendIQ
'
).
and
.
callFake
(
function
(
iq
,
callback
,
errback
)
{
...
...
@@ -326,11 +327,20 @@
* </iq>
*/
test_utils
.
waitUntil
(
function
()
{
return
sent_IQ
.
toLocaleString
()
===
"
<iq to='lounge@localhost' from='dummy@localhost/resource'
"
+
"
type='get' xmlns='jabber:client' id='
"
+
IQ_id
+
"
'>
"
+
"
<query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'/></iq>
"
return
_
.
filter
(
IQ_stanzas
,
function
(
iq
)
{
return
iq
.
nodeTree
.
querySelector
(
'
query[node="x-roomuser-item"]
'
);
}).
length
>
0
;
},
300
).
then
(
function
()
{
const
iq
=
_
.
filter
(
IQ_stanzas
,
function
(
iq
)
{
return
iq
.
nodeTree
.
querySelector
(
`query[node="x-roomuser-item"]`
);
}).
pop
();
const
id
=
iq
.
nodeTree
.
getAttribute
(
'
id
'
);
expect
(
iq
.
toLocaleString
()).
toBe
(
"
<iq to='lounge@localhost' from='dummy@localhost/resource'
"
+
"
type='get' xmlns='jabber:client' id='
"
+
id
+
"
'>
"
+
"
<query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'/></iq>
"
);
/* <iq xmlns="jabber:client" type="error" to="jordie.langen@chat.example.org/converse.js-11659299" from="myroom@conference.chat.example.org">
* <error type="cancel">
* <item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
...
...
@@ -339,7 +349,7 @@
*/
var
stanza
=
$iq
({
'
type
'
:
'
error
'
,
'
id
'
:
IQ_
id
,
'
id
'
:
id
,
'
from
'
:
view
.
model
.
get
(
'
jid
'
),
'
to
'
:
_converse
.
connection
.
jid
}).
c
(
'
error
'
,
{
'
type
'
:
'
cancel
'
})
...
...
@@ -1248,6 +1258,7 @@
null
,
[
'
rosterGroupsFetched
'
],
{},
function
(
done
,
_converse
)
{
var
IQ_stanzas
=
_converse
.
connection
.
IQ_stanzas
;
var
sent_IQ
,
IQ_id
;
var
sendIQ
=
_converse
.
connection
.
sendIQ
;
spyOn
(
_converse
.
connection
,
'
sendIQ
'
).
and
.
callFake
(
function
(
iq
,
callback
,
errback
)
{
...
...
@@ -1284,11 +1295,19 @@
*/
test_utils
.
waitUntil
(
function
()
{
return
sent_IQ
.
toLocaleString
()
===
"
<iq to='lounge@localhost' from='dummy@localhost/resource'
"
+
"
type='get' xmlns='jabber:client' id='
"
+
IQ_id
+
"
'>
"
+
"
<query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'/></iq>
"
;
return
_
.
filter
(
IQ_stanzas
,
function
(
iq
)
{
return
iq
.
nodeTree
.
querySelector
(
'
query[node="x-roomuser-item"]
'
);
}).
length
>
0
;
},
300
).
then
(
function
()
{
const
iq
=
_
.
filter
(
IQ_stanzas
,
function
(
iq
)
{
return
iq
.
nodeTree
.
querySelector
(
`query[node="x-roomuser-item"]`
);
}).
pop
();
const
id
=
iq
.
nodeTree
.
getAttribute
(
'
id
'
);
expect
(
iq
.
toLocaleString
()).
toBe
(
"
<iq to='lounge@localhost' from='dummy@localhost/resource'
"
+
"
type='get' xmlns='jabber:client' id='
"
+
id
+
"
'>
"
+
"
<query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'/></iq>
"
);
/* <iq from='coven@chat.shakespeare.lit'
* id='getnick1'
* to='hag66@shakespeare.lit/pda'
...
...
src/converse-chatboxes.js
View file @
5136b0c1
...
...
@@ -449,10 +449,11 @@
* based on the identified message stanza.
*/
const
attrs
=
this
.
getMessageAttributesFromStanza
.
apply
(
this
,
arguments
)
if
(
u
.
isOnlyChatStateNotification
(
attrs
)
&&
attrs
.
delayed
)
{
const
is_csn
=
u
.
isOnlyChatStateNotification
(
attrs
);
if
(
is_csn
&&
attrs
.
delayed
)
{
// No need showing old CSNs
return
;
}
else
if
(
!
attrs
.
file
&&
!
attrs
.
message
&&
!
attrs
.
oob_url
&&
attrs
.
type
!==
'
error
'
)
{
}
else
if
(
!
is_csn
&&
!
attrs
.
file
&&
!
attrs
.
message
&&
!
attrs
.
oob_url
&&
attrs
.
type
!==
'
error
'
)
{
// TODO: handle <subject> messages (currently being done by ChatRoom)
return
;
}
else
{
...
...
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