4 use Friendica\Core\System;
6 function ignored_init(App $a) {
14 $message_id = intval($a->argv[1]);
20 $r = q("SELECT `ignored` FROM `thread` WHERE `uid` = %d AND `iid` = %d LIMIT 1",
24 if (! dbm::is_result($r)) {
28 if (! intval($r[0]['ignored'])) {
32 $r = q("UPDATE `thread` SET `ignored` = %d WHERE `uid` = %d and `iid` = %d",
38 // See if we've been passed a return path to redirect to
39 $return_path = ((x($_REQUEST,'return')) ? $_REQUEST['return'] : '');
41 $rand = '_=' . time();
42 if(strpos($return_path, '?')) $rand = "&$rand";
43 else $rand = "?$rand";
45 goaway(System::baseUrl() . "/" . $return_path . $rand);
48 // the json doesn't really matter, it will either be 0 or 1
50 echo json_encode($ignored);