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