make image download message to type=image only after completion
This commit is contained in:
parent
88d88ffb7b
commit
45e0f99b88
|
@ -62,8 +62,7 @@ public class HttpConnection implements Downloadable {
|
||||||
public void cancel() {
|
public void cancel() {
|
||||||
mHttpConnectionManager.finishConnection(this);
|
mHttpConnectionManager.finishConnection(this);
|
||||||
message.setDownloadable(null);
|
message.setDownloadable(null);
|
||||||
message.setBody(mUrl.toString());
|
mXmppConnectionService.updateConversationUi();
|
||||||
mXmppConnectionService.updateMessage(message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void finish() {
|
private void finish() {
|
||||||
|
@ -91,7 +90,6 @@ public class HttpConnection implements Downloadable {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
file.setExpectedSize(size);
|
file.setExpectedSize(size);
|
||||||
message.setType(Message.TYPE_IMAGE);
|
|
||||||
if (size <= mHttpConnectionManager.getAutoAcceptFileSize() && mAutostart) {
|
if (size <= mHttpConnectionManager.getAutoAcceptFileSize() && mAutostart) {
|
||||||
start();
|
start();
|
||||||
} else {
|
} else {
|
||||||
|
@ -159,6 +157,7 @@ public class HttpConnection implements Downloadable {
|
||||||
int imageWidth = options.outWidth;
|
int imageWidth = options.outWidth;
|
||||||
message.setBody(mUrl.toString() + "," + file.getSize() + ','
|
message.setBody(mUrl.toString() + "," + file.getSize() + ','
|
||||||
+ imageWidth + ',' + imageHeight);
|
+ imageWidth + ',' + imageHeight);
|
||||||
|
message.setType(Message.TYPE_IMAGE);
|
||||||
mXmppConnectionService.updateMessage(message);
|
mXmppConnectionService.updateMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue