change RT location
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
Sam Therapy 2023-03-22 19:48:56 +01:00
parent 17bac21fd2
commit 0c5658920d
Signed by: sam
GPG key ID: 4D8B07C18F31ACBD
3 changed files with 9 additions and 15 deletions

View file

@ -70,6 +70,9 @@ namespace BirdsiteLive.Domain
if (tweet.InReplyToStatusId != default)
inReplyTo = $"https://{_instanceSettings.Domain}/users/{tweet.InReplyToAccount.ToLowerInvariant()}/statuses/{tweet.InReplyToStatusId}";
if (tweet.QuoteTweetUrl != null)
content += $@"<span class=""quote-inline""><br><br>RT: <a href=""{tweet.QuoteTweetUrl}"">{tweet.QuoteTweetUrl}</a></span>";
var note = new Note
{
id = noteUrl,

View file

@ -316,7 +316,6 @@ namespace BirdsiteLive.Twitter
.GetProperty("quoted_status_permalink").GetProperty("expanded").GetString();
quoteTweetLink = quoteTweetLink.Replace("https://twitter.com/", $"https://{_instanceSettings.Domain}/users/");
quoteTweetLink = quoteTweetLink.Replace("/status/", "/statuses/");
MessageContent += $@"<span class=""quote-inline""><br><br>RT: <a href=""{quoteTweetLink}"">{quoteTweetLink}</a></span>";
}
var extractedTweet = new ExtractedTweet
{

View file

@ -1,13 +1,13 @@
using System.Net.Http;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Extensions.Logging;
using System.Threading.Tasks;
using BirdsiteLive.Common.Settings;
using BirdsiteLive.DAL.Contracts;
using BirdsiteLive.Statistics.Domain;
using BirdsiteLive.Twitter;
using BirdsiteLive.Twitter.Tools;
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using BirdsiteLive.Statistics.Domain;
using Moq;
using BirdsiteLive.DAL.Contracts;
using BirdsiteLive.Common.Settings;
using System.Net.Http;
namespace BirdsiteLive.ActivityPub.Tests
{
@ -85,14 +85,6 @@ namespace BirdsiteLive.ActivityPub.Tests
Assert.IsTrue(tweet.Media[0].Url.StartsWith("https://video.twimg.com/"));
}
[TestMethod]
public async Task SimpleQT()
{
var tweet = await _tweetService.GetTweetAsync(1610807139089383427);
Assert.AreEqual(tweet.MessageContent, "When you gave them your keys you gave them your coins.<span class=\"quote-inline\"><br><br>RT: <a href=\"https://domain.name/users/kadhim/statuses/1610706613207285773\">https://domain.name/users/kadhim/statuses/1610706613207285773</a></span>");
}
[TestMethod]
public async Task SimpleThread()
{