Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

how to disable "User send a message" in the Notification popup in MeMenu

jackmaessenjackmaessen ✭✭✭
edited April 2016 in Vanilla 2.0 - 2.8


I was looking for a way, and still not found, to disable the "X-User send a message" in the Notification flyout of the Memenu.
All other comments must stay intact.
I know it is parsed in the file applications/dashboard/views/activity/popin.php.
But all other comments are also parsed there. How can i distinguish and filter the "X send a message" from the other comments in the Notifications flyout?

Comments

  • Options
    hgtonighthgtonight ∞ · New MVP

    You could hook into the activity model, look for the sent message activity type, and "handle" the activity by throwing a validation error.

    public function activityModel_beforeSave_handler($sender) {
      $activity =& $sender->EventArguments['Activity'];
      if($activity['RecordType'] == 'Conversation') {
        $sender->Validation->addValidationResult('Message');
      }
    }
    

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options
    jackmaessenjackmaessen ✭✭✭
    edited April 2016

    Awesome solution @hgtonight
    I added the public function above in the PM plugin ( for me most logical to put it in that plugin) and i do not see anymore
    the "send a message" line. Only in the Inbox. And that was exactly what i was trying to achieve. Great solution. Thanks!

Sign In or Register to comment.