This is the v1 version, had the v2 before.

This commit is contained in:
2025-05-01 12:02:19 +03:00
parent bcc3f95e8e
commit 0e253ba422
130 changed files with 18061 additions and 2179 deletions

29
backend/appendlimit.go Normal file
View File

@@ -0,0 +1,29 @@
package backend
import (
"errors"
)
// An error that should be returned by User.CreateMessage when the message size
// is too big.
var ErrTooBig = errors.New("Message size exceeding limit")
// A backend that supports retrieving per-user message size limits.
type AppendLimitBackend interface {
Backend
// Get the fixed maximum message size in octets that the backend will accept
// when creating a new message. If there is no limit, return nil.
CreateMessageLimit() *uint32
}
// A user that supports retrieving per-user message size limits.
type AppendLimitUser interface {
User
// Get the fixed maximum message size in octets that the backend will accept
// when creating a new message. If there is no limit, return nil.
//
// This overrides the global backend limit.
CreateMessageLimit() *uint32
}