mirror of
https://github.com/NicolasConstant/BirdsiteLive
synced 2025-06-05 21:49:16 +02:00
fix DM notification
This commit is contained in:
@@ -63,7 +63,7 @@ namespace BirdsiteLive.Domain
|
|||||||
|
|
||||||
if (tweet.CreatorName.Trim().ToLowerInvariant() != acct.Trim().ToLowerInvariant())
|
if (tweet.CreatorName.Trim().ToLowerInvariant() != acct.Trim().ToLowerInvariant())
|
||||||
throw new Exception($"Tweet not published by @{acct}");
|
throw new Exception($"Tweet not published by @{acct}");
|
||||||
|
|
||||||
if (!tweet.MessageContent.Contains(code))
|
if (!tweet.MessageContent.Contains(code))
|
||||||
{
|
{
|
||||||
var message = "Tweet don't have migration code";
|
var message = "Tweet don't have migration code";
|
||||||
@@ -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
|
||||||
|
Reference in New Issue
Block a user