Browse Source

report function fix

pull/74/head
Your Name 2 years ago
parent
commit
57ec54c3a7
  1. 7
      inc/config.php
  2. 13
      post.php

7
inc/config.php

@ -1824,6 +1824,13 @@
* ====================
*/
// Matrix integration for reports
// $config['matrix'] = array(
// 'access_token' => 'ACCESS_TOKEN',
// 'room_id' => '%21askjdlkajsdlka:matrix.org',
// 'host' => 'https://matrix.org'
// );
//Securimage captcha
//Note from lainchan PR: "TODO move a bunch of things here"

13
post.php

@ -391,9 +391,16 @@ function handle_report(){
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']");
curl_setopt($ch, CURLOPT_POSTFIELDS, $slackmessage);
$result = curl_exec($ch);
$slackmessage = $config['domain'] . "/mod.php?/" . $board['dir'] . $config['dir']['res'] . ( $thread['thread'] ? $thread['thread'] : $id ) . ".html" . ($thread['thread'] ? '#' . $id : '') . ' \\n ' . $reason . '\\n ' . $postcontent . ' \\n ';
$url = $config['matrix']['host'] . "/_matrix/client/r0/rooms/" . $config['matrix']['room_id'] . "/send/m.room.message?access_token=" . $config['matrix']['access_token'];
$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);
}
}

Loading…
Cancel
Save