kopia lustrzana https://github.com/ryukoposting/Signal-Android
Update thread after attachment downloads.
rodzic
4578c33968
commit
7cac62f3f2
|
@ -626,7 +626,10 @@ public class AttachmentDatabase extends Database {
|
|||
//noinspection ResultOfMethodCallIgnored
|
||||
dataInfo.file.delete();
|
||||
} else {
|
||||
notifyConversationListeners(DatabaseFactory.getMmsDatabase(context).getThreadIdForMessage(mmsId));
|
||||
long threadId = DatabaseFactory.getMmsDatabase(context).getThreadIdForMessage(mmsId);
|
||||
DatabaseFactory.getThreadDatabase(context).updateSnippetUriSilently(threadId, PartAuthority.getAttachmentDataUri(attachmentId));
|
||||
|
||||
notifyConversationListeners(threadId);
|
||||
notifyConversationListListeners();
|
||||
}
|
||||
|
||||
|
|
|
@ -226,6 +226,14 @@ public class ThreadDatabase extends Database {
|
|||
}
|
||||
}
|
||||
|
||||
public void updateSnippetUriSilently(long threadId, @Nullable Uri attachment) {
|
||||
ContentValues contentValues = new ContentValues();
|
||||
contentValues.put(SNIPPET_URI, attachment != null ? attachment.toString() : null);
|
||||
|
||||
SQLiteDatabase db = databaseHelper.getSignalWritableDatabase();
|
||||
db.update(TABLE_NAME, contentValues, ID_WHERE, SqlUtil.buildArgs(threadId));
|
||||
}
|
||||
|
||||
public void updateSnippet(long threadId, String snippet, @Nullable Uri attachment, long date, long type, boolean unarchive) {
|
||||
if (isSilentType(type)) {
|
||||
return;
|
||||
|
@ -242,7 +250,7 @@ public class ThreadDatabase extends Database {
|
|||
}
|
||||
|
||||
SQLiteDatabase db = databaseHelper.getSignalWritableDatabase();
|
||||
db.update(TABLE_NAME, contentValues, ID + " = ?", new String[] {threadId + ""});
|
||||
db.update(TABLE_NAME, contentValues, ID_WHERE, SqlUtil.buildArgs(threadId));
|
||||
notifyConversationListListeners();
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue