From 48a869cb570417d7f946359c22a7c88d57d5cafb Mon Sep 17 00:00:00 2001 From: John Brooks Date: Tue, 27 Dec 2016 17:56:35 -0700 Subject: [PATCH] core: Actually define maximum nick/message lengths --- core/sanitize.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/sanitize.go b/core/sanitize.go index ed43edc..5890675 100644 --- a/core/sanitize.go +++ b/core/sanitize.go @@ -5,6 +5,12 @@ import ( "unicode/utf8" ) +const ( + // Consistent with protocol's ContactRequestChannel + MaxMessageLength = 2000 + MaxNicknameLength = 30 +) + // IsNicknameAcceptable returns true for strings that are usable as contact nicknames. // A nickname is acceptable if it: // - Is composed of only valid UTF-8 sequences