|
@ -391,9 +391,16 @@ function handle_report(){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(isset($config['matrix'])){ |
|
|
if(isset($config['matrix'])){ |
|
|
$ch = curl_init("$config['matrix']['host']/_matrix/client/r0/rooms/$config['matrix']['room_id']/send/m.room.message?access_token=$config['matrix']['access_token']"); |
|
|
$slackmessage = $config['domain'] . "/mod.php?/" . $board['dir'] . $config['dir']['res'] . ( $thread['thread'] ? $thread['thread'] : $id ) . ".html" . ($thread['thread'] ? '#' . $id : '') . ' \\n ' . $reason . '\\n ' . $postcontent . ' \\n '; |
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $slackmessage); |
|
|
$url = $config['matrix']['host'] . "/_matrix/client/r0/rooms/" . $config['matrix']['room_id'] . "/send/m.room.message?access_token=" . $config['matrix']['access_token']; |
|
|
$result = curl_exec($ch); |
|
|
$ch = curl_init($url); |
|
|
|
|
|
$post_data = json_encode(array( |
|
|
|
|
|
"msgtype" => "m.text", |
|
|
|
|
|
"body" => $slackmessage |
|
|
|
|
|
)); |
|
|
|
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); |
|
|
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
|
|
|
|
|
$postResult = curl_exec($ch); |
|
|
curl_close($ch); |
|
|
curl_close($ch); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|