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