potentially fix group join
This commit is contained in:
@@ -541,6 +541,10 @@ public partial class MareHub
|
||||
// get others permissionset to self and eventually update it
|
||||
var otherPermissionToSelf = userinfo?.OtherPermissions ?? null;
|
||||
if (otherPermissionToSelf == null)
|
||||
{
|
||||
var existingPermissionsOnDb = await _dbContext.Permissions.SingleOrDefaultAsync(p => p.UserUID == pair.GroupUserUID && p.OtherUserUID == UserUID).ConfigureAwait(false);
|
||||
|
||||
if (existingPermissionsOnDb == null)
|
||||
{
|
||||
var otherPreferred = await _dbContext.GroupPairPreferredPermissions.SingleAsync(u => u.GroupGID == group.GID && u.UserUID == pair.GroupUserUID).ConfigureAwait(false);
|
||||
otherPermissionToSelf = new()
|
||||
@@ -557,6 +561,9 @@ public partial class MareHub
|
||||
await _dbContext.AddAsync(otherPermissionToSelf).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
otherPermissionToSelf = existingPermissionsOnDb;
|
||||
}
|
||||
|
||||
await Clients.User(UserUID).Client_GroupPairJoined(new GroupPairFullInfoDto(group.ToGroupData(),
|
||||
pair.ToUserData(), ownPermissionsToOther.ToUserPermissions(setSticky: ownPermissionsToOther.Sticky),
|
||||
otherPermissionToSelf.ToUserPermissions(setSticky: false))).ConfigureAwait(false);
|
||||
|
||||
Reference in New Issue
Block a user