fix DM notification

This commit is contained in:
Nicolas Constant
2022-12-27 22:13:08 -05:00
parent ae42b109e9
commit 7c267063f9

View File

@@ -130,10 +130,7 @@ namespace BirdsiteLive.Domain
await _twitterUserDal.UpdateTwitterUserAsync(twitterAccount); await _twitterUserDal.UpdateTwitterUserAsync(twitterAccount);
// Notify Followers // Notify Followers
var message = $@"<p>[BSL MIRROR SERVICE NOTIFICATION]<br/> var message = $@"<p>[BSL MIRROR SERVICE NOTIFICATION]<br/>This bot has been disabled by its original owner.<br/>It has been redirected to {validatedUser.FediverseAcct}.</p>";
This bot has been disabled by its original owner.<br/>
It has been redirected to {validatedUser.FediverseAcct}.
</p>";
NotifyFollowers(acct, twitterAccount, message); NotifyFollowers(acct, twitterAccount, message);
} }
@@ -156,7 +153,7 @@ namespace BirdsiteLive.Domain
var note = new Note var note = new Note
{ {
id = noteId, id = noteUrl,
published = DateTime.UtcNow.ToString("s") + "Z", published = DateTime.UtcNow.ToString("s") + "Z",
url = noteUrl, url = noteUrl,
@@ -165,11 +162,21 @@ namespace BirdsiteLive.Domain
to = new[] { to }, to = new[] { to },
cc = cc, cc = cc,
content = message content = message,
tag = new Tag[]{
new Tag()
{
type = "Mention",
href = follower.ActorId,
name = $"@{follower.Acct}@{follower.Host}"
}
},
}; };
await _activityPubService.PostNewNoteActivity(note, acct, Guid.NewGuid().ToString(), follower.Host, if (!string.IsNullOrWhiteSpace(follower.SharedInboxRoute))
follower.InboxRoute); await _activityPubService.PostNewNoteActivity(note, acct, noteId, follower.Host, follower.SharedInboxRoute);
else
await _activityPubService.PostNewNoteActivity(note, acct, noteId, follower.Host, follower.InboxRoute);
} }
catch (Exception e) catch (Exception e)
{ {
@@ -194,9 +201,7 @@ namespace BirdsiteLive.Domain
await _twitterUserDal.UpdateTwitterUserAsync(twitterAccount); await _twitterUserDal.UpdateTwitterUserAsync(twitterAccount);
// Notify Followers // Notify Followers
var message = $@"<p>[BSL MIRROR SERVICE NOTIFICATION]<br/> var message = $@"<p>[BSL MIRROR SERVICE NOTIFICATION]<br/>This bot has been deleted by its original owner.<br/></p>";
This bot has been deleted by its original owner.<br/>
</p>";
NotifyFollowers(acct, twitterAccount, message); NotifyFollowers(acct, twitterAccount, message);
// Delete remote accounts // Delete remote accounts