package com.moac.android.opensecretsanta.util;

import com.moac.android.opensecretsanta.database.DatabaseManager;
import com.moac.android.opensecretsanta.model.ContactMode;
import com.moac.android.opensecretsanta.model.Member;

import java.util.List;

public class NotifyUtils {

    public static boolean containsSendableEntry(List<Member> _members) {
        for(Member member : _members) {
            if(member.getContactMode().isSendable()) {
                return true;
            }
        }
        return false;
    }

    public static boolean containsEmailSendableEntry(List<Member> _members) {
        for(Member member : _members) {
            if(member.getContactMode() == ContactMode.EMAIL) {
                return true;
            }
        }
        return false;
    }

    public static boolean containsEmailSendableEntry(DatabaseManager db, long[] _memberIds) {
        for(long id : _memberIds) {
            Member member = db.queryById(id, Member.class);
            if(member.getContactMode() == ContactMode.EMAIL) {
                return true;
            }
        }
        return false;
    }

    private boolean isSendable(Member member) {
        return (member != null && member.getContactMode() != null) && member.getContactMode().isSendable();
    }

    public static int getShareableCount(List<Member> _members) {
        int count = 0;
        for(Member member : _members) {
            if(member.getContactMode().isSendable()) {
                count++;
            }
        }
        return count;
    }
}

@@ -161,19 +161,21 @@
 ContactM
+eth
 od
-e
 ;%0Aimport
@@ -413,35 +413,37 @@
 mber.getContactM
+eth
 od
-e
 ().isSendable())
@@ -670,35 +670,37 @@
 mber.getContactM
+eth
 od
-e
 () == ContactMod
@@ -689,35 +689,37 @@
 od() == ContactM
+eth
 od
-e
 .EMAIL) %7B%0A      
@@ -1017,19 +1017,21 @@
 ContactM
+eth
 od
-e
 () == Co
@@ -1036,19 +1036,21 @@
 ContactM
+eth
 od
-e
 .EMAIL) 
@@ -1233,19 +1233,21 @@
 ContactM
+eth
 od
-e
 () != nu
@@ -1263,35 +1263,37 @@
 mber.getContactM
+eth
 od
-e
 ().isSendable();
@@ -1461,19 +1461,21 @@
 ContactM
+eth
 od
-e
 ().isSen

Add missing file from merge