Construct notifications client via IAPIProvider

This commit is contained in:
Dan Balasescu
2022-11-01 21:34:34 +09:00
parent 17f482bfc3
commit 5b25ef5f2f
9 changed files with 21 additions and 12 deletions

View File

@ -14,7 +14,6 @@ using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Chat;
using osu.Game.Online.Notifications.Polling;
using osu.Game.Overlays.Chat;
using osuTK.Graphics;
@ -42,7 +41,7 @@ namespace osu.Game.Tests.Visual.Online
{
linkColour = colours.Blue;
var chatManager = new ChannelManager(API, new PollingNotificationsClientConnector(API));
var chatManager = new ChannelManager(API, API.GetNotificationsConnector());
BindableList<Channel> availableChannels = (BindableList<Channel>)chatManager.AvailableChannels;
availableChannels.Add(new Channel { Name = "#english" });
availableChannels.Add(new Channel { Name = "#japanese" });

View File

@ -24,7 +24,6 @@ using osu.Game.Online.API;
using osu.Game.Online.API.Requests;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Chat;
using osu.Game.Online.Notifications.Polling;
using osu.Game.Overlays;
using osu.Game.Overlays.Chat;
using osu.Game.Overlays.Chat.Listing;
@ -60,7 +59,7 @@ namespace osu.Game.Tests.Visual.Online
RelativeSizeAxes = Axes.Both,
CachedDependencies = new (Type, object)[]
{
(typeof(ChannelManager), channelManager = new ChannelManager(API, new PollingNotificationsClientConnector(API))),
(typeof(ChannelManager), channelManager = new ChannelManager(API, API.GetNotificationsConnector())),
},
Children = new Drawable[]
{

View File

@ -16,7 +16,6 @@ using osu.Game.Online.API;
using osu.Game.Online.API.Requests;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Chat;
using osu.Game.Online.Notifications.Polling;
using osu.Game.Overlays;
using osu.Game.Overlays.Notifications;
using osuTK.Input;
@ -251,7 +250,7 @@ namespace osu.Game.Tests.Visual.Online
public TestContainer(IAPIProvider api, Channel[] channels)
{
this.channels = channels;
ChannelManager = new ChannelManager(api, new PollingNotificationsClientConnector(api));
ChannelManager = new ChannelManager(api, api.GetNotificationsConnector());
}
[BackgroundDependencyLoader]

View File

@ -15,7 +15,6 @@ using osu.Framework.Testing;
using osu.Framework.Utils;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Notifications.Polling;
using osu.Game.Overlays.Chat;
using osuTK.Input;
@ -59,7 +58,7 @@ namespace osu.Game.Tests.Visual.Online
{
var api = parent.Get<IAPIProvider>();
Add(channelManager = new ChannelManager(api, new PollingNotificationsClientConnector(api)));
Add(channelManager = new ChannelManager(api, api.GetNotificationsConnector()));
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));