|
@@ -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');
|
|
|
|