github.com/status-im/status-go@v1.1.0/protocol/requests/create_profile_chat.go (about) 1 package requests 2 3 import ( 4 "errors" 5 6 "github.com/status-im/status-go/deprecation" 7 ) 8 9 // Deprecated: errCreateProfileChatInvalidID shouldn't be used 10 // and is only left here in case profile chat feature is re-introduced. 11 var errCreateProfileChatInvalidID = errors.New("create-public-chat: invalid id") 12 13 // Deprecated: CreateProfileChat shouldn't be used 14 // and is only left here in case profile chat feature is re-introduced. 15 type CreateProfileChat struct { 16 ID string `json:"id"` 17 } 18 19 // Deprecated: Validate shouldn't be used 20 // and is only left here in case profile chat feature is re-introduced. 21 func (c *CreateProfileChat) Validate() error { 22 // Return error to prevent usafe of deprecated function 23 if deprecation.ChatProfileDeprecated { 24 return errors.New("profile chats are deprecated") 25 } 26 27 if len(c.ID) == 0 { 28 return errCreateProfileChatInvalidID 29 } 30 31 return nil 32 }