4 function ignored_init(&$a) {
11 $message_id = intval($a->argv[1]);
15 $r = q("SELECT `ignored` FROM `thread` WHERE `uid` = %d AND `iid` = %d LIMIT 1",
22 if(! intval($r[0]['ignored']))
25 $r = q("UPDATE `thread` SET `ignored` = %d WHERE `uid` = %d and `iid` = %d",
31 // See if we've been passed a return path to redirect to
32 $return_path = ((x($_REQUEST,'return')) ? $_REQUEST['return'] : '');
34 $rand = '_=' . time();
35 if(strpos($return_path, '?')) $rand = "&$rand";
36 else $rand = "?$rand";
38 goaway($a->get_baseurl() . "/" . $return_path . $rand);
41 // the json doesn't really matter, it will either be 0 or 1
43 echo json_encode($ignored);