Count non favorite answers only

pull/198/head
M66B 4 years ago
parent a5854d06f3
commit 31389e4808

@ -56,8 +56,9 @@ public interface DaoAnswer {
LiveData<List<EntityAnswer>> liveAnswers();
@Query("SELECT COUNT(*) FROM answer" +
" WHERE NOT hide")
Integer getAnswerCount();
" WHERE NOT hide" +
" AND (:favorite OR NOT favorite)")
Integer getAnswerCount(boolean favorite);
@Insert
long insertAnswer(EntityAnswer answer);

@ -2445,7 +2445,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
if (message == null)
return result;
args.putInt("answers", db.answer().getAnswerCount());
args.putInt("answers", db.answer().getAnswerCount(false));
result.identities = db.identity().getComposableIdentities(message.account);
result.answers = db.answer().getAnswersByFavorite(true);
@ -2469,7 +2469,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
Address[] recipients = message.getAllRecipients(data.identities, message.account);
int answers = args.getInt("answers");
int answers = args.getInt("answers"); // Non favorite
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean experiments = prefs.getBoolean("experiments", false);

Loading…
Cancel
Save