As I mentioned in the below comment, relying on subscription requests
doesn't always work because I might be friended by someone who is already
on my roster, in which case they're already on my roster and I don't see a
friend suggestion.

https://github.com/getlantern/lantern-controller/commit/427804992f4ab3b6b189c9be24dfce75444f4ce5#commitcomment-5044646


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 5:45 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));
>
> Huh -- this actually seems a lot more complicated to me, not to mention
> more expensive! As I mentioned in:
>
> 4278049#commitcomment-5045306<https://github.com/getlantern/lantern-controller/commit/427804992f4ab3b6b189c9be24dfce75444f4ce5#commitcomment-5045306>
>
> The change to just the suggested bits to LanternFriend is super simple,
> and then you don't need an entire extra query.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/getlantern/lantern-controller/pull/59/files#r8815988>
> .
>