Correctly display error when HTTP File Upload isn’t supported by the server.
This commit is contained in:
parent
0d4603d80d
commit
5cd7ccb3ef
13
dist/converse.js
vendored
13
dist/converse.js
vendored
|
@ -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"
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user