Add some sessions (#5052)

* Add AccountEdit

* Add PasswordChange

* Cleanup

* Add SessionService.accountImage

* Add SessionService.message

* Add SessionService.getUserInfo

* Lint
This commit is contained in:
Zach H
2024-06-14 23:06:50 -04:00
committed by GitHub
parent 34d70980e8
commit e2ab8db958
8 changed files with 190 additions and 0 deletions

View File

@@ -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);
}
}