revert whatever
This commit is contained in:
@@ -7,6 +7,7 @@ using MareSynchronos.API.Data;
|
|||||||
using MareSynchronos.API.Dto.Group;
|
using MareSynchronos.API.Dto.Group;
|
||||||
using MareSynchronosShared.Metrics;
|
using MareSynchronosShared.Metrics;
|
||||||
using Microsoft.AspNetCore.SignalR;
|
using Microsoft.AspNetCore.SignalR;
|
||||||
|
using MareSynchronosShared.Data;
|
||||||
|
|
||||||
namespace MareSynchronosServer.Hubs;
|
namespace MareSynchronosServer.Hubs;
|
||||||
|
|
||||||
@@ -251,8 +252,8 @@ public partial class MareHub
|
|||||||
|
|
||||||
private async Task<UserInfo?> GetPairInfo(string uid, string otheruid)
|
private async Task<UserInfo?> GetPairInfo(string uid, string otheruid)
|
||||||
{
|
{
|
||||||
var clientPairs = from cp in _dbContext.ClientPairs
|
var clientPairs = from cp in _dbContext.ClientPairs.Where(u => u.UserUID == uid && u.OtherUserUID == otheruid)
|
||||||
join cp2 in _dbContext.ClientPairs
|
join cp2 in _dbContext.ClientPairs.Where(u => u.OtherUserUID == uid && u.UserUID == otheruid)
|
||||||
on new
|
on new
|
||||||
{
|
{
|
||||||
UserUID = cp.UserUID,
|
UserUID = cp.UserUID,
|
||||||
@@ -264,7 +265,7 @@ public partial class MareHub
|
|||||||
OtherUserUID = cp2.UserUID
|
OtherUserUID = cp2.UserUID
|
||||||
} into joined
|
} into joined
|
||||||
from c in joined.DefaultIfEmpty()
|
from c in joined.DefaultIfEmpty()
|
||||||
where cp.UserUID == uid && cp.OtherUserUID == otheruid
|
where cp.UserUID == uid
|
||||||
select new
|
select new
|
||||||
{
|
{
|
||||||
UserUID = cp.UserUID,
|
UserUID = cp.UserUID,
|
||||||
@@ -274,8 +275,8 @@ public partial class MareHub
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var groupPairs = from gp in _dbContext.GroupPairs
|
var groupPairs = from gp in _dbContext.GroupPairs.Where(u => u.GroupUserUID == uid)
|
||||||
join gp2 in _dbContext.GroupPairs
|
join gp2 in _dbContext.GroupPairs.Where(u => u.GroupUserUID == otheruid)
|
||||||
on new
|
on new
|
||||||
{
|
{
|
||||||
GID = gp.GroupGID
|
GID = gp.GroupGID
|
||||||
@@ -284,7 +285,7 @@ public partial class MareHub
|
|||||||
{
|
{
|
||||||
GID = gp2.GroupGID
|
GID = gp2.GroupGID
|
||||||
}
|
}
|
||||||
where gp.GroupUserUID == uid && gp2.GroupUserUID == otheruid
|
where gp.GroupUserUID == uid
|
||||||
select new
|
select new
|
||||||
{
|
{
|
||||||
UserUID = gp.GroupUserUID,
|
UserUID = gp.GroupUserUID,
|
||||||
@@ -305,6 +306,9 @@ public partial class MareHub
|
|||||||
equals new { UserUID = p.UserUID, OtherUserUID = p.OtherUserUID }
|
equals new { UserUID = p.UserUID, OtherUserUID = p.OtherUserUID }
|
||||||
into otherperms
|
into otherperms
|
||||||
from otherperm in otherperms.DefaultIfEmpty()
|
from otherperm in otherperms.DefaultIfEmpty()
|
||||||
|
where user.UserUID == uid
|
||||||
|
&& u.UID == user.OtherUserUID
|
||||||
|
&& ownperm.UserUID == uid
|
||||||
select new
|
select new
|
||||||
{
|
{
|
||||||
UserUID = user.UserUID,
|
UserUID = user.UserUID,
|
||||||
@@ -331,8 +335,8 @@ public partial class MareHub
|
|||||||
|
|
||||||
private async Task<Dictionary<string, UserInfo>> GetAllPairInfo(string uid)
|
private async Task<Dictionary<string, UserInfo>> GetAllPairInfo(string uid)
|
||||||
{
|
{
|
||||||
var clientPairs = from cp in _dbContext.ClientPairs
|
var clientPairs = from cp in _dbContext.ClientPairs.Where(u => u.UserUID == uid)
|
||||||
join cp2 in _dbContext.ClientPairs
|
join cp2 in _dbContext.ClientPairs.Where(u => u.OtherUserUID == uid)
|
||||||
on new
|
on new
|
||||||
{
|
{
|
||||||
UserUID = cp.UserUID,
|
UserUID = cp.UserUID,
|
||||||
@@ -354,8 +358,8 @@ public partial class MareHub
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var groupPairs = from gp in _dbContext.GroupPairs
|
var groupPairs = from gp in _dbContext.GroupPairs.Where(u => u.GroupUserUID == uid)
|
||||||
join gp2 in _dbContext.GroupPairs
|
join gp2 in _dbContext.GroupPairs.Where(u => u.GroupUserUID != uid)
|
||||||
on new
|
on new
|
||||||
{
|
{
|
||||||
GID = gp.GroupGID
|
GID = gp.GroupGID
|
||||||
@@ -364,7 +368,7 @@ public partial class MareHub
|
|||||||
{
|
{
|
||||||
GID = gp2.GroupGID
|
GID = gp2.GroupGID
|
||||||
}
|
}
|
||||||
where gp.GroupUserUID == uid && gp2.GroupUserUID != uid
|
where gp.GroupUserUID == uid
|
||||||
select new
|
select new
|
||||||
{
|
{
|
||||||
UserUID = gp.GroupUserUID,
|
UserUID = gp.GroupUserUID,
|
||||||
@@ -385,6 +389,9 @@ public partial class MareHub
|
|||||||
equals new { UserUID = p.UserUID, OtherUserUID = p.OtherUserUID }
|
equals new { UserUID = p.UserUID, OtherUserUID = p.OtherUserUID }
|
||||||
into otherperms
|
into otherperms
|
||||||
from otherperm in otherperms.DefaultIfEmpty()
|
from otherperm in otherperms.DefaultIfEmpty()
|
||||||
|
where user.UserUID == uid
|
||||||
|
&& u.UID == user.OtherUserUID
|
||||||
|
&& ownperm.UserUID == uid
|
||||||
select new
|
select new
|
||||||
{
|
{
|
||||||
UserUID = user.UserUID,
|
UserUID = user.UserUID,
|
||||||
|
|||||||
Reference in New Issue
Block a user