From 81760303fbf007c05463d95df049e716bac865d5 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Tue, 12 Jun 2012 12:03:44 -0700 Subject: [PATCH] Adjust people queries to fix bugs displaying lists for non-friends --- .../astrid/people/PeopleFilterExposer.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/people/PeopleFilterExposer.java b/astrid/plugin-src/com/todoroo/astrid/people/PeopleFilterExposer.java index 32bf0be9e..472a72aec 100644 --- a/astrid/plugin-src/com/todoroo/astrid/people/PeopleFilterExposer.java +++ b/astrid/plugin-src/com/todoroo/astrid/people/PeopleFilterExposer.java @@ -72,14 +72,19 @@ public class PeopleFilterExposer extends BroadcastReceiver { @SuppressWarnings("nls") private static FilterWithCustomIntent filterFromUserData(User user) { - String email = user.getValue(User.EMAIL); - if (TextUtils.isEmpty(email) || email.equals("null")) + String title = user.getDisplayName(); + if (TextUtils.isEmpty(title) || "null".equals(title)) return null; - String title = user.getDisplayName(); - QueryTemplate userTemplate = new QueryTemplate().where( - Criterion.or(Task.USER.like("%" + email + "%"), - Task.USER_ID.eq(user.getValue(User.REMOTE_ID)))); + String email = user.getValue(User.EMAIL); + Criterion criterion; + if (TextUtils.isEmpty(email) || "null".equals(email)) + criterion = Task.USER_ID.eq(user.getValue(User.REMOTE_ID)); + else + criterion = Criterion.or(Task.USER.like("%" + email + "%"), + Task.USER_ID.eq(user.getValue(User.REMOTE_ID))); + + QueryTemplate userTemplate = new QueryTemplate().where(criterion); FilterWithUpdate filter = new FilterWithUpdate(title, title, userTemplate, null);