core: Actually define maximum nick/message lengths

This commit is contained in:
John Brooks 2016-12-27 17:56:35 -07:00
parent 7dbac1cdf7
commit 48a869cb57
1 changed files with 6 additions and 0 deletions

View File

@ -5,6 +5,12 @@ import (
"unicode/utf8" "unicode/utf8"
) )
const (
// Consistent with protocol's ContactRequestChannel
MaxMessageLength = 2000
MaxNicknameLength = 30
)
// IsNicknameAcceptable returns true for strings that are usable as contact nicknames. // IsNicknameAcceptable returns true for strings that are usable as contact nicknames.
// A nickname is acceptable if it: // A nickname is acceptable if it:
// - Is composed of only valid UTF-8 sequences // - Is composed of only valid UTF-8 sequences