4 use Friendica\Core\System;
5 use Friendica\Database\DBM;
7 function ignored_init(App $a) {
15 $message_id = intval($a->argv[1]);
21 $r = q("SELECT `ignored` FROM `thread` WHERE `uid` = %d AND `iid` = %d LIMIT 1",
25 if (! DBM::is_result($r)) {
29 if (! intval($r[0]['ignored'])) {
33 $r = q("UPDATE `thread` SET `ignored` = %d WHERE `uid` = %d and `iid` = %d",
39 // See if we've been passed a return path to redirect to
40 $return_path = ((x($_REQUEST,'return')) ? $_REQUEST['return'] : '');
42 $rand = '_=' . time();
43 if(strpos($return_path, '?')) $rand = "&$rand";
44 else $rand = "?$rand";
46 goaway(System::baseUrl() . "/" . $return_path . $rand);
49 // the json doesn't really matter, it will either be 0 or 1
51 echo json_encode($ignored);