mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 09:17:44 +00:00
make part and mms insertion a single transaction
fixes #3051 closes #3059 // FREEBIE
This commit is contained in:
parent
d0008b57b5
commit
26c4d746d2
@ -749,6 +749,8 @@ public class MmsDatabase extends MessagingDatabase {
|
||||
|
||||
contentValues.put(PART_COUNT, PartParser.getSupportedMediaPartCount(body));
|
||||
|
||||
db.beginTransaction();
|
||||
try {
|
||||
long messageId = db.insert(TABLE_NAME, null, contentValues);
|
||||
|
||||
addressDatabase.insertAddressesForId(messageId, headers);
|
||||
@ -756,8 +758,12 @@ public class MmsDatabase extends MessagingDatabase {
|
||||
|
||||
notifyConversationListeners(contentValues.getAsLong(THREAD_ID));
|
||||
DatabaseFactory.getThreadDatabase(context).update(contentValues.getAsLong(THREAD_ID));
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
return messageId;
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public boolean delete(long messageId) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user