aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/persistance
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-07-09 22:58:50 +0200
committerChristian Schneppe <christian@pix-art.de>2018-07-09 22:58:50 +0200
commit4f612fc9bc50e8665c11cab59f502ace854a4a9f (patch)
tree04d83e80e610cba6ffb55da8ad2b1fe7b2d44c91 /src/main/java/de/pixart/messenger/persistance
parent0a979ca94cbfdb81196e22aebe376afa35ed09b5 (diff)
integrated locally message deletion from #208
thanks @acw81
Diffstat (limited to 'src/main/java/de/pixart/messenger/persistance')
-rw-r--r--src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java b/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java
index 62b15c816..94710b86e 100644
--- a/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java
+++ b/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java
@@ -917,6 +917,17 @@ public class DatabaseBackend extends SQLiteOpenHelper {
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": persisted roster in " + duration + "ms");
}
+ public void deleteMessageInConversation(Message message) {
+ long start = SystemClock.elapsedRealtime();
+ final SQLiteDatabase db = this.getWritableDatabase();
+ db.beginTransaction();
+ String[] args = {message.getUuid()};
+ db.delete("messages_index", "uuid =?", args);
+ db.setTransactionSuccessful();
+ db.endTransaction();
+ Log.d(Config.LOGTAG, "deleted single message in " + (SystemClock.elapsedRealtime() - start) + "ms");
+ }
+
public void deleteMessagesInConversation(Conversation conversation) {
long start = SystemClock.elapsedRealtime();
final SQLiteDatabase db = this.getWritableDatabase();