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
cc98cea0
Commit
cc98cea0
authored
Jun 30, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix failing tests by waiting appropriately
parent
9a60b5bb
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
158 additions
and
151 deletions
+158
-151
dist/converse.js
dist/converse.js
+1
-1
spec/bookmarks.js
spec/bookmarks.js
+33
-29
spec/chatroom.js
spec/chatroom.js
+122
-120
src/converse-muc.js
src/converse-muc.js
+2
-1
No files found.
dist/converse.js
View file @
cc98cea0
...
@@ -78646,7 +78646,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
...
@@ -78646,7 +78646,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
if (_converse.allow_muc_invitations) {
if (_converse.allow_muc_invitations) {
const registerDirectInvitationHandler = function registerDirectInvitationHandler() {
const registerDirectInvitationHandler = function registerDirectInvitationHandler() {
_converse.connection.addHandler(
function (message)
{
_converse.connection.addHandler(
message =>
{
_converse.onDirectMUCInvitation(message);
_converse.onDirectMUCInvitation(message);
return true;
return true;
spec/bookmarks.js
View file @
cc98cea0
...
@@ -377,14 +377,14 @@
...
@@ -377,14 +377,14 @@
[
'
http://jabber.org/protocol/pubsub#publish-options
'
]
[
'
http://jabber.org/protocol/pubsub#publish-options
'
]
).
then
(
function
()
{
).
then
(
function
()
{
/* Client requests all items
/* Client requests all items
* -------------------------
* -------------------------
*
*
* <iq from='juliet@capulet.lit/randomID' type='get' id='retrieve1'>
* <iq from='juliet@capulet.lit/randomID' type='get' id='retrieve1'>
* <pubsub xmlns='http://jabber.org/protocol/pubsub'>
* <pubsub xmlns='http://jabber.org/protocol/pubsub'>
* <items node='storage:bookmarks'/>
* <items node='storage:bookmarks'/>
* </pubsub>
* </pubsub>
* </iq>
* </iq>
*/
*/
var
IQ_id
;
var
IQ_id
;
expect
(
_
.
filter
(
_converse
.
connection
.
send
.
calls
.
all
(),
function
(
call
)
{
expect
(
_
.
filter
(
_converse
.
connection
.
send
.
calls
.
all
(),
function
(
call
)
{
var
stanza
=
call
.
args
[
0
];
var
stanza
=
call
.
args
[
0
];
...
@@ -407,27 +407,29 @@
...
@@ -407,27 +407,29 @@
}).
length
).
toBe
(
1
);
}).
length
).
toBe
(
1
);
/*
/*
* Server returns all items
* Server returns all items
* ------------------------
* ------------------------
* <iq type='result'
* <iq type='result'
* to='juliet@capulet.lit/randomID'
* to='juliet@capulet.lit/randomID'
* id='retrieve1'>
* id='retrieve1'>
* <pubsub xmlns='http://jabber.org/protocol/pubsub'>
* <pubsub xmlns='http://jabber.org/protocol/pubsub'>
* <items node='storage:bookmarks'>
* <items node='storage:bookmarks'>
* <item id='current'>
* <item id='current'>
* <storage xmlns='storage:bookmarks'>
* <storage xmlns='storage:bookmarks'>
* <conference name='The Play's the Thing'
* <conference name='The Play's the Thing'
* autojoin='true'
* autojoin='true'
* jid='theplay@conference.shakespeare.lit'>
* jid='theplay@conference.shakespeare.lit'>
* <nick>JC</nick>
* <nick>JC</nick>
* </conference>
* </conference>
* </storage>
* </storage>
* </item>
* </item>
* </items>
* </items>
* </pubsub>
* </pubsub>
* </iq>
* </iq>
*/
*/
expect
(
_converse
.
bookmarks
.
models
.
length
).
toBe
(
0
);
expect
(
_converse
.
bookmarks
.
models
.
length
).
toBe
(
0
);
spyOn
(
_converse
.
bookmarks
,
'
onBookmarksReceived
'
).
and
.
callThrough
();
var
stanza
=
$iq
({
'
to
'
:
_converse
.
connection
.
jid
,
'
type
'
:
'
result
'
,
'
id
'
:
IQ_id
})
var
stanza
=
$iq
({
'
to
'
:
_converse
.
connection
.
jid
,
'
type
'
:
'
result
'
,
'
id
'
:
IQ_id
})
.
c
(
'
pubsub
'
,
{
'
xmlns
'
:
Strophe
.
NS
.
PUBSUB
})
.
c
(
'
pubsub
'
,
{
'
xmlns
'
:
Strophe
.
NS
.
PUBSUB
})
.
c
(
'
items
'
,
{
'
node
'
:
'
storage:bookmarks
'
})
.
c
(
'
items
'
,
{
'
node
'
:
'
storage:bookmarks
'
})
...
@@ -444,11 +446,13 @@
...
@@ -444,11 +446,13 @@
'
jid
'
:
'
another@conference.shakespeare.lit
'
'
jid
'
:
'
another@conference.shakespeare.lit
'
});
// Purposefully exclude the <nick> element to test #1043
});
// Purposefully exclude the <nick> element to test #1043
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
stanza
));
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
stanza
));
return
test_utils
.
waitUntil
(()
=>
_converse
.
bookmarks
.
onBookmarksReceived
.
calls
.
count
(),
300
)
}).
then
(()
=>
{
expect
(
_converse
.
bookmarks
.
models
.
length
).
toBe
(
2
);
expect
(
_converse
.
bookmarks
.
models
.
length
).
toBe
(
2
);
expect
(
_converse
.
bookmarks
.
findWhere
({
'
jid
'
:
'
theplay@conference.shakespeare.lit
'
}).
get
(
'
autojoin
'
)).
toBe
(
true
);
expect
(
_converse
.
bookmarks
.
findWhere
({
'
jid
'
:
'
theplay@conference.shakespeare.lit
'
}).
get
(
'
autojoin
'
)).
toBe
(
true
);
expect
(
_converse
.
bookmarks
.
findWhere
({
'
jid
'
:
'
another@conference.shakespeare.lit
'
}).
get
(
'
autojoin
'
)).
toBe
(
false
);
expect
(
_converse
.
bookmarks
.
findWhere
({
'
jid
'
:
'
another@conference.shakespeare.lit
'
}).
get
(
'
autojoin
'
)).
toBe
(
false
);
done
();
done
();
});
})
.
catch
(
_
.
partial
(
console
.
error
,
_
))
;
}));
}));
describe
(
"
The rooms panel
"
,
function
()
{
describe
(
"
The rooms panel
"
,
function
()
{
...
...
spec/chatroom.js
View file @
cc98cea0
This diff is collapsed.
Click to expand it.
src/converse-muc.js
View file @
cc98cea0
...
@@ -403,6 +403,7 @@
...
@@ -403,6 +403,7 @@
};
};
if
(
reason
!==
null
)
{
attrs
.
reason
=
reason
;
}
if
(
reason
!==
null
)
{
attrs
.
reason
=
reason
;
}
if
(
this
.
get
(
'
password
'
))
{
attrs
.
password
=
this
.
get
(
'
password
'
);
}
if
(
this
.
get
(
'
password
'
))
{
attrs
.
password
=
this
.
get
(
'
password
'
);
}
const
invitation
=
$msg
({
const
invitation
=
$msg
({
from
:
_converse
.
connection
.
jid
,
from
:
_converse
.
connection
.
jid
,
to
:
recipient
,
to
:
recipient
,
...
@@ -1126,7 +1127,7 @@
...
@@ -1126,7 +1127,7 @@
if
(
_converse
.
allow_muc_invitations
)
{
if
(
_converse
.
allow_muc_invitations
)
{
const
registerDirectInvitationHandler
=
function
()
{
const
registerDirectInvitationHandler
=
function
()
{
_converse
.
connection
.
addHandler
(
_converse
.
connection
.
addHandler
(
function
(
message
)
{
(
message
)
=>
{
_converse
.
onDirectMUCInvitation
(
message
);
_converse
.
onDirectMUCInvitation
(
message
);
return
true
;
return
true
;
},
'
jabber:x:conference
'
,
'
message
'
);
},
'
jabber:x:conference
'
,
'
message
'
);
...
...
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