mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-08 14:11:07 +01:00
Fix HTTP File Upload's SlotRequest
Fixes SMACK-774. Thanks to Nathan Freitas for reporting this.
This commit is contained in:
parent
e87c463927
commit
858ba3f82a
3 changed files with 25 additions and 16 deletions
|
|
@ -32,9 +32,9 @@ public class SlotRequest extends IQ {
|
|||
public static final String ELEMENT = "request";
|
||||
public static final String NAMESPACE = HttpFileUploadManager.NAMESPACE;
|
||||
|
||||
private final String filename;
|
||||
private final long size;
|
||||
private final String contentType;
|
||||
protected final String filename;
|
||||
protected final long size;
|
||||
protected final String contentType;
|
||||
|
||||
public SlotRequest(DomainBareJid uploadServiceAddress, String filename, long size) {
|
||||
this(uploadServiceAddress, filename, size, null);
|
||||
|
|
@ -82,10 +82,10 @@ public class SlotRequest extends IQ {
|
|||
|
||||
@Override
|
||||
protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) {
|
||||
xml.rightAngleBracket();
|
||||
xml.element("filename", filename);
|
||||
xml.element("size", String.valueOf(size));
|
||||
xml.optElement("content-type", contentType);
|
||||
xml.attribute("filename", filename);
|
||||
xml.attribute("size", String.valueOf(size));
|
||||
xml.optAttribute("content-type", contentType);
|
||||
xml.setEmptyElement();
|
||||
return xml;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,4 +40,13 @@ public class SlotRequest_V0_2 extends SlotRequest {
|
|||
public SlotRequest_V0_2(DomainBareJid uploadServiceAddress, String filename, long size, String contentType) {
|
||||
super(uploadServiceAddress, filename, size, contentType, NAMESPACE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) {
|
||||
xml.rightAngleBracket();
|
||||
xml.element("filename", filename);
|
||||
xml.element("size", String.valueOf(size));
|
||||
xml.optElement("content-type", contentType);
|
||||
return xml;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue