sharp-chat/SharpChat.Common/DataProvider/Null/NullBanClient.cs

31 lines
1.1 KiB
C#

using SharpChat.Bans;
using SharpChat.Users.Remote;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
namespace SharpChat.DataProvider.Null {
public class NullBanClient : IBanClient {
public void CheckBan(IRemoteUser subject, IPAddress ipAddress, Action<IBanRecord> onSuccess, Action<Exception> onFailure) {
onSuccess(null);
}
public void CreateBan(IRemoteUser subject, IRemoteUser moderator, bool perma, TimeSpan duration, string reason, Action<bool> onSuccess, Action<Exception> onFailure) {
onSuccess(true);
}
public void GetBanList(Action<IEnumerable<IBanRecord>> onSuccess, Action<Exception> onFailure) {
onSuccess(Enumerable.Empty<IBanRecord>());
}
public void RemoveBan(IRemoteUser subject, Action<bool> onSuccess, Action<Exception> onFailure) {
onSuccess(false);
}
public void RemoveBan(IPAddress ipAddress, Action<bool> onSuccess, Action<Exception> onFailure) {
onSuccess(false);
}
}
}