Interface IServerAdmin
What the dashboard shows of a server and changes on it: its state, accounts, rooms and reports. LocalServerAdmin works in the server's own process; HttpServerAdmin over the admin socket or the network, for uniform-chat-server manage.
Assembly: uniform-chat-server.dll
public interface IServerAdmin
Methods
|
Edit this page
View Source
Create an account named name, the part before the colon; return its user ID; fail when it exists.
Declaration
Task<string> CreateUserAsync(string name, string password, bool admin, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Declaration
Task DeleteReportAsync(long reportId, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Return the users' reports, newest first; resolved ones with includeResolved.
Declaration
Task<IReadOnlyList<Report>> GetReportsAsync(bool includeResolved, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Return the server's rooms.
Declaration
Task<IReadOnlyList<AdminRoom>> GetRoomsAsync(CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Return the server's state; what the connection cannot see is null.
Declaration
Task<ServerSnapshot> GetSnapshotAsync(CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Return the local accounts, deactivated ones too.
Declaration
Task<IReadOnlyList<AdminUser>> GetUsersAsync(CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Set a new password, logging out every device of the account.
Declaration
Task ResetPasswordAsync(string userId, string password, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Give or take server admin rights.
Declaration
Task SetAdminAsync(string userId, bool admin, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Deactivate an account, or reactivate it.
Declaration
Task SetDeactivatedAsync(string userId, bool deactivated, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Lock an account, or unlock it.
Declaration
Task SetLockedAsync(string userId, bool locked, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
List a room in the public room directory, or take it out.
Declaration
Task SetPublishedAsync(string roomId, bool published, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Resolve a report, or open it again.
Declaration
Task SetResolvedAsync(long reportId, bool resolved, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Suspend an account, or end its suspension.
Declaration
Task SetSuspendedAsync(string userId, bool suspended, CancellationToken cancellationToken)
Parameters
Returns