mirror of
https://github.com/Caraxi/mare.server.git
synced 2026-01-02 00:33:39 +01:00
potentially fix group join
This commit is contained in:
parent
209a33d6f9
commit
272f1afd9e
1 changed files with 19 additions and 12 deletions
|
|
@ -542,19 +542,26 @@ public partial class MareHub
|
||||||
var otherPermissionToSelf = userinfo?.OtherPermissions ?? null;
|
var otherPermissionToSelf = userinfo?.OtherPermissions ?? null;
|
||||||
if (otherPermissionToSelf == null)
|
if (otherPermissionToSelf == null)
|
||||||
{
|
{
|
||||||
var otherPreferred = await _dbContext.GroupPairPreferredPermissions.SingleAsync(u => u.GroupGID == group.GID && u.UserUID == pair.GroupUserUID).ConfigureAwait(false);
|
var existingPermissionsOnDb = await _dbContext.Permissions.SingleOrDefaultAsync(p => p.UserUID == pair.GroupUserUID && p.OtherUserUID == UserUID).ConfigureAwait(false);
|
||||||
otherPermissionToSelf = new()
|
|
||||||
{
|
|
||||||
UserUID = pair.GroupUserUID,
|
|
||||||
OtherUserUID = UserUID,
|
|
||||||
DisableAnimations = otherPreferred.DisableAnimations,
|
|
||||||
DisableSounds = otherPreferred.DisableSounds,
|
|
||||||
DisableVFX = otherPreferred.DisableVFX,
|
|
||||||
IsPaused = otherPreferred.IsPaused,
|
|
||||||
Sticky = false
|
|
||||||
};
|
|
||||||
|
|
||||||
await _dbContext.AddAsync(otherPermissionToSelf).ConfigureAwait(false);
|
if (existingPermissionsOnDb == null)
|
||||||
|
{
|
||||||
|
var otherPreferred = await _dbContext.GroupPairPreferredPermissions.SingleAsync(u => u.GroupGID == group.GID && u.UserUID == pair.GroupUserUID).ConfigureAwait(false);
|
||||||
|
otherPermissionToSelf = new()
|
||||||
|
{
|
||||||
|
UserUID = pair.GroupUserUID,
|
||||||
|
OtherUserUID = UserUID,
|
||||||
|
DisableAnimations = otherPreferred.DisableAnimations,
|
||||||
|
DisableSounds = otherPreferred.DisableSounds,
|
||||||
|
DisableVFX = otherPreferred.DisableVFX,
|
||||||
|
IsPaused = otherPreferred.IsPaused,
|
||||||
|
Sticky = false
|
||||||
|
};
|
||||||
|
|
||||||
|
await _dbContext.AddAsync(otherPermissionToSelf).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
otherPermissionToSelf = existingPermissionsOnDb;
|
||||||
}
|
}
|
||||||
|
|
||||||
await Clients.User(UserUID).Client_GroupPairJoined(new GroupPairFullInfoDto(group.ToGroupData(),
|
await Clients.User(UserUID).Client_GroupPairJoined(new GroupPairFullInfoDto(group.ToGroupData(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue