Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to report abuse on messages #503

Closed
engelgabriel opened this issue Aug 19, 2015 · 9 comments
Closed

Option to report abuse on messages #503

engelgabriel opened this issue Aug 19, 2015 · 9 comments
Labels
Feature: Planned Planned Feature stat: triaged Issue reviewed and properly tagged ui/ux
Milestone

Comments

@engelgabriel
Copy link
Member

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.

@engelgabriel engelgabriel added this to the Next milestone Aug 19, 2015
@cotamix
Copy link

cotamix commented Aug 25, 2015

Maybe in place a option in message, a report abuse link on single user panel.
Also admin interface could have shortcuts in same place.
user-right-panel

@rodrigok
Copy link
Member

+1 for @cotamix

@marceloschmidt marceloschmidt added ui/ux Feature: Request Requested Feature and removed Enhancement labels Sep 17, 2015
@RichardFoxworthy
Copy link

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...

screenshot_20160527-154138
screenshot_20160527-155521

@engelgabriel engelgabriel modified the milestones: Short-term, Mid-term Mar 1, 2017
@karlprieb karlprieb modified the milestones: Short-term, Mid-term Mar 1, 2018
@marceloschmidt marceloschmidt added Feature: Planned Planned Feature and removed Feature: Request Requested Feature labels Apr 5, 2018
HappyTobi pushed a commit to HappyTobi/Rocket.Chat that referenced this issue Jul 10, 2018
…ocketChat#503)

* Refactoring keep alive so we dont call UserPresence excessively

* Removes logic and Meteor call

* remove away_time

* Remove stoptimer and logs
Peym4n pushed a commit to redlink-gmbh/Rocket.Chat that referenced this issue Apr 4, 2019
…ations-guest-pool

[Livechat] Notify agents when a new chat is queued
@theorenck theorenck modified the milestones: Mid-term, 4.0.0 Oct 31, 2019
@rsimai
Copy link

rsimai commented Dec 11, 2019

Similar reports:
#3514
RocketChat/feature-requests#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?

@marco-aa
Copy link

marco-aa commented Feb 4, 2020

@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
RocketChat/feature-requests#175
befor https://github.com/RocketChat/Rocket.Chat/issues/1364

App to report a post - still open
RocketChat/feature-requests#94

Option to report abuse on messages - still open
#503

Wrong text when reporting a message - still open
#14514

Report abuse - removed - closed
#8999

add a report post button #3514 - closed
#3514

Demonstrate bot integrations - closed
#10174

@rsimai
Copy link

rsimai commented Feb 5, 2020

@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...

@maxwell-kalin
Copy link

news?

@tassoevan tassoevan added stat: triaged Issue reviewed and properly tagged and removed Triaged labels Oct 27, 2022
@hugocostadev
Copy link
Contributor

Possible solution: #27961

@Dnouv
Copy link
Member

Dnouv commented Feb 3, 2024

We have a solution now -> Moderation Console 🎉

@Dnouv Dnouv closed this as completed Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Planned Planned Feature stat: triaged Issue reviewed and properly tagged ui/ux
Projects
None yet
Development

No branches or pull requests