mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Move mute handling into ConversationViewModel.
This commit is contained in:
committed by
Greyson Parrelli
parent
2a43ffad4f
commit
30f6faf3d7
@@ -1088,16 +1088,7 @@ public class ConversationParentFragment extends Fragment
|
||||
|
||||
@Override
|
||||
public void handleMuteNotifications() {
|
||||
MuteDialog.show(requireActivity(), until -> {
|
||||
new AsyncTask<Void, Void, Void>() {
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
SignalDatabase.recipients().setMuted(recipient.getId(), until);
|
||||
|
||||
return null;
|
||||
}
|
||||
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
});
|
||||
MuteDialog.show(requireActivity(), viewModel::muteConversation);
|
||||
}
|
||||
|
||||
private void handleStoryRingClick() {
|
||||
|
||||
@@ -212,4 +212,8 @@ class ConversationRepository {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setConversationMuted(@NonNull RecipientId recipientId, long until) {
|
||||
SignalExecutors.BOUNDED.execute(() -> SignalDatabase.recipients().setMuted(recipientId, until));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,6 +338,10 @@ public class ConversationViewModel extends ViewModel {
|
||||
return conversationStateStore.getState().getSecurityInfo().isPushAvailable();
|
||||
}
|
||||
|
||||
void muteConversation(long until) {
|
||||
conversationRepository.setConversationMuted(args.getRecipientId(), until);
|
||||
}
|
||||
|
||||
@NonNull ConversationState getConversationStateSnapshot() {
|
||||
return conversationStateStore.getState();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user