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
3fc6f7fa
Commit
3fc6f7fa
authored
Sep 25, 2020
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #1924
parent
3a88831b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
14 deletions
+16
-14
CHANGES.md
CHANGES.md
+1
-0
src/components/adhoc-commands.js
src/components/adhoc-commands.js
+4
-3
src/converse-muc-views.js
src/converse-muc-views.js
+3
-4
src/converse-register.js
src/converse-register.js
+3
-1
src/headless/utils/form.js
src/headless/utils/form.js
+5
-6
No files found.
CHANGES.md
View file @
3fc6f7fa
...
@@ -19,6 +19,7 @@ Soon we'll deprecate the latter, so prepare now.
...
@@ -19,6 +19,7 @@ Soon we'll deprecate the latter, so prepare now.
and
[
muc_roomid_policy_hint
](
https://conversejs.org/docs/html/configuration.html#muc-roomid-policy-hint
)
and
[
muc_roomid_policy_hint
](
https://conversejs.org/docs/html/configuration.html#muc-roomid-policy-hint
)
-
#1826: A user can now add himself as a contact
-
#1826: A user can now add himself as a contact
-
#1839: Headline messages are shown in controlbox
-
#1839: Headline messages are shown in controlbox
-
#1924: Configuring an ejabberd room fails
-
#1896: Don't send receipts for messages fetched from the archive
-
#1896: Don't send receipts for messages fetched from the archive
-
#1937: Editing a message removes the mentions highlight
-
#1937: Editing a message removes the mentions highlight
-
#1963: Mentions are visually incorrect when used in message replies
-
#1963: Mentions are visually incorrect when used in message replies
...
...
src/components/adhoc-commands.js
View file @
3fc6f7fa
...
@@ -210,9 +210,10 @@ export default class AdHocCommands extends CustomElement {
...
@@ -210,9 +210,10 @@ export default class AdHocCommands extends CustomElement {
const
cmd
=
this
.
commands
.
filter
(
c
=>
c
.
node
===
node
)[
0
];
const
cmd
=
this
.
commands
.
filter
(
c
=>
c
.
node
===
node
)[
0
];
const
inputs
=
sizzle
(
'
:input:not([type=button]):not([type=submit])
'
,
ev
.
target
);
const
inputs
=
sizzle
(
'
:input:not([type=button]):not([type=submit])
'
,
ev
.
target
);
const
config
A
rray
=
inputs
const
config
_a
rray
=
inputs
.
filter
(
i
=>
!
[
'
command_jid
'
,
'
command_node
'
].
includes
(
i
.
getAttribute
(
'
name
'
)))
.
filter
(
i
=>
!
[
'
command_jid
'
,
'
command_node
'
].
includes
(
i
.
getAttribute
(
'
name
'
)))
.
map
(
u
.
webForm2xForm
);
.
map
(
u
.
webForm2xForm
)
.
filter
(
n
=>
n
);
const
iq
=
$iq
({
to
:
jid
,
type
:
"
set
"
})
const
iq
=
$iq
({
to
:
jid
,
type
:
"
set
"
})
.
c
(
"
command
"
,
{
.
c
(
"
command
"
,
{
...
@@ -220,7 +221,7 @@ export default class AdHocCommands extends CustomElement {
...
@@ -220,7 +221,7 @@ export default class AdHocCommands extends CustomElement {
'
node
'
:
cmd
.
node
,
'
node
'
:
cmd
.
node
,
'
xmlns
'
:
Strophe
.
NS
.
ADHOC
'
xmlns
'
:
Strophe
.
NS
.
ADHOC
}).
c
(
"
x
"
,
{
xmlns
:
Strophe
.
NS
.
XFORM
,
type
:
"
submit
"
});
}).
c
(
"
x
"
,
{
xmlns
:
Strophe
.
NS
.
XFORM
,
type
:
"
submit
"
});
config
A
rray
.
forEach
(
node
=>
iq
.
cnode
(
node
).
up
());
config
_a
rray
.
forEach
(
node
=>
iq
.
cnode
(
node
).
up
());
let
result
;
let
result
;
try
{
try
{
...
...
src/converse-muc-views.js
View file @
3fc6f7fa
...
@@ -1088,7 +1088,6 @@ export const ChatRoomView = ChatBoxView.extend({
...
@@ -1088,7 +1088,6 @@ export const ChatRoomView = ChatBoxView.extend({
this
.
hideChatRoomContents
();
this
.
hideChatRoomContents
();
this
.
model
.
save
(
'
config_stanza
'
,
stanza
.
outerHTML
);
this
.
model
.
save
(
'
config_stanza
'
,
stanza
.
outerHTML
);
if
(
!
this
.
config_form
)
{
if
(
!
this
.
config_form
)
{
const
{
_converse
}
=
this
.
__super__
;
this
.
config_form
=
new
_converse
.
MUCConfigForm
({
this
.
config_form
=
new
_converse
.
MUCConfigForm
({
'
model
'
:
this
.
model
,
'
model
'
:
this
.
model
,
'
chatroomview
'
:
this
'
chatroomview
'
:
this
...
@@ -1511,15 +1510,15 @@ converse.plugins.add('converse-muc-views', {
...
@@ -1511,15 +1510,15 @@ converse.plugins.add('converse-muc-views', {
async
submitConfigForm
(
ev
)
{
async
submitConfigForm
(
ev
)
{
ev
.
preventDefault
();
ev
.
preventDefault
();
const
inputs
=
sizzle
(
'
:input:not([type=button]):not([type=submit])
'
,
ev
.
target
);
const
inputs
=
sizzle
(
'
:input:not([type=button]):not([type=submit])
'
,
ev
.
target
);
const
config
Array
=
inputs
.
map
(
u
.
webForm2xForm
);
const
config
_array
=
inputs
.
map
(
u
.
webForm2xForm
).
filter
(
f
=>
f
);
try
{
try
{
await
this
.
model
.
sendConfiguration
(
config
A
rray
);
await
this
.
model
.
sendConfiguration
(
config
_a
rray
);
}
catch
(
e
)
{
}
catch
(
e
)
{
log
.
error
(
e
);
log
.
error
(
e
);
const
message
=
const
message
=
__
(
"
Sorry, an error occurred while trying to submit the config form.
"
)
+
"
"
+
__
(
"
Sorry, an error occurred while trying to submit the config form.
"
)
+
"
"
+
__
(
"
Check your browser's developer console for details.
"
);
__
(
"
Check your browser's developer console for details.
"
);
this
.
model
.
createMessage
({
message
,
'
type
'
:
'
error
'
}
);
api
.
alert
(
'
error
'
,
__
(
'
Error
'
),
message
);
}
}
await
this
.
model
.
refreshDiscoInfo
();
await
this
.
model
.
refreshDiscoInfo
();
this
.
chatroomview
.
closeForm
();
this
.
chatroomview
.
closeForm
();
...
...
src/converse-register.js
View file @
3fc6f7fa
...
@@ -556,7 +556,9 @@ converse.plugins.add('converse-register', {
...
@@ -556,7 +556,9 @@ converse.plugins.add('converse-register', {
if
(
this
.
form_type
===
'
xform
'
)
{
if
(
this
.
form_type
===
'
xform
'
)
{
iq
.
c
(
"
x
"
,
{
xmlns
:
Strophe
.
NS
.
XFORM
,
type
:
'
submit
'
});
iq
.
c
(
"
x
"
,
{
xmlns
:
Strophe
.
NS
.
XFORM
,
type
:
'
submit
'
});
inputs
.
forEach
(
input
=>
iq
.
cnode
(
utils
.
webForm2xForm
(
input
)).
up
());
const
xml_nodes
=
inputs
.
map
(
i
=>
utils
.
webForm2xForm
(
i
)).
filter
(
n
=>
n
);
xml_nodes
.
forEach
(
n
=>
iq
.
cnode
(
n
).
up
());
}
else
{
}
else
{
inputs
.
forEach
(
input
=>
iq
.
c
(
input
.
getAttribute
(
'
name
'
),
{},
input
.
value
));
inputs
.
forEach
(
input
=>
iq
.
c
(
input
.
getAttribute
(
'
name
'
),
{},
input
.
value
));
}
}
...
...
src/headless/utils/form.js
View file @
3fc6f7fa
...
@@ -13,6 +13,10 @@ import u from "./core";
...
@@ -13,6 +13,10 @@ import u from "./core";
* @param { DOMElement } field - the field to convert
* @param { DOMElement } field - the field to convert
*/
*/
u
.
webForm2xForm
=
function
(
field
)
{
u
.
webForm2xForm
=
function
(
field
)
{
const
name
=
field
.
getAttribute
(
'
name
'
);
if
(
!
name
)
{
return
null
;
// See #1924
}
let
value
;
let
value
;
if
(
field
.
getAttribute
(
'
type
'
)
===
'
checkbox
'
)
{
if
(
field
.
getAttribute
(
'
type
'
)
===
'
checkbox
'
)
{
value
=
field
.
checked
&&
1
||
0
;
value
=
field
.
checked
&&
1
||
0
;
...
@@ -23,11 +27,6 @@ u.webForm2xForm = function (field) {
...
@@ -23,11 +27,6 @@ u.webForm2xForm = function (field) {
}
else
{
}
else
{
value
=
field
.
value
;
value
=
field
.
value
;
}
}
return
u
.
stringToNode
(
return
u
.
stringToNode
(
tpl_field
({
name
,
value
}));
tpl_field
({
'
name
'
:
field
.
getAttribute
(
'
name
'
),
'
value
'
:
value
})
);
};
};
export
default
u
;
export
default
u
;
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