Cool!  I'm hopeful that the performance impact won't be too great, since it
doesn't look we call listFriend() all that frequently from the client.


Cheers,
Ox

-----------------------------------------------------------------------------------------

"I love people who harness themselves, an ox to a heavy cart,
who pull like water buffalo, with massive patience,
who strain in the mud and the muck to move things forward,
who do what has to be done, again and again."

- Marge Piercy



On Sun, Jan 12, 2014 at 6:50 PM, myleshorton <notifications@github.com>wrote:

> In src/main/java/org/lantern/friending/Friending.java:
>
> > -                        return success(quota, friends);
> > +                        Set<Friend> uniqueFriends = new HashSet<Friend>(friends);
> > +                        // Find friend relationships referencing this user and add them
> > +                        // to the set of unique Friends as free to friend
> > +                        List<LanternFriend> reverseFriends = new Dao()
> > +                                .withObjectify(new DbCall<List<LanternFriend>>() {
> > +                                    @Override
> > +                                    public List<LanternFriend> call(Objectify ofy) {
> > +                                        return ofy.query(LanternFriend.class)
> > +                                                .filter("email", userEmail)
> > +                                                .filter("status", Status.friend)
> > +                                                .list();
> > +                                    }
> > +                                });
> > +                        for (Friend friend : reverseFriends) {
> > +                            uniqueFriends.add(new LanternFriend(friend.getUserEmail(), userEmail, Status.pending, true));
>
> Yeah sorry made last comment before seeing your previous two -- yeah I
> think we should go for it. If you hadn't already done all the work to make
> the change I might say we could live with the current system, but given
> you've already done it let's go with it!
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/getlantern/lantern-controller/pull/59/files#r8816309>
> .
>