update naming of functions, add option to get count of unread messages of user

This commit is contained in:
2026-04-21 19:50:14 +02:00
parent a554c870ef
commit 422c4eb419
13 changed files with 178 additions and 484 deletions
+11 -11
View File
@@ -11,23 +11,23 @@ import (
type postType uint8
const (
postNormal postType = iota
postFile
postAvatar
postProfileBg
normal postType = iota
file
avatar
profileBg
)
func validCheckWithResponseOnFail(response *http.ResponseWriter, request *http.Request, pt postType) bool {
var maxSize int64
switch pt {
case postFile:
maxSize = int64(globals.MaxPostWithFileBytes)
case postAvatar:
maxSize = int64(globals.MaxPostWithAvatar)
case postProfileBg:
maxSize = int64(globals.MaxPostWithProfileBg)
case file:
maxSize = int64(globals.MaxRequestWithFileBytes)
case avatar:
maxSize = int64(globals.MaxRequestWithAvatarBytes)
case profileBg:
maxSize = int64(globals.MaxRequestWithProfileBgBytes)
default:
maxSize = int64(globals.MaxPostBytes)
maxSize = int64(globals.MaxRequestBytes)
}
if request.ContentLength > maxSize {