2021-03-19 09:15:45 +00:00
|
|
|
package requests
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
"github.com/status-im/status-go/eth-node/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
var ErrBanUserFromCommunityInvalidCommunityID = errors.New("ban-user-from-community: invalid community id")
|
|
|
|
var ErrBanUserFromCommunityInvalidUser = errors.New("ban-user-from-community: invalid user id")
|
|
|
|
|
|
|
|
type BanUserFromCommunity struct {
|
2024-02-22 10:25:13 +00:00
|
|
|
CommunityID types.HexBytes `json:"communityId"`
|
|
|
|
User types.HexBytes `json:"user"`
|
|
|
|
DeleteAllMessages bool `json:"deleteAllMessages"`
|
2021-03-19 09:15:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (b *BanUserFromCommunity) Validate() error {
|
|
|
|
if len(b.CommunityID) == 0 {
|
|
|
|
return ErrBanUserFromCommunityInvalidCommunityID
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(b.User) == 0 {
|
|
|
|
return ErrBanUserFromCommunityInvalidUser
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|