Exemple #1
0
  public void reportSpam(JiveObject jiveObject, User reporter, String comment, Date reportDate) {
    // Similar to MessageAbuseAction#execute()
    AbuseReport abuseReport = new AbuseReport();
    abuseReport.setAbuseType(AbuseType.spam);
    abuseReport.setObjectID(jiveObject.getID());
    abuseReport.setObjectType(jiveObject.getObjectType());
    abuseReport.setUser(reporter);
    abuseReport.setReportDate(reportDate);
    abuseReport.setComment(comment);
    abuseReport.setJiveObject(jiveObject);

    abuseManager.reportAbuse(abuseReport);
  }
Exemple #2
0
 public void resolveSpamReport(JiveObject jiveObject, User moderator) {
   abuseManager.resolveAbuseReports(jiveObject);
   List<ApprovalWorkflowBean> workflows =
       approvalManager.getWorkflowBeans(jiveObject, JiveObjectModerator.Type.ABUSE);
   for (ApprovalWorkflowBean workflow : workflows) {
     try {
       jiveObjectModerator.approve(
           workflow.getWorkflowID(), jiveObject, moderator, "Spam report: Content is not spam");
     } catch (ModerationItemException e) {
       log.error(
           "Cannot approve workflow, id: "
               + workflow.getWorkflowID()
               + ", message: "
               + e.getMessage());
       if (log.isTraceEnabled()) {
         log.error("Moderation exception", e);
       }
     }
   }
 }