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
93c956ba
Commit
93c956ba
authored
Sep 13, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix. Should be && not ||
parent
0a3a6222
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
5 deletions
+45
-5
dist/converse.js
dist/converse.js
+2
-2
spec/push.js
spec/push.js
+1
-0
spec/room_registration.js
spec/room_registration.js
+40
-1
src/converse-muc.js
src/converse-muc.js
+2
-2
No files found.
dist/converse.js
View file @
93c956ba
...
...
@@ -70894,9 +70894,9 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
return err_msg;
}
const required_fields =
_.map(sizzle('field required', iq), 'parentElement'
);
const required_fields =
sizzle('field required', iq).map(f => f.parentElement
);
if (required_fields.length > 1
||
required_fields[0].getAttribute('var') !== 'muc#register_roomnick') {
if (required_fields.length > 1
&&
required_fields[0].getAttribute('var') !== 'muc#register_roomnick') {
return _converse.log(`Can't register the user register in the groupchat ${jid} due to the required fields`);
}
spec/push.js
View file @
93c956ba
...
...
@@ -60,6 +60,7 @@
it
(
"
can be enabled for a MUC domain
"
,
mock
.
initConverseWithPromises
(
null
,
[
'
rosterGroupsFetched
'
],
{
'
enable_muc_push
'
:
true
,
'
push_app_servers
'
:
[{
'
jid
'
:
'
push-5@client.example
'
,
'
node
'
:
'
yxs32uqsflafdk3iuqo
'
...
...
spec/room_registration.js
View file @
93c956ba
...
...
@@ -3,6 +3,7 @@
}
(
this
,
function
(
jasmine
,
mock
,
test_utils
)
{
const
_
=
converse
.
env
.
_
,
$iq
=
converse
.
env
.
$iq
,
$pres
=
converse
.
env
.
$pres
,
Strophe
=
converse
.
env
.
Strophe
,
sizzle
=
converse
.
env
.
sizzle
,
u
=
converse
.
env
.
utils
;
...
...
@@ -80,10 +81,48 @@
function
(
done
,
_converse
)
{
let
view
;
const
IQ_stanzas
=
_converse
.
connection
.
IQ_stanzas
;
const
room_jid
=
'
coven@chat.shakespeare.lit
'
;
test_utils
.
openAndEnterChatRoom
(
_converse
,
'
coven
'
,
'
chat.shakespeare.lit
'
,
'
romeo
'
)
_converse
.
api
.
rooms
.
open
(
room_jid
,
{
'
nick
'
:
'
romeo
'
}
)
.
then
(()
=>
{
return
test_utils
.
waitUntil
(()
=>
_
.
get
(
_
.
filter
(
IQ_stanzas
,
iq
=>
iq
.
nodeTree
.
querySelector
(
`iq[to="
${
room_jid
}
"] query[xmlns="http://jabber.org/protocol/disco#info"]`
)).
pop
(),
'
nodeTree
'
));
}).
then
(
stanza
=>
{
const
features_stanza
=
$iq
({
'
from
'
:
room_jid
,
'
id
'
:
stanza
.
getAttribute
(
'
id
'
),
'
to
'
:
'
dummy@localhost/desktop
'
,
'
type
'
:
'
result
'
}).
c
(
'
query
'
,
{
'
xmlns
'
:
'
http://jabber.org/protocol/disco#info
'
})
.
c
(
'
identity
'
,
{
'
category
'
:
'
conference
'
,
'
name
'
:
'
A Dark Cave
'
,
'
type
'
:
'
text
'
}).
up
()
.
c
(
'
feature
'
,
{
'
var
'
:
'
http://jabber.org/protocol/muc
'
}).
up
()
.
c
(
'
feature
'
,
{
'
var
'
:
'
jabber:iq:register
'
});
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
features_stanza
));
view
=
_converse
.
chatboxviews
.
get
(
'
coven@chat.shakespeare.lit
'
);
return
test_utils
.
waitUntil
(()
=>
(
view
.
model
.
get
(
'
connection_status
'
)
===
converse
.
ROOMSTATUS
.
CONNECTING
));
}).
then
(
stanza
=>
{
// The user has just entered the room (because join was called)
// and receives their own presence from the server.
// See example 24: http://xmpp.org/extensions/xep-0045.html#enter-pres
const
presence
=
$pres
({
to
:
_converse
.
connection
.
jid
,
from
:
room_jid
,
id
:
u
.
getUniqueId
()
}).
c
(
'
x
'
).
attrs
({
xmlns
:
'
http://jabber.org/protocol/muc#user
'
})
.
c
(
'
item
'
).
attrs
({
affiliation
:
'
owner
'
,
jid
:
_converse
.
bare_jid
,
role
:
'
moderator
'
}).
up
()
.
c
(
'
status
'
).
attrs
({
code
:
'
110
'
});
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
presence
));
return
test_utils
.
waitUntil
(()
=>
_
.
get
(
_
.
filter
(
_converse
.
connection
.
IQ_stanzas
,
iq
=>
sizzle
(
`iq[to="coven@chat.shakespeare.lit"][type="get"] query[xmlns="jabber:iq:register"]`
,
iq
.
nodeTree
).
length
...
...
src/converse-muc.js
View file @
93c956ba
...
...
@@ -836,8 +836,8 @@
_converse
.
log
(
e
,
Strophe
.
LogLevel
.
ERROR
);
return
err_msg
;
}
const
required_fields
=
_
.
map
(
sizzle
(
'
field required
'
,
iq
),
'
parentElement
'
);
if
(
required_fields
.
length
>
1
||
required_fields
[
0
].
getAttribute
(
'
var
'
)
!==
'
muc#register_roomnick
'
)
{
const
required_fields
=
sizzle
(
'
field required
'
,
iq
).
map
(
f
=>
f
.
parentElement
);
if
(
required_fields
.
length
>
1
&&
required_fields
[
0
].
getAttribute
(
'
var
'
)
!==
'
muc#register_roomnick
'
)
{
return
_converse
.
log
(
`Can't register the user register in the groupchat
${
jid
}
due to the required fields`
);
}
try
{
...
...
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