:verified: checkmarks on verified accounts, because why not

This commit is contained in:
Miss Pasture 2021-07-17 22:16:19 -04:00
parent 63b85f143d
commit 7e1163c3d4
6 changed files with 42 additions and 3 deletions

View file

@ -1,5 +1,8 @@
using System.Net;
using System;
using System.Collections.Generic;
using System.Net;
using BirdsiteLive.ActivityPub.Converters;
using BirdsiteLive.ActivityPub.Models;
using Newtonsoft.Json;
namespace BirdsiteLive.ActivityPub
@ -25,5 +28,6 @@ namespace BirdsiteLive.ActivityPub
public Image image { get; set; }
public EndPoints endpoints { get; set; }
public UserAttachment[] attachment { get; set; }
public List<Tag> tag;
}
}

View file

@ -1,8 +1,19 @@
namespace BirdsiteLive.ActivityPub.Models
using System;
namespace BirdsiteLive.ActivityPub.Models
{
public class Tag {
public TagResource icon { get; set; } = null;
public string id { get; set; }
public string type { get; set; } //Hashtag
public string href { get; set; } //https://mastodon.social/tags/app
public string name { get; set; } //#app
public DateTime updated { get; set; } = default(DateTime);
}
public class TagResource
{
public string type { get; set; }
public string url { get; set; }
}
}

View file

@ -7,6 +7,7 @@ using System.Text;
using System.Threading.Tasks;
using BirdsiteLive.ActivityPub;
using BirdsiteLive.ActivityPub.Converters;
using BirdsiteLive.ActivityPub.Models;
using BirdsiteLive.Common.Regexes;
using BirdsiteLive.Common.Settings;
using BirdsiteLive.Cryptography;
@ -140,6 +141,27 @@ namespace BirdsiteLive.Domain
sharedInbox = $"https://{_instanceSettings.Domain}/inbox"
}
};
if (twitterUser.Verified)
{
user.tag = new List<Tag>
{
new Tag
{
icon = new TagResource
{
type = "Image",
url = "https://" + _instanceSettings.Domain + "/verified.png"
},
id = "https://" + _instanceSettings.Domain + "/verified.png",
name = ":verified:",
type = "Emoji"
}
};
user.name += " :verified:";
}
return user;
}

View file

@ -12,5 +12,6 @@
public string ProfileBannerURL { get; set; }
public bool Protected { get; set; }
public bool Sensitive { get; set; }
public bool Verified { get; set; }
}
}

View file

@ -67,7 +67,8 @@ namespace BirdsiteLive.Twitter
ProfileImageUrl = user.ProfileImageUrlFullSize.Replace("http://", "https://"),
ProfileBackgroundImageUrl = user.ProfileBackgroundImageUrlHttps,
ProfileBannerURL = user.ProfileBannerURL,
Protected = user.Protected
Protected = user.Protected,
Verified = user.Verified
};
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB