[management] add update account peers hook (#3060)

This commit is contained in:
Pascal Fischer
2024-12-17 12:10:33 +01:00
committed by GitHub
parent 12ae7ff54e
commit 712341e73d
28 changed files with 263 additions and 190 deletions

View File

@@ -294,7 +294,7 @@ func (am *DefaultAccountManager) deleteRegularUser(ctx context.Context, account
am.StoreEvent(ctx, initiatorUserID, targetUserID, account.Id, activity.UserDeleted, meta)
if updateAccountPeers {
am.updateAccountPeers(ctx, account.Id)
am.UpdateAccountPeers(ctx, account.Id)
}
return nil
@@ -640,7 +640,7 @@ func (am *DefaultAccountManager) SaveOrAddUsers(ctx context.Context, accountID,
}
if account.Settings.GroupsPropagationEnabled && areUsersLinkedToPeers(account, userIDs) {
am.updateAccountPeers(ctx, account.Id)
am.UpdateAccountPeers(ctx, account.Id)
}
for _, storeEvent := range eventsToStore {
@@ -983,7 +983,7 @@ func (am *DefaultAccountManager) expireAndUpdatePeers(ctx context.Context, accou
if len(peerIDs) != 0 {
// this will trigger peer disconnect from the management service
am.peersUpdateManager.CloseChannels(ctx, peerIDs)
am.updateAccountPeers(ctx, account.Id)
am.UpdateAccountPeers(ctx, account.Id)
}
return nil
}
@@ -1091,7 +1091,7 @@ func (am *DefaultAccountManager) DeleteRegularUsers(ctx context.Context, account
}
if updateAccountPeers {
am.updateAccountPeers(ctx, accountID)
am.UpdateAccountPeers(ctx, accountID)
}
for targetUserID, meta := range deletedUsersMeta {