always notify

This commit is contained in:
Nicolas Constant 2022-12-20 18:47:21 -05:00
parent 1a939b6147
commit 7658438741
No known key found for this signature in database
GPG key ID: 1E9F677FB01A5688
2 changed files with 11 additions and 18 deletions

View file

@ -105,7 +105,7 @@ namespace BirdsiteLive.Domain
return result;
}
public async Task MigrateAccountAsync(ValidatedFediverseUser validatedUser, string acct, bool notify)
public async Task MigrateAccountAsync(ValidatedFediverseUser validatedUser, string acct)
{
// Apply moved to
var twitterAccount = await _twitterUserDal.GetTwitterUserAsync(acct);
@ -120,14 +120,11 @@ namespace BirdsiteLive.Domain
await _twitterUserDal.UpdateTwitterUserAsync(twitterAccount);
// Notify Followers
if (notify)
{
var message = $@"<p>[BSL MIRROR SERVICE NOTIFICATION]<br/>
var message = $@"<p>[BSL MIRROR SERVICE NOTIFICATION]<br/>
This bot has been disabled by it's original owner.<br/>
It has been redirected to {validatedUser.FediverseAcct}.
</p>";
NotifyFollowers(acct, twitterAccount, message);
}
NotifyFollowers(acct, twitterAccount, message);
}
private void NotifyFollowers(string acct, SyncTwitterUser twitterAccount, string message)
@ -172,7 +169,7 @@ namespace BirdsiteLive.Domain
});
}
public async Task DeleteAccountAsync(string acct, bool notify)
public async Task DeleteAccountAsync(string acct)
{
// Apply moved to
var twitterAccount = await _twitterUserDal.GetTwitterUserAsync(acct);
@ -184,16 +181,12 @@ namespace BirdsiteLive.Domain
twitterAccount.Deleted = true;
await _twitterUserDal.UpdateTwitterUserAsync(twitterAccount);
// Notify Followers
if (notify)
{
var message = $@"<p>[BSL MIRROR SERVICE NOTIFICATION]<br/>
var message = $@"<p>[BSL MIRROR SERVICE NOTIFICATION]<br/>
This bot has been deleted by it's original owner.<br/>
</p>";
NotifyFollowers(acct, twitterAccount, message);
}
NotifyFollowers(acct, twitterAccount, message);
}
public async Task TriggerRemoteMigrationAsync(string id, string tweetid, string handle)

View file

@ -85,7 +85,7 @@ namespace BirdsiteLive.Controllers
{
try
{
await _migrationService.MigrateAccountAsync(fediverseUserValidation, id, true);
await _migrationService.MigrateAccountAsync(fediverseUserValidation, id);
await _migrationService.TriggerRemoteMigrationAsync(id, tweetid, handle);
data.MigrationSuccess = true;
}
@ -129,7 +129,7 @@ namespace BirdsiteLive.Controllers
{
try
{
await _migrationService.DeleteAccountAsync(id, true);
await _migrationService.DeleteAccountAsync(id);
await _migrationService.TriggerRemoteDeleteAsync(id, tweetid);
data.MigrationSuccess = true;
}
@ -152,7 +152,7 @@ namespace BirdsiteLive.Controllers
if (fediverseUserValidation.IsValid && isTweetValid)
{
await _migrationService.MigrateAccountAsync(fediverseUserValidation, id, false);
await _migrationService.MigrateAccountAsync(fediverseUserValidation, id);
return Ok();
}
@ -167,7 +167,7 @@ namespace BirdsiteLive.Controllers
if (isTweetValid)
{
await _migrationService.DeleteAccountAsync(id, true);
await _migrationService.DeleteAccountAsync(id);
return Ok();
}