Skip to content

Commit

Permalink
Mark as unread: Add the possibility to mark a thread as unread, as re…
Browse files Browse the repository at this point in the history
…quested per Issue signalapp#685
  • Loading branch information
lImbus committed Apr 24, 2014
1 parent 629baef commit 376b228
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions res/menu/conversation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@
android:id="@+id/menu_delete_thread"
android:icon="@android:drawable/ic_menu_delete" />

<item android:title="@string/conversation__menu_unread_thread"
android:id="@+id/menu_unread_thread"
android:icon="@android:drawable/ic_dialog_email" />

</menu>
1 change: 1 addition & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@
<string name="conversation__menu_leave_group">Leave Group</string>
<string name="conversation__menu_add_contact_info">Add contact info</string>
<string name="conversation__menu_delete_thread">Delete thread</string>
<string name="conversation__menu_unread_thread">Mark thread as unread</string>

<!-- conversation_group_options -->
<string name="convesation_group_options__recipients_list">Recipients list</string>
Expand Down
5 changes: 5 additions & 0 deletions src/org/thoughtcrime/securesms/ConversationActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_call: handleDial(getRecipients().getPrimaryRecipient()); return true;
case R.id.menu_delete_thread: handleDeleteThread(); return true;
case R.id.menu_unread_thread: handleUnreadThread(); return true;
case R.id.menu_add_contact_info: handleAddContactInfo(); return true;
case R.id.menu_add_attachment: handleAddAttachment(); return true;
case R.id.menu_start_secure_session: handleStartSecureSession(); return true;
Expand Down Expand Up @@ -538,6 +539,10 @@ public void onClick(DialogInterface dialog, int which) {
builder.show();
}

private void handleUnreadThread() {
DatabaseFactory.getThreadDatabase(ConversationActivity.this).setUnread(threadId);
}

private void handleAddContactInfo() {
Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
startActivityForResult(intent, PICK_CONTACT_INFO);
Expand Down

0 comments on commit 376b228

Please sign in to comment.