github.com/status-im/status-go@v1.1.0/protocol/requests/mute_chat_request.go (about)

     1  package requests
     2  
     3  import (
     4  	"errors"
     5  )
     6  
     7  var ErrInvalidMuteChatParams = errors.New("mute-chat: invalid params")
     8  
     9  type MutingVariation int
    10  
    11  type MuteChat struct {
    12  	ChatID    string
    13  	MutedType MutingVariation
    14  }
    15  
    16  func (a *MuteChat) Validate() error {
    17  	if len(a.ChatID) == 0 {
    18  		return ErrInvalidMuteChatParams
    19  	}
    20  
    21  	if a.MutedType < 0 {
    22  		return ErrInvalidMuteChatParams
    23  	}
    24  
    25  	return nil
    26  }