1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-18 08:00:59 -05:00

Revert filescoped (#2227)

* Revert "Add git blame entry (#2226)"

This reverts commit 239286737d.

* Revert "Turn on file scoped namespaces (#2225)"

This reverts commit 34fb4cca2a.
This commit is contained in:
Justin Baur
2022-08-29 15:53:48 -04:00
committed by GitHub
parent 239286737d
commit bae03feffe
1208 changed files with 74317 additions and 73126 deletions

View File

@ -2,47 +2,48 @@
using Bit.Core.Settings;
using Microsoft.AspNetCore.Authorization;
namespace Bit.Notifications;
[Authorize("Application")]
public class NotificationsHub : Microsoft.AspNetCore.SignalR.Hub
namespace Bit.Notifications
{
private readonly ConnectionCounter _connectionCounter;
private readonly GlobalSettings _globalSettings;
public NotificationsHub(ConnectionCounter connectionCounter, GlobalSettings globalSettings)
[Authorize("Application")]
public class NotificationsHub : Microsoft.AspNetCore.SignalR.Hub
{
_connectionCounter = connectionCounter;
_globalSettings = globalSettings;
}
private readonly ConnectionCounter _connectionCounter;
private readonly GlobalSettings _globalSettings;
public override async Task OnConnectedAsync()
{
var currentContext = new CurrentContext(null);
await currentContext.BuildAsync(Context.User, _globalSettings);
if (currentContext.Organizations != null)
public NotificationsHub(ConnectionCounter connectionCounter, GlobalSettings globalSettings)
{
foreach (var org in currentContext.Organizations)
{
await Groups.AddToGroupAsync(Context.ConnectionId, $"Organization_{org.Id}");
}
_connectionCounter = connectionCounter;
_globalSettings = globalSettings;
}
_connectionCounter.Increment();
await base.OnConnectedAsync();
}
public override async Task OnDisconnectedAsync(Exception exception)
{
var currentContext = new CurrentContext(null);
await currentContext.BuildAsync(Context.User, _globalSettings);
if (currentContext.Organizations != null)
public override async Task OnConnectedAsync()
{
foreach (var org in currentContext.Organizations)
var currentContext = new CurrentContext(null);
await currentContext.BuildAsync(Context.User, _globalSettings);
if (currentContext.Organizations != null)
{
await Groups.RemoveFromGroupAsync(Context.ConnectionId, $"Organization_{org.Id}");
foreach (var org in currentContext.Organizations)
{
await Groups.AddToGroupAsync(Context.ConnectionId, $"Organization_{org.Id}");
}
}
_connectionCounter.Increment();
await base.OnConnectedAsync();
}
public override async Task OnDisconnectedAsync(Exception exception)
{
var currentContext = new CurrentContext(null);
await currentContext.BuildAsync(Context.User, _globalSettings);
if (currentContext.Organizations != null)
{
foreach (var org in currentContext.Organizations)
{
await Groups.RemoveFromGroupAsync(Context.ConnectionId, $"Organization_{org.Id}");
}
}
_connectionCounter.Decrement();
await base.OnDisconnectedAsync(exception);
}
_connectionCounter.Decrement();
await base.OnDisconnectedAsync(exception);
}
}