Skip to content

Commit

Permalink
Removed references to Mastadon email. This will not validate the full…
Browse files Browse the repository at this point in the history
… email address. Just looks at the domain
  • Loading branch information
poppastring committed Nov 24, 2022
1 parent 1043616 commit 1e905b1
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 27 deletions.
2 changes: 0 additions & 2 deletions source/DasBlog.Services/ConfigFile/Interfaces/ISiteConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,6 @@ public interface ISiteConfig

string MastodonAccount { get; set; }

string MastodonEmail { get; set; }

[XmlAnyElement]
XmlElement[] anyElements { get; set; }

Expand Down
1 change: 0 additions & 1 deletion source/DasBlog.Services/ConfigFile/SiteConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,5 @@ public SiteConfig() { }

public string MastodonAccount { get; set; }

public string MastodonEmail { get; set; }
}
}
1 change: 0 additions & 1 deletion source/DasBlog.Tests/UnitTests/SiteConfigTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,5 @@ public class SiteConfigTest : ISiteConfig
public string DefaultSources { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public string MastodonServerUrl { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public string MastodonAccount { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public string MastodonEmail { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
}
}
1 change: 0 additions & 1 deletion source/DasBlog.Web.UI/Config/site.Development.config
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

<MastodonServerUrl />
<MastodonAccount />
<MastodonEmail />

<RssDayCount>10</RssDayCount>
<RssMainEntryCount>50</RssMainEntryCount>
Expand Down
1 change: 0 additions & 1 deletion source/DasBlog.Web.UI/Config/site.config
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

<MastodonServerUrl />
<MastodonAccount />
<MastodonEmail />

<RssDayCount>10</RssDayCount>
<RssMainEntryCount>50</RssMainEntryCount>
Expand Down
7 changes: 0 additions & 7 deletions source/DasBlog.Web.UI/Controllers/ActivityPubController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,12 @@ public ActionResult WebFinger(string resource)
string authurl = new Uri(new Uri(dasBlogSettings.SiteConfiguration.MastodonServerUrl),
"authorize_interaction").AbsoluteUri + "?uri={uri}";

string email = string.Format("acct:{0}", dasBlogSettings.SiteConfiguration.MastodonEmail);

if (dasBlogSettings.SiteConfiguration.MastodonServerUrl.IsNullOrWhiteSpace() ||
dasBlogSettings.SiteConfiguration.MastodonAccount.IsNullOrWhiteSpace())
{
return NoContent();
}

if(string.Compare(email, resource, StringComparison.InvariantCultureIgnoreCase) != 0)
{
return NotFound();
}

var results = new Root
{
subject = string.Format("acct:{0}@{1}", dasBlogSettings.SiteConfiguration.MastodonAccount, dasBlogSettings.SiteConfiguration.MastodonServerUrl),
Expand Down
6 changes: 0 additions & 6 deletions source/DasBlog.Web.UI/Models/AdminViewModels/SiteViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,6 @@ public class SiteViewModel
[RegularExpression("(@)((?:[A-Za-z0-9-_]*))")]
public string MastodonAccount { get; set; }

[DisplayName("Mastadon Email")]
[Description("")]
[DataType(DataType.EmailAddress, ErrorMessage = "Invalid email format")]
public string MastodonEmail { get; set; }



public bool EntryTitleAsLink { get; set; }
public bool ObfuscateEmail { get; set; }
Expand Down
8 changes: 0 additions & 8 deletions source/DasBlog.Web.UI/Views/Admin/Settings.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -402,14 +402,6 @@
@Html.ValidationMessageFor(m => m.SiteConfig.MastodonAccount, null, new { @class = "text-danger" })
</div>

<div class="form-group row mb-3">
@Html.LabelFor(m => @Model.SiteConfig.MastodonEmail, null, new { @class = "col-form-label col-sm-2" })
<div class="col-sm-5">
@Html.TextBoxFor(m => @Model.SiteConfig.MastodonEmail, null, new { @class = "form-control sm-10" })
</div>
@Html.ValidationMessageFor(m => m.SiteConfig.MastodonEmail, null, new { @class = "text-danger" })
</div>

<div class="form-group row mb-3">

@Html.LabelFor(m => @Model.MetaConfig.TwitterSite, null, new { @class = "col-form-label col-sm-2" })
Expand Down

0 comments on commit 1e905b1

Please sign in to comment.