mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07: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:
parent
34d70980e8
commit
e2ab8db958
8 changed files with 190 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue