Option to report abuse on messages
Would need a section on the admin area to deal with the reports, count reports per users and so on.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Maybe in place a option in message, a report abuse link on single user panel.
Also admin interface could have shortcuts in same place.

+1 for @cotamix
Your Rocket.Chat version: (make sure you are running the latest) 31
I've just noticed in my Android Cordova interface that there is a 'Report Abuse' menu item that appears when I long-click on a message. This menu item does not appear within the 'gear' menu in my web interface, or in the Electron interface.
On Android, if I click Report Abuse, it then displays an interface to make a comment and report the offending message, but nothing seems to happen when I press the 'Report!' button.
What is happening here? Is this functionality under development? Report Abuse would be a very nice capability for the platform...

Similar reports: https://github.com/RocketChat/Rocket.Chat/issues/3514 https://github.com/RocketChat/feature-requests/issues/175
I'm a bit confused as the menu item to report a post obviously is available, on Android, iOS and the browser client. But there appears to be no action when a user confirms the report. The only reference I could find in the docs is for the /api/v1/chat.reportMessage call in the developer guide, there's no info for admins or users. How would an admin see the report?
How to enable the feature? Or does this indeed only exist in the UI but without code behind?
@rsimai maybe this can help you ...
I made a workaround. If the user is using the existing "reporting/complain" button, his report is stored into the rocketchat_reports collection. This collection contains the reported message including attachments if used, if succesfull posted into the channel/room the will be removed from the rocketchat_reports collection.
My PHP 7.x (using curl and mong module) script can be runned in crontab every x minutes to get this reported messages and put them in a channel/room via REST postMessage of your choice including markup who is complaining, descrition etc. You can define inside of RC wich users have access this channel/room an the will see the reported messages, this moderator can remove the reported messages in the reporting channel/room. It is provided as it is - no warrenty ;-)
define("RC_AUTH_TOKEN","-- see Rocket.Chat docu to get token via curl--");
define("RC_USER_ID","-- if you get then you get userid too--");
define("RC_API_HOST","http://localhost:3000"); // Attention: http only on localhost - https more secure !
define("RC_POST_CHANNEL","#reports");
define("RCCURLDEBUG",false);
define("RCCURLFORCERESULTOUTPUT",false);
define("MONGODBCONNECTION", "mongodb://localhost:27017");
define("MONGODBNAME", "rocketchat");
define("REPORTSCOL", "rocketchat_reports");
define("USERSCOL", "users");
define("MESSAGESCOL", "rocketchat_message");
try {
$mng = new MongoDB\Driver\Manager(MONGODBCONNECTION);
$query = new MongoDB\Driver\Query([]);
$reportedmsgs = $mng->executeQuery(MONGODBNAME.".".REPORTSCOL, $query);
foreach ($reportedmsgs as $msg) {
$blamingid=$msg->message->_id;
$blamedesc=$msg->description;
$blaminguser="@".getDetailRecord($mng,USERSCOL,'_id',$msg->userId,'username');
$blamedmsg=$msg->message->msg;
$blameduser="@".$msg->message->u->username;
$plameposting = $blaminguser . ' ' . $blamedesc . "\n\n" . $blameduser . ' ' . $blamedmsg;
$url = RC_API_HOST.'/api/v1/chat.postMessage';
$fields = array(
'channel' => RC_POST_CHANNEL,
'text' => $plameposting
);
if (property_exists($msg->message,'attachments'))
{
$copiedattachments=array('attachments' => $msg->message->attachments);
$fields=array_merge($fields,$copiedattachments);
}
$r=makeRestCall($url, $fields,'' );
if ($r==true){
delRecord($mng,$msg->_id,MONGODBNAME.".".REPORTSCOL);
}
usleep(500000);
}
} catch (MongoDB\Driver\Exception\Exception $e) {
$filename = basename(__FILE__);
echo "The $filename script has experienced an error.\n";
echo "It failed with the following exception:\n";
echo "Exception:", $e->getMessage(), "\n";
echo "In file:", $e->getFile(), "\n";
echo "On line:", $e->getLine(), "\n";
}
function getDetailRecord($mng,$collectionname,$filtername,$filtervalue,$returnfield)
{
$filter = [$filtername => $filtervalue];
$options = [];
$query = new MongoDB\Driver\Query($filter,$options);
$rows = $mng->executeQuery(MONGODBNAME.".".$collectionname, $query);
$returnvalue ="HINWEIS: Die angefrage Detailinformation zur Message oder dem User konnte nicht gefunden werden. Der User oder COP hat sie entfernt.";
foreach ($rows as $row) {
$returnvalue= $row->$returnfield;
break;
}
return $returnvalue;
}
function makeRestCall($url,$fields,$authuserfields='') {
//we dont url-ify the data, we use json for the POST
//open connection
$ch = curl_init();
$header = array();
$header[] = 'Content-type: application/json';
//check if we should use authentificatoin
if ($authuserfields==''){
$header[] = 'X-Auth-Token: ' . RC_AUTH_TOKEN;
$header[] = 'X-User-Id: ' . RC_USER_ID;
}
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS, json_encode($fields));
curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
//execute post
$result = curl_exec($ch);
if (RCCURLDEBUG==true or RCCURLFORCERESULTOUTPUT==true){
if (RCCURLFORCERESULTOUTPUT==true or $result===false or strpos($result,'Bad Request')>0 or strpos($result,'"status":"error"')>0 or strpos($result,'"success":false')
){
print_r('CURL Error: '.curl_error($ch));
print_r($result);
}
}
//close connection
curl_close($ch);
$resArr = array();
$resArr = json_decode($result,true);
return $resArr;
}
function delRecord($manager,$id,$collection){
$bulk = new MongoDB\Driver\BulkWrite;
$bulk->delete(['_id' => $id], ['limit' => 1]);
//$manager = new MongoDB\Driver\Manager('mongodb://localhost:27017');
$result = $manager->executeBulkWrite($collection, $bulk);
if($result->getDeletedCount()==1)
return true;
else
return false;
}
?>
Related issues/ feature-requests
A place to view reported messages - still open https://github.com/RocketChat/feature-requests/issues/175 befor https://github.com/RocketChat/Rocket.Chat/issues/1364
App to report a post - still open https://github.com/RocketChat/feature-requests/issues/94
Option to report abuse on messages - still open https://github.com/RocketChat/Rocket.Chat/issues/503
Wrong text when reporting a message - still open https://github.com/RocketChat/Rocket.Chat/issues/14514
Report abuse - removed - closed https://github.com/RocketChat/Rocket.Chat/issues/8999
add a report post button #3514 - closed https://github.com/RocketChat/Rocket.Chat/issues/3514
Demonstrate bot integrations - closed https://github.com/RocketChat/Rocket.Chat/issues/10174
@marco-aa I totally appreciate you took the time to develop and show your workaround, that's excellent! I don't see however how we can use that as we don't want to customize and deviate from the standard containers, or want db access from other hosts. I guess we'll have to wait until the rocket people finally include something like the above in their code and complete the feature. Still I wonder why they have implemented this in the UI with no follow up to make it useful...
Possible solution: https://github.com/RocketChat/Rocket.Chat/pull/27961
We have a solution now -> Moderation Console 🎉