a fork of iceshrimp.net but a tweaked frontend to my personal liking. waow
fediverse social-media social iceshrimp fedi
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[backend/core] Move mutes on account migration (ISH-721)

+41
+41
Iceshrimp.Backend/Core/Services/UserService.cs
··· 1564 1564 } 1565 1565 } 1566 1566 1567 + var mutes = db.Mutings 1568 + .Where(p => p.Mutee == source && p.ExpiresAt == null) 1569 + .Select(p => p.Muter) 1570 + .AsChunkedAsyncEnumerable(50, p => p.Id, p => p.PrecomputeRelationshipData(source)); 1571 + 1572 + await foreach (var muter in mutes) 1573 + { 1574 + try 1575 + { 1576 + if (muter.Id == target.Id) continue; 1577 + 1578 + // We need to transfer the precomputed properties to the target user for each muter so that the block method works correctly 1579 + target.PrecomputedIsMutedBy = muter.PrecomputedIsMuting; 1580 + await MuteUserAsync(muter, target, null); 1581 + } 1582 + catch (Exception e) 1583 + { 1584 + logger.LogWarning("Failed to process move ({sourceUri} -> {targetUri}) for muter {id}: {error}", 1585 + sourceUri, targetUri, muter.Id, e); 1586 + } 1587 + } 1588 + 1567 1589 if (source.IsRemoteUser || target.IsRemoteUser) return; 1568 1590 1569 1591 var following = db.Followings ··· 1601 1623 { 1602 1624 logger.LogWarning("Failed to process move ({sourceUri} -> {targetUri}) for blockee {id}: {error}", 1603 1625 sourceUri, targetUri, blockee.Id, e); 1626 + } 1627 + } 1628 + 1629 + mutes = db.Mutings 1630 + .Where(p => p.Muter == source && p.ExpiresAt == null) 1631 + .Select(p => p.Mutee) 1632 + .AsChunkedAsyncEnumerable(50, p => p.Id, p => p.PrecomputeRelationshipData(source)); 1633 + 1634 + await foreach (var mutee in mutes) 1635 + { 1636 + try 1637 + { 1638 + if (mutee.Id == target.Id) continue; 1639 + await MuteUserAsync(mutee, target, null); 1640 + } 1641 + catch (Exception e) 1642 + { 1643 + logger.LogWarning("Failed to process move ({sourceUri} -> {targetUri}) for mutee {id}: {error}", 1644 + sourceUri, targetUri, mutee.Id, e); 1604 1645 } 1605 1646 } 1606 1647 }