News for hackers. Stuff that matters.
Re:HN: New flag feature by hugh on Tuesday June 24, 2008 @12:41PM (#226411)
I'm hoping somebody will start submitting some rubbish stories so I can try flagging them.
Re:HN: New flag feature by kirubakaran on Tuesday June 24, 2008 @12:43PM (#226417)
I flagged this post :-) (the post, not your comment)

edit1: I did this before pg explained what 'flag' is for. Now I feel bad.

edit2: oops... I am used to clicking on the last link 'parent'. Did it once by mistake on a comment.

Re:HN: New flag feature by ajbatac on Tuesday June 24, 2008 @12:46PM (#226423)
i wish we could un-flag. some will be curious to what will happen if you click on it.
Re:HN: New flag feature by pg on Tuesday June 24, 2008 @01:02PM (#226462)
ok; here's the source, btw:

  (def flaglink (i user whence)
    (when (and user (> (karma user) flag-threshold*))
      (pr bar*)
      (w/rlink (do (if (mem user i!flags)
                       (pull user i!flags)
                       (push user i!flags))
                   (save-item i)
                   whence)
        (pr (if (mem user i!flags) "unflag" "flag")))))