September 10th, 2001

Patch request: checkfriends fixing

Checkfriends is dumb right now. It's supposed to:

1) be very light-weight
2) be correct

Right now it's only half of #1 and half of #2. The join it does is quick, at the expense of correctness. (it reports changes when a friend posts a private/masked entry you don't have access to read... so it shouldn't flash red at you)

But it could be more correct and more light-weight.

Somebody please implement this:

* add a new userprop to userproplist --- "lastfriendpost"
* when somebody posts:
1) if private, do nothing
2) if public:

REPLACE INTO userprop (userid, upropid, value) SELECT userid, $propid, NOW() FROM friends WHERE friendid=$journalid

(where you figure out $propid ahead of time from using LJ::load_props or whatever which caches that info, rather than joining on another table there)

3) if usemask: same SELECT query as above, except with a join against friend again, to check the allowmask the $journalid gives to the friendof ... something like: (double check this)

REPLACE INTO userprop (userid, upropid, value) SELECT o.userid, $propid, NOW() FROM friends o, friends r WHERE o.friendid=$journalid AND r.userid=$journalid AND r.friendid=o.userid AND r.groupmask & $allowmask

(Mnemonic: "o" = friend of, "r" = reverse friendship)
(where $allowmask is already defined in the "postevent" code in

Then... once you check that's all working, modify checkfriends to not do the join, and instead just load_user_props("lastfriendpost").

Should be a fun straight-forward project that'll be rewarding (improving #1 and #2 above).
Hair Cut

checkfriends bug?

Does checkfriends make allowances for post that are not available to the user currently logged on to the client making the checkfriends request?

The reason I ask? My little red pencil (win32) has just come up three times in row, but with no new entry on my friends page.
  • Current Music
    Nichole Nordeman - This Mystery


i dont know if this has already been brought up, but its something thats been on the back of my mind for a while now. not being a developer (i'm a really poor coder), i've been hesitant to say anything, but since I was already on the subject over in logjam, I figured I would also mention it here as a missing piece of the LiveJournal suite.

logjam post: SSL enabling LiveJournal?