status-go/protocol/requests/ban_user_from_community.go
Andrea Maria Piana d22182ea82 Ban user from community
This commit introduces a new endpoint to ban a user from a community.

Messages from this user will be ignored.
2021-03-24 09:29:21 +01:00

28 lines
644 B
Go

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 {
CommunityID types.HexBytes `json:"communityId"`
User types.HexBytes `json:"user"`
}
func (b *BanUserFromCommunity) Validate() error {
if len(b.CommunityID) == 0 {
return ErrBanUserFromCommunityInvalidCommunityID
}
if len(b.User) == 0 {
return ErrBanUserFromCommunityInvalidUser
}
return nil
}