aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/ui
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-10-15 22:08:13 +0200
committeriNPUTmice <daniel@gultsch.de>2014-10-15 22:08:13 +0200
commitf5019ba96647bd1c33153e6e9099d21dcf47bfa7 (patch)
tree5791e6832d3ad617f6e4a3fa3a6761a97d3dee8c /src/eu/siacs/conversations/ui
parent89cc4d12477e4c5593d10b69e0ed42cbaedfb190 (diff)
detect deleted files on start up. got rid of lagecy image provider for performance reasons. NOTE: this will prevent you to access images older than version 0.6
Diffstat (limited to 'src/eu/siacs/conversations/ui')
-rw-r--r--src/eu/siacs/conversations/ui/adapter/ConversationAdapter.java2
-rw-r--r--src/eu/siacs/conversations/ui/adapter/MessageAdapter.java18
2 files changed, 5 insertions, 15 deletions
diff --git a/src/eu/siacs/conversations/ui/adapter/ConversationAdapter.java b/src/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
index 6943a85c..bd37f7fc 100644
--- a/src/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
+++ b/src/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
@@ -92,6 +92,8 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
mLastMessage.setText(R.string.receiving_image);
} else if (d.getStatus() == Downloadable.STATUS_OFFER) {
mLastMessage.setText(R.string.image_offered_for_download);
+ } else if (d.getStatus() == Downloadable.STATUS_DELETED) {
+ mLastMessage.setText(R.string.image_file_deleted);
} else {
mLastMessage.setText("");
}
diff --git a/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java
index efb07292..24a824b3 100644
--- a/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java
+++ b/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java
@@ -1,7 +1,5 @@
package eu.siacs.conversations.ui.adapter;
-import java.net.MalformedURLException;
-import java.net.URL;
import java.util.HashMap;
import java.util.List;
@@ -476,6 +474,8 @@ public class MessageAdapter extends ArrayAdapter<Message> {
} else if (d != null
&& d.getStatus() == Downloadable.STATUS_CHECKING) {
displayInfoMessage(viewHolder, R.string.checking_image);
+ } else if (d != null && d.getStatus() == Downloadable.STATUS_DELETED) {
+ displayInfoMessage(viewHolder, R.string.image_file_deleted);
} else if (d != null && d.getStatus() == Downloadable.STATUS_OFFER) {
viewHolder.image.setVisibility(View.GONE);
viewHolder.messageBody.setVisibility(View.GONE);
@@ -531,19 +531,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
downloadable.start();
return true;
} else {
- ImageParams params = message.getImageParams();
- if (params.origin != null) {
- try {
- URL url = new URL(params.origin);
- activity.xmppConnectionService.getHttpConnectionManager()
- .createNewConnection(message, url);
- return true;
- } catch (MalformedURLException e) {
- return false;
- }
- } else {
- return false;
- }
+ return false;
}
}