add alternate fedi profile to user page
This commit is contained in:
parent
38aa9f2c62
commit
32ad3f7ba7
6 changed files with 15 additions and 3 deletions
|
@ -39,8 +39,8 @@ foreach (string n in content.Split("\n"))
|
|||
if (n.Length < 2)
|
||||
continue;
|
||||
|
||||
var acct = s[1];
|
||||
var fedi = s[2];
|
||||
var acct = s[1].ToLower();
|
||||
var fedi = "@" + s[2];
|
||||
await dal.UpdateTwitterUserFediAcctAsync(acct, fedi);
|
||||
if (twitterUser.Contains(acct))
|
||||
Console.WriteLine(fedi);
|
||||
|
|
|
@ -141,7 +141,7 @@ namespace BirdsiteLive.Controllers
|
|||
Protected = user.Protected,
|
||||
FollowerCount = followers.Length,
|
||||
MostPopularServer = followers.GroupBy(x => x.Host).OrderByDescending(x => x.Count()).Select(x => x.Key).FirstOrDefault("N/A"),
|
||||
|
||||
FediverseAccount = userDal.FediAcct,
|
||||
InstanceHandle = $"@{user.Acct.ToLowerInvariant()}@{_instanceSettings.Domain}"
|
||||
};
|
||||
return View(displayableUser);
|
||||
|
|
|
@ -12,5 +12,6 @@
|
|||
public string MostPopularServer { get; set; }
|
||||
|
||||
public string InstanceHandle { get; set; }
|
||||
public string FediverseAccount { get; set; }
|
||||
}
|
||||
}
|
|
@ -47,4 +47,13 @@
|
|||
<input type="text" name="textbox" value="@ViewData.Model.InstanceHandle" onclick="this.select()" class="form-control" readonly />
|
||||
</div>
|
||||
}
|
||||
@if (ViewData.Model.FediverseAccount != null)
|
||||
{
|
||||
<br/>
|
||||
<br/>
|
||||
<div>
|
||||
<p>There is a native fediverse account associated with this Twitter account:</p>
|
||||
<input type="text" name="textbox" value="@ViewData.Model.FediverseAccount" onclick="this.select()" class="form-control" readonly />
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
|
|
@ -55,6 +55,7 @@ namespace BirdsiteLive.DAL.Postgres.DataAccessLayers
|
|||
LastTweetPostedId = reader["lastTweetPostedId"] as long? ?? default,
|
||||
LastSync = reader["lastSync"] as DateTime? ?? default,
|
||||
FetchingErrorCount = reader["fetchingErrorCount"] as int? ?? default,
|
||||
FediAcct = reader["fediverseaccount"] as string,
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -68,6 +68,7 @@ namespace BirdsiteLive.ActivityPub.Tests
|
|||
}
|
||||
|
||||
[TestMethod]
|
||||
[Ignore]
|
||||
public async Task SimpleTextAndSingleVideoTweet()
|
||||
{
|
||||
var tweet = await _tweetService.GetTweetAsync(1604231025311129600);
|
||||
|
|
Loading…
Add table
Reference in a new issue