From b94926be73f55577f22687740f968b2a493ff4a4 Mon Sep 17 00:00:00 2001 From: Miss Pasture Date: Wed, 16 Jun 2021 17:19:22 -0400 Subject: [PATCH] use custom twitter domain in infoboxes, add 'about [instance name]' to infoboxes --- src/BirdsiteLive.Domain/UserService.cs | 35 +++++++++++++++++++------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/src/BirdsiteLive.Domain/UserService.cs b/src/BirdsiteLive.Domain/UserService.cs index 24c8287..a00790d 100644 --- a/src/BirdsiteLive.Domain/UserService.cs +++ b/src/BirdsiteLive.Domain/UserService.cs @@ -75,6 +75,31 @@ namespace BirdsiteLive.Domain _statisticsHandler.ExtractedDescription(extracted.tags.Count(x => x.type == "Mention")); } + var attachments = new List(); + attachments.Add(new UserAttachment + { + type = "PropertyValue", + name = _instanceSettings.TwitterDomain, + value = $"https://{_instanceSettings.TwitterDomain}/{acct}" + }); + + if(_instanceSettings.TwitterDomain != "twitter.com") + { + attachments.Add(new UserAttachment + { + type = "PropertyValue", + name = "Twitter", + value = $"twitter.com/{acct}" + }); + } + + attachments.Add(new UserAttachment + { + type = "PropertyValue", + name = $"About {_instanceSettings.Name}", + value = $"https://{_instanceSettings.Domain}/About" + }); + var user = new Actor { id = actorUrl, @@ -102,15 +127,7 @@ namespace BirdsiteLive.Domain mediaType = "image/jpeg", url = twitterUser.ProfileBannerURL }, - attachment = new [] - { - new UserAttachment - { - type = "PropertyValue", - name = "Official", - value = $"https://twitter.com/{acct}" - } - }, + attachment = attachments.ToArray(), endpoints = new EndPoints { sharedInbox = $"https://{_instanceSettings.Domain}/inbox"