mirror of https://github.com/M66B/FairEmail.git
Count non favorite answers only
This commit is contained in:
parent
a5854d06f3
commit
31389e4808
|
@ -56,8 +56,9 @@ public interface DaoAnswer {
|
||||||
LiveData<List<EntityAnswer>> liveAnswers();
|
LiveData<List<EntityAnswer>> liveAnswers();
|
||||||
|
|
||||||
@Query("SELECT COUNT(*) FROM answer" +
|
@Query("SELECT COUNT(*) FROM answer" +
|
||||||
" WHERE NOT hide")
|
" WHERE NOT hide" +
|
||||||
Integer getAnswerCount();
|
" AND (:favorite OR NOT favorite)")
|
||||||
|
Integer getAnswerCount(boolean favorite);
|
||||||
|
|
||||||
@Insert
|
@Insert
|
||||||
long insertAnswer(EntityAnswer answer);
|
long insertAnswer(EntityAnswer answer);
|
||||||
|
|
|
@ -2445,7 +2445,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||||
if (message == null)
|
if (message == null)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
args.putInt("answers", db.answer().getAnswerCount());
|
args.putInt("answers", db.answer().getAnswerCount(false));
|
||||||
|
|
||||||
result.identities = db.identity().getComposableIdentities(message.account);
|
result.identities = db.identity().getComposableIdentities(message.account);
|
||||||
result.answers = db.answer().getAnswersByFavorite(true);
|
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);
|
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);
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
boolean experiments = prefs.getBoolean("experiments", false);
|
boolean experiments = prefs.getBoolean("experiments", false);
|
||||||
|
|
Loading…
Reference in New Issue