Expand description
Some tools and enhancements to the used libraries, there should be no references to Context and other “larger” entities here.
Structs
- Represents an email address, right now just the
name@domain
portion. - Struct containing all mailto information
Constants
- Compressor/decompressor buffer size.
Traits
Functions
- Compresses
buf
toVec
usingbrotli
. Note that it handles an emptybuf
as a special value that remains empty after compression, otherwise brotli would add its metadata to it which is not nice because this function is used for compression of strings stored in the db and empty strings are common there. This approach is not strictly correct because nowhere in the brotli documentation is said that an empty buffer can’t be a result of compression of some input, but i think this will never break. - Decompresses
buf
toVec
usingbrotli
. Seebuf_compress()
for why we don’t pass an empty buffer to brotli decompressor. - Generate an ID. The generated ID should be as short and as unique as possible:
- Function generates a Message-ID that can be used for a new outgoing message.
- Returns a timestamp that is guaranteed to be unique.
- Converts duration to string representation suitable for logs.
- Extract the group id (grpid) from a message id (mid)
- Expand paths relative to $BLOBDIR into absolute paths.
- Returns the
(width, height)
of the given image buffer. - Returns the last release timestamp as a unix timestamp compatible for comparison with time() and database times.
- Sanitizes user input
- Parse mailto urls
- parses “receive”-headers
- Reads directory and returns a vector of directory entries.
- Reads the file and returns its context as a byte vector.
- If
collection
contains exactly one element, return this element. Otherwise, return None. - Returns the current smeared timestamp,
- This method strips all occurrences of the RTLO Unicode character. Why is this needed?
- time 🔒
- Converts Unix time in seconds to a local timestamp string.
- truncate 🔒Shortens a string to a specified length and adds “[…]” to the end of the shortened string.
- Shortens a string to a specified line count and adds “[…]” to the end of the shortened string.
- Write a the given content to provided file path.