mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
WebClient: refactor protobuf method structure (#5014)
This commit is contained in:
parent
f174614496
commit
be5d42baba
53 changed files with 1014 additions and 1263 deletions
21
webclient/src/websocket/commands/session/addToList.ts
Normal file
21
webclient/src/websocket/commands/session/addToList.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import webClient from '../../WebClient';
|
||||
|
||||
export function addToBuddyList(userName: string): void {
|
||||
addToList('buddy', userName);
|
||||
}
|
||||
|
||||
export function addToIgnoreList(userName: string): void {
|
||||
addToList('ignore', userName);
|
||||
}
|
||||
|
||||
export function addToList(list: string, userName: string): void {
|
||||
const CmdAddToList = webClient.protobuf.controller.Command_AddToList.create({ list, userName });
|
||||
|
||||
const sc = webClient.protobuf.controller.SessionCommand.create({
|
||||
'.Command_AddToList.ext': CmdAddToList
|
||||
});
|
||||
|
||||
webClient.protobuf.sendSessionCommand(sc, ({ responseCode }) => {
|
||||
// @TODO: filter responseCode, pop snackbar for error
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue