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

33 lines
1.1 KiB
C#

using SharpChat.Users;
using SharpChat.Users.Remote;
using System;
using System.Collections.Generic;
namespace SharpChat.DataProvider.Null {
public class NullUserClient : IRemoteUserClient {
public void AuthenticateUser(UserAuthRequest request, Action<IUserAuthResponse> onSuccess, Action<Exception> onFailure) {
if(request.Token.StartsWith(@"FAIL:")) {
onFailure(new UserAuthFailedException(request.Token[5..]));
return;
}
onSuccess(new NullUserAuthResponse(request));
}
public void BumpUsers(IEnumerable<UserBumpInfo> users, Action onSuccess, Action<Exception> onFailure) {
onSuccess();
}
public void ResolveUser(long userId, Action<IRemoteUser> onSuccess, Action<Exception> onFailure) {
onSuccess(null);
}
public void ResolveUser(string userName, Action<IRemoteUser> onSuccess, Action<Exception> onFailure) {
onSuccess(null);
}
public void ResolveUser(IUser localUser, Action<IRemoteUser> onSuccess, Action<Exception> onFailure) {
onSuccess(null);
}
}
}