aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/services
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-06 15:34:08 +0200
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-06 15:34:08 +0200
commitc30bf75a5d77fab21480e04ce18b46d6b2826295 (patch)
treeb0eed8c7cf56483c90047eb92f53e18d9a1a6f51 /src/eu/siacs/conversations/services
parent9fc7a1b980863955a139193ded0fef5edfbad296 (diff)
gui for images
Diffstat (limited to 'src/eu/siacs/conversations/services')
-rw-r--r--src/eu/siacs/conversations/services/XmppConnectionService.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java
index 76e7d728..e8ec6f7f 100644
--- a/src/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/eu/siacs/conversations/services/XmppConnectionService.java
@@ -1,5 +1,6 @@
package eu.siacs.conversations.services;
+import java.io.File;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Collections;
@@ -60,6 +61,7 @@ import android.database.ContentObserver;
import android.database.DatabaseUtils;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
+import android.net.Uri;
import android.os.Binder;
import android.os.Bundle;
import android.os.IBinder;
@@ -387,6 +389,15 @@ public class XmppConnectionService extends Service {
return this.fileBackend;
}
+ public void attachImageToConversation(Conversation conversation, Uri uri) {
+ Message message = new Message(conversation, "", Message.ENCRYPTION_NONE);
+ message.setType(Message.TYPE_IMAGE);
+ File file = this.fileBackend.copyImageToPrivateStorage(message, uri);
+ Log.d(LOGTAG,"new file"+file.getAbsolutePath());
+ conversation.getMessages().add(message);
+ databaseBackend.createMessage(message);
+ }
+
protected Conversation findMuc(String name, Account account) {
for (Conversation conversation : this.conversations) {