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
5cd7ccb3
Commit
5cd7ccb3
authored
Nov 02, 2018
by
Emmanuel Gil Peyrot
Committed by
JC Brand
Nov 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly display error when HTTP File Upload isn’t supported by the server.
parent
0d4603d8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
dist/converse.js
dist/converse.js
+11
-2
src/headless/converse-chatboxes.js
src/headless/converse-chatboxes.js
+11
-2
No files found.
dist/converse.js
View file @
5cd7ccb3
...
...
@@ -70983,8 +70983,17 @@ _converse_core__WEBPACK_IMPORTED_MODULE_2__["default"].plugins.add('converse-cha
async sendFiles(files) {
const result = await _converse.api.disco.supports(Strophe.NS.HTTPUPLOAD, _converse.domain),
item = result.pop(),
data = item.dataforms.where({
item = result.pop();
if (!item) {
this.messages.create({
'message': __("Sorry, looks like file upload is not supported by your server."),
'type': 'error'
});
return;
}
const data = item.dataforms.where({
'FORM_TYPE': {
'value': Strophe.NS.HTTPUPLOAD,
'type': "hidden"
src/headless/converse-chatboxes.js
View file @
5cd7ccb3
...
...
@@ -418,8 +418,17 @@ converse.plugins.add('converse-chatboxes', {
async
sendFiles
(
files
)
{
const
result
=
await
_converse
.
api
.
disco
.
supports
(
Strophe
.
NS
.
HTTPUPLOAD
,
_converse
.
domain
),
item
=
result
.
pop
(),
data
=
item
.
dataforms
.
where
({
'
FORM_TYPE
'
:
{
'
value
'
:
Strophe
.
NS
.
HTTPUPLOAD
,
'
type
'
:
"
hidden
"
}}).
pop
(),
item
=
result
.
pop
();
if
(
!
item
)
{
this
.
messages
.
create
({
'
message
'
:
__
(
"
Sorry, looks like file upload is not supported by your server.
"
),
'
type
'
:
'
error
'
});
return
;
}
const
data
=
item
.
dataforms
.
where
({
'
FORM_TYPE
'
:
{
'
value
'
:
Strophe
.
NS
.
HTTPUPLOAD
,
'
type
'
:
"
hidden
"
}}).
pop
(),
max_file_size
=
window
.
parseInt
(
_
.
get
(
data
,
'
attributes.max-file-size.value
'
)),
slot_request_url
=
_
.
get
(
item
,
'
id
'
);
...
...
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