Documentation ¶
Index ¶
- func CanConvertTgsToX() error
- func ClipMessage(text string, length int, clippingMessage string) string
- func ConvertTgsToX(data *[]byte, outputFormat string, logger *logrus.Entry) error
- func ConvertWebPToPNG(data *[]byte) error
- func DownloadFile(url string) (*[]byte, error)
- func DownloadFileAuth(url string, auth string) (*[]byte, error)
- func DownloadFileAuthRocket(url, token, userID string) (*[]byte, error)
- func GetAvatar(av map[string]string, userid string, general *config.Protocol) string
- func GetSubLines(message string, maxLineLength int, clippingMessage string) []string
- func HandleDownloadData(logger *logrus.Entry, msg *config.Message, name, comment, url string, ...)
- func HandleDownloadData2(logger *logrus.Entry, msg *config.Message, name, id, comment, url string, ...)
- func HandleDownloadSize(logger *logrus.Entry, msg *config.Message, name string, size int64, ...) error
- func HandleExtra(msg *config.Message, general *config.Protocol) []config.Message
- func LottieBackend() string
- func ParseMarkdown(input string) string
- func RemoveEmptyNewLines(msg string) string
- func SupportsFormat(format string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanConvertTgsToX ¶
func CanConvertTgsToX() error
func ClipMessage ¶
ClipMessage trims a message to the specified length if it exceeds it and adds a warning to the message in case it does so.
func ConvertTgsToX ¶
ConvertTgsToX convert input data (which should be tgs format) to any format supported by libtgsconverter
func ConvertWebPToPNG ¶
ConvertWebPToPNG converts input data (which should be WebP format) to PNG format
func DownloadFile ¶
DownloadFile downloads the given non-authenticated URL.
func DownloadFileAuth ¶
DownloadFileAuth downloads the given URL using the specified authentication token.
func DownloadFileAuthRocket ¶
DownloadFileAuthRocket downloads the given URL using the specified Rocket user ID and authentication token.
func GetAvatar ¶
GetAvatar constructs a URL for a given user-avatar if it is available in the cache.
func GetSubLines ¶
GetSubLines splits messages in newline-delimited lines. If maxLineLength is specified as non-zero GetSubLines will also clip long lines to the maximum length and insert a warning marker that the line was clipped.
TODO: The current implementation has the inconvenient that it disregards word boundaries when splitting but this is hard to solve without potentially breaking formatting and other stylistic effects.
func HandleDownloadData ¶
func HandleDownloadData(logger *logrus.Entry, msg *config.Message, name, comment, url string, data *[]byte, general *config.Protocol)
HandleDownloadData adds the data for a remote file into a Matterbridge gateway message.
func HandleDownloadData2 ¶
func HandleDownloadData2(logger *logrus.Entry, msg *config.Message, name, id, comment, url string, data *[]byte, general *config.Protocol)
HandleDownloadData adds the data for a remote file into a Matterbridge gateway message.
func HandleDownloadSize ¶
func HandleDownloadSize(logger *logrus.Entry, msg *config.Message, name string, size int64, general *config.Protocol) error
HandleDownloadSize checks a specified filename against the configured download blacklist and checks a specified file-size against the configure limit.
func HandleExtra ¶
HandleExtra manages the supplementary details stored inside a message's 'Extra' field map.
func LottieBackend ¶
func LottieBackend() string
func ParseMarkdown ¶
ParseMarkdown takes in an input string as markdown and parses it to html
func RemoveEmptyNewLines ¶
RemoveEmptyNewLines collapses consecutive newline characters into a single one and trims any preceding or trailing newline characters as well.
func SupportsFormat ¶
Types ¶
This section is empty.