mirror of
https://github.com/osukey/osukey.git
synced 2025-04-29 02:37:25 +09:00
Construct notifications client inside ChannelManager
This commit is contained in:
parent
72745656e7
commit
fa18b5f701
@ -151,7 +151,7 @@ namespace osu.Game.Tests.Chat
|
|||||||
|
|
||||||
public ChannelManagerContainer(IAPIProvider apiProvider)
|
public ChannelManagerContainer(IAPIProvider apiProvider)
|
||||||
{
|
{
|
||||||
InternalChild = ChannelManager = new ChannelManager(apiProvider, apiProvider.GetNotificationsConnector());
|
InternalChild = ChannelManager = new ChannelManager(apiProvider);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
{
|
{
|
||||||
linkColour = colours.Blue;
|
linkColour = colours.Blue;
|
||||||
|
|
||||||
var chatManager = new ChannelManager(API, API.GetNotificationsConnector());
|
var chatManager = new ChannelManager(API);
|
||||||
BindableList<Channel> availableChannels = (BindableList<Channel>)chatManager.AvailableChannels;
|
BindableList<Channel> availableChannels = (BindableList<Channel>)chatManager.AvailableChannels;
|
||||||
availableChannels.Add(new Channel { Name = "#english" });
|
availableChannels.Add(new Channel { Name = "#english" });
|
||||||
availableChannels.Add(new Channel { Name = "#japanese" });
|
availableChannels.Add(new Channel { Name = "#japanese" });
|
||||||
|
@ -59,7 +59,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
CachedDependencies = new (Type, object)[]
|
CachedDependencies = new (Type, object)[]
|
||||||
{
|
{
|
||||||
(typeof(ChannelManager), channelManager = new ChannelManager(API, API.GetNotificationsConnector())),
|
(typeof(ChannelManager), channelManager = new ChannelManager(API)),
|
||||||
},
|
},
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
|
@ -250,7 +250,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
public TestContainer(IAPIProvider api, Channel[] channels)
|
public TestContainer(IAPIProvider api, Channel[] channels)
|
||||||
{
|
{
|
||||||
this.channels = channels;
|
this.channels = channels;
|
||||||
ChannelManager = new ChannelManager(api, api.GetNotificationsConnector());
|
ChannelManager = new ChannelManager(api);
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
|
@ -58,7 +58,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
{
|
{
|
||||||
var api = parent.Get<IAPIProvider>();
|
var api = parent.Get<IAPIProvider>();
|
||||||
|
|
||||||
Add(channelManager = new ChannelManager(api, api.GetNotificationsConnector()));
|
Add(channelManager = new ChannelManager(api));
|
||||||
|
|
||||||
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ namespace osu.Game.Tournament.Components
|
|||||||
|
|
||||||
if (manager == null)
|
if (manager == null)
|
||||||
{
|
{
|
||||||
AddInternal(manager = new ChannelManager(api, api.GetNotificationsConnector()));
|
AddInternal(manager = new ChannelManager(api));
|
||||||
Channel.BindTo(manager.CurrentChannel);
|
Channel.BindTo(manager.CurrentChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,10 +74,11 @@ namespace osu.Game.Online.Chat
|
|||||||
private bool channelsInitialised;
|
private bool channelsInitialised;
|
||||||
private ScheduledDelegate ackDelegate;
|
private ScheduledDelegate ackDelegate;
|
||||||
|
|
||||||
public ChannelManager(IAPIProvider api, NotificationsClientConnector connector)
|
public ChannelManager(IAPIProvider api)
|
||||||
{
|
{
|
||||||
this.api = api;
|
this.api = api;
|
||||||
this.connector = connector;
|
|
||||||
|
connector = api.GetNotificationsConnector();
|
||||||
|
|
||||||
CurrentChannel.ValueChanged += currentChannelChanged;
|
CurrentChannel.ValueChanged += currentChannelChanged;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,6 @@ using osu.Game.Localisation;
|
|||||||
using osu.Game.Online;
|
using osu.Game.Online;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Online.Chat;
|
using osu.Game.Online.Chat;
|
||||||
using osu.Game.Online.Notifications;
|
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Overlays.Music;
|
using osu.Game.Overlays.Music;
|
||||||
using osu.Game.Overlays.Notifications;
|
using osu.Game.Overlays.Notifications;
|
||||||
@ -84,7 +83,6 @@ namespace osu.Game
|
|||||||
private ChatOverlay chatOverlay;
|
private ChatOverlay chatOverlay;
|
||||||
|
|
||||||
private ChannelManager channelManager;
|
private ChannelManager channelManager;
|
||||||
private NotificationsClientConnector notificationsClient;
|
|
||||||
|
|
||||||
[NotNull]
|
[NotNull]
|
||||||
protected readonly NotificationOverlay Notifications = new NotificationOverlay();
|
protected readonly NotificationOverlay Notifications = new NotificationOverlay();
|
||||||
@ -680,7 +678,6 @@ namespace osu.Game
|
|||||||
{
|
{
|
||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
SentryLogger.Dispose();
|
SentryLogger.Dispose();
|
||||||
notificationsClient.Dispose();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IDictionary<FrameworkSetting, object> GetFrameworkConfigDefaults()
|
protected override IDictionary<FrameworkSetting, object> GetFrameworkConfigDefaults()
|
||||||
@ -758,7 +755,6 @@ namespace osu.Game
|
|||||||
BackButton.Receptor receptor;
|
BackButton.Receptor receptor;
|
||||||
|
|
||||||
dependencies.CacheAs(idleTracker = new GameIdleTracker(6000));
|
dependencies.CacheAs(idleTracker = new GameIdleTracker(6000));
|
||||||
dependencies.CacheAs(notificationsClient = API.GetNotificationsConnector());
|
|
||||||
|
|
||||||
var sessionIdleTracker = new GameIdleTracker(300000);
|
var sessionIdleTracker = new GameIdleTracker(300000);
|
||||||
sessionIdleTracker.IsIdle.BindValueChanged(idle =>
|
sessionIdleTracker.IsIdle.BindValueChanged(idle =>
|
||||||
@ -885,7 +881,7 @@ namespace osu.Game
|
|||||||
loadComponentSingleFile(dashboard = new DashboardOverlay(), overlayContent.Add, true);
|
loadComponentSingleFile(dashboard = new DashboardOverlay(), overlayContent.Add, true);
|
||||||
loadComponentSingleFile(news = new NewsOverlay(), overlayContent.Add, true);
|
loadComponentSingleFile(news = new NewsOverlay(), overlayContent.Add, true);
|
||||||
var rankingsOverlay = loadComponentSingleFile(new RankingsOverlay(), overlayContent.Add, true);
|
var rankingsOverlay = loadComponentSingleFile(new RankingsOverlay(), overlayContent.Add, true);
|
||||||
loadComponentSingleFile(channelManager = new ChannelManager(API, notificationsClient), AddInternal, true);
|
loadComponentSingleFile(channelManager = new ChannelManager(API), AddInternal, true);
|
||||||
loadComponentSingleFile(chatOverlay = new ChatOverlay(), overlayContent.Add, true);
|
loadComponentSingleFile(chatOverlay = new ChatOverlay(), overlayContent.Add, true);
|
||||||
loadComponentSingleFile(new MessageNotifier(), AddInternal, true);
|
loadComponentSingleFile(new MessageNotifier(), AddInternal, true);
|
||||||
loadComponentSingleFile(Settings = new SettingsOverlay(), leftFloatingOverlayContent.Add, true);
|
loadComponentSingleFile(Settings = new SettingsOverlay(), leftFloatingOverlayContent.Add, true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user