Flag as Spam(Abuse Service) with custom button in Activity Story Stream

Flag as Spam(Abuse Service) with custom button in Activity Story Stream

This question is answered

Hey,

I'm trying to style Flag as  spam/abuse and Delete activity message dropdown [ http://telligent.com/resized-image.ashx/__size/500x480/__key/communityserver-wikis-components-files/00-00-00-04-07/5722.flag-a-comment-as-abusive.png ]. In fact, I need two buttons, not the dropdown.

Everything went well with Delete, I just  changed

widgetContext.wrapper.delegate('.full-post.activity', 'evolutionModerateLinkClicked', function (e, link) {

to 

widgetContext.wrapper.delegate('.my-activity-delete-button', 'click', function(e) {

in Activity Story Stream widget's ui.js file. 

But what about that flag button? I was not able to find what to .trigger to get that `Flag as Spam/Abuse `. 

There is some ui.component.moderate, but I was not able to make it work.

is there the only option to simulate the same action from front-end, it's to write my own post call to "api.ashx/v2/abusereports.json"? Or I can some how trigger this evolutionModerate() component?

Any help will be appreciated 

Verified Answer
  • If you want a different kind of moderation control only for the activity stream, I would suggest instead of styling the drop down to implement your own button which, when clicked, simply performs a REST request against the abuse report endpoint you identified.

    It would be possible to replace the moderation UI component (which is what renders the moderation drop down dynamically) in a theme override, but this would not be specific to the activity stream. And a simple button should be fairly straightforward to add.

All Replies
  • If you want a different kind of moderation control only for the activity stream, I would suggest instead of styling the drop down to implement your own button which, when clicked, simply performs a REST request against the abuse report endpoint you identified.

    It would be possible to replace the moderation UI component (which is what renders the moderation drop down dynamically) in a theme override, but this would not be specific to the activity stream. And a simple button should be fairly straightforward to add.

  • REST API endpoint worked! Thanks. But I can not get info, is current story is already marked as spam by current user. How can I get this info?

    I was using

    $core_v2_abusiveContent.Get($story.ContentId, $story.ContentTypeId)

    But I was not able to get any valuable information from it.