Update thread timestamp on draft creation.

Fixes #1055
Closes #2909

// FREEBIE
This commit is contained in:
Rhodey Orbits 2015-04-06 13:44:18 -07:00 committed by Moxie Marlinspike
parent e4e24f7ae5
commit f5724795cf
2 changed files with 4 additions and 2 deletions

View File

@ -895,7 +895,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
if (threadId == -1) threadId = threadDatabase.getThreadIdFor(getRecipients(), thisDistributionType); if (threadId == -1) threadId = threadDatabase.getThreadIdFor(getRecipients(), thisDistributionType);
draftDatabase.insertDrafts(new MasterCipher(thisMasterSecret), threadId, drafts); draftDatabase.insertDrafts(new MasterCipher(thisMasterSecret), threadId, drafts);
threadDatabase.updateSnippet(threadId, drafts.getSnippet(ConversationActivity.this), Types.BASE_DRAFT_TYPE); threadDatabase.updateSnippet(threadId, drafts.getSnippet(ConversationActivity.this), System.currentTimeMillis(), Types.BASE_DRAFT_TYPE);
} else if (threadId > 0) { } else if (threadId > 0) {
threadDatabase.update(threadId); threadDatabase.update(threadId);
} }

View File

@ -130,8 +130,10 @@ public class ThreadDatabase extends Database {
notifyConversationListListeners(); notifyConversationListListeners();
} }
public void updateSnippet(long threadId, String snippet, long type) { public void updateSnippet(long threadId, String snippet, long date, long type) {
ContentValues contentValues = new ContentValues(3); ContentValues contentValues = new ContentValues(3);
contentValues.put(DATE, date - date % 1000);
contentValues.put(SNIPPET, snippet); contentValues.put(SNIPPET, snippet);
contentValues.put(SNIPPET_TYPE, type); contentValues.put(SNIPPET_TYPE, type);
SQLiteDatabase db = databaseHelper.getWritableDatabase(); SQLiteDatabase db = databaseHelper.getWritableDatabase();