/// <summary> /// Report Message as Spam /// </summary> /// <param name="comment"> /// The comment. /// </param> private void ReportSpam(string comment) { if (this.Get <YafBoardSettings>().SpamServiceType.Equals(1)) { string message = BlogSpamNet.ClassifyComment(comment, true); this.PageContext.AddLoadMessage(message); } try { if (this.Get <YafBoardSettings>().SpamServiceType.Equals(2) && !string.IsNullOrEmpty(this.Get <YafBoardSettings>().AkismetApiKey)) { var service = new AkismetSpamClient(this.Get <YafBoardSettings>().AkismetApiKey, new Uri(BaseUrlBuilder.BaseUrl)); service.SubmitSpam(new Comment(null, string.Empty) { Content = comment }); this.PageContext.AddLoadMessage(this.GetText("MODERATE_DEFAULT", "SPAM_REPORTED")); } } catch (Exception) { this.PageContext.AddLoadMessage(this.GetText("MODERATE_DEFAULT", "SPAM_REPORTED_FAILED")); } }
/// <summary> /// Report Message as Spam /// </summary> /// <param name="comment"> /// The comment. /// </param> private void ReportSpam(string comment) { if (this.Get <YafBoardSettings>().SpamServiceType.Equals(1)) { string message = BlogSpamNet.ClassifyComment(comment, true); this.PageContext.AddLoadMessage(message); } try { if (!this.Get <YafBoardSettings>().SpamServiceType.Equals(2) || string.IsNullOrEmpty(this.Get <YafBoardSettings>().AkismetApiKey)) { return; } var service = new AkismetSpamClient(this.Get <YafBoardSettings>().AkismetApiKey, new Uri(BaseUrlBuilder.BaseUrl)); service.SubmitSpam(new Comment(null, string.Empty) { Content = comment }); this.Logger.Log( this.PageContext.PageUserID, "Spam Message Reported", "Message '{0}' was Reported to Akismet.com by {1}".FormatWith( comment, this.Get <YafBoardSettings>().EnableDisplayName ? this.PageContext.CurrentUserData.DisplayName : this.PageContext.CurrentUserData.UserName), EventLogTypes.SpamMessageReported); this.PageContext.AddLoadMessage(this.GetText("MODERATE_DEFAULT", "SPAM_REPORTED")); } catch (Exception) { this.PageContext.AddLoadMessage(this.GetText("MODERATE_DEFAULT", "SPAM_REPORTED_FAILED")); } }
/// <summary> /// Report Message as Spam /// </summary> /// <param name="comment"> /// The comment. /// </param> private void ReportSpam(string comment) { if (this.Get<YafBoardSettings>().SpamServiceType.Equals(1)) { string message = BlogSpamNet.ClassifyComment(comment, true); this.PageContext.AddLoadMessage(message); } try { if (!this.Get<YafBoardSettings>().SpamServiceType.Equals(2) || string.IsNullOrEmpty(this.Get<YafBoardSettings>().AkismetApiKey)) { return; } var service = new AkismetSpamClient(this.Get<YafBoardSettings>().AkismetApiKey, new Uri(BaseUrlBuilder.BaseUrl)); service.SubmitSpam(new Comment(null, string.Empty) { Content = comment }); this.PageContext.AddLoadMessage(this.GetText("MODERATE_DEFAULT", "SPAM_REPORTED")); } catch (Exception) { this.PageContext.AddLoadMessage(this.GetText("MODERATE_DEFAULT", "SPAM_REPORTED_FAILED")); } }