Added new requests for chat init

This commit is contained in:
Maciej Krzyżanowski 2024-04-05 00:56:55 +02:00
parent 9c0e3e607f
commit b9fe4a7094

View File

@ -13,6 +13,10 @@ const (
ListPeersResID = 128 + ListPeersReqID ListPeersResID = 128 + ListPeersReqID
AuthReqID = 3 AuthReqID = 3
AuthResID = 128 + AuthReqID AuthResID = 128 + AuthReqID
StartChatAReqID = 4
StartChatBReqID = 5
StartChatCReqID = 6
StartChatDReqID = 7
) )
// Requests & responses subtypes // Requests & responses subtypes
@ -134,3 +138,39 @@ type AuthResponse struct {
func (AuthResponse) ID() int { func (AuthResponse) ID() int {
return AuthResID return AuthResID
} }
// "Stateful" requests like these need to have some information identifying what operation they are linked to
// There may be some errors if two requests are sent by one host to the same other host... may they?
type StartChatARequest struct {
Nickname string `json:"nickname"`
}
func (StartChatARequest) ID() int {
return StartChatAReqID
}
type StartChatBRequest struct {
Nickname string `json:"nickname"`
}
func (StartChatBRequest) ID() int {
return StartChatBReqID
}
type StartChatCRequest struct {
Nickname string `json:"nickname"`
}
func (StartChatCRequest) ID() int {
return StartChatCReqID
}
type StartChatDRequest struct {
Nickname string `json:"nickname"`
Accept bool `json:"accept"`
}
func (StartChatDRequest) ID() int {
return StartChatDReqID
}