Skip to content

Commit

Permalink
Synchronize read receipt configuration from splash screen
Browse files Browse the repository at this point in the history
// FREEBIE
  • Loading branch information
moxie0 committed Oct 2, 2017
1 parent e388524 commit b3f0888
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import android.view.ViewGroup;
import android.widget.TextView;

import org.thoughtcrime.securesms.jobs.MultiDeviceReadReceiptUpdateJob;
import org.thoughtcrime.securesms.util.TextSecurePreferences;
import org.thoughtcrime.securesms.util.ViewUtil;

Expand All @@ -34,7 +35,12 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
SwitchCompat preference = ViewUtil.findById(v, R.id.preference);

preference.setChecked(TextSecurePreferences.isReadReceiptsEnabled(getContext()));
preference.setOnCheckedChangeListener((buttonView, isChecked) -> TextSecurePreferences.setReadReceiptsEnabled(getContext(), isChecked));
preference.setOnCheckedChangeListener((buttonView, isChecked) -> {
TextSecurePreferences.setReadReceiptsEnabled(getContext(), isChecked);
ApplicationContext.getInstance(getContext())
.getJobManager()
.add(new MultiDeviceReadReceiptUpdateJob(getContext(), isChecked));
});

return v;
}
Expand Down

0 comments on commit b3f0888

Please sign in to comment.