mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-05 01:27:38 -08:00
Add some sessions (#5052)
* Add AccountEdit * Add PasswordChange * Cleanup * Add SessionService.accountImage * Add SessionService.message * Add SessionService.getUserInfo * Lint
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { SessionCommands } from 'websocket';
|
||||
import { common } from 'protobufjs';
|
||||
import IBytesValue = common.IBytesValue;
|
||||
|
||||
export default class SessionService {
|
||||
static addToBuddyList(userName: string) {
|
||||
@@ -16,4 +18,24 @@ export default class SessionService {
|
||||
static removeFromIgnoreList(userName: string) {
|
||||
SessionCommands.removeFromIgnoreList(userName);
|
||||
}
|
||||
|
||||
static changeAccountPassword(oldPassword: string, newPassword: string, hashedNewPassword?: string): void {
|
||||
SessionCommands.accountPassword(oldPassword, newPassword, hashedNewPassword);
|
||||
}
|
||||
|
||||
static changeAccountDetails(passwordCheck: string, realName?: string, email?: string, country?: string): void {
|
||||
SessionCommands.accountEdit(passwordCheck, realName, email, country);
|
||||
}
|
||||
|
||||
static changeAccountImage(image: IBytesValue): void {
|
||||
SessionCommands.accountImage(image);
|
||||
}
|
||||
|
||||
static sendDirectMessage(userName: string, message: string): void {
|
||||
SessionCommands.message(userName, message);
|
||||
}
|
||||
|
||||
static getUserInfo(userName: string): void {
|
||||
SessionCommands.getUserInfo(userName);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user