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