messages

package
v0.0.0-...-c4d1d87 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxMessageLengthWithImage    = 131072
	MaxMessageLengthWithoutImage = 5000
)

Default Message size limits for Murmur

Variables

This section is empty.

Functions

func FindCoverArtPath

func FindCoverArtPath(playPath string) string

func GenerateCoverArtImg

func GenerateCoverArtImg(path string) string

GenerateCoverArtImg creates a base64 encoded html <img> TODO: Find a way to get generated cover art to follow the larger limits (for messages that contain images)

for now, we make sure the image is less than maxSize to be well below the 5000 text limit the mumble server
imposes by default for text messages (that contain no image)

TODO: Option to override limits for servers with modified settings

func GetLess

func GetLess(sender string) (output []string)

func GetLessTable

func GetLessTable(sender string) string

func GetMore

func GetMore(sender string) (output []string)

func GetMoreTable

func GetMoreTable(sender string) string

func ResetMore

func ResetMore(sender string)

func SaveMoreRows

func SaveMoreRows(sender string, rows []string, table MessageTable) int

SaveMoreRows adds the first rows limited by config.MaxLines to the provided table and then saves the additional rows into the 'more' buffer

func SendMore

func SendMore(sender, text string)

Types

type MessageTable

type MessageTable struct {
	// contains filtered or unexported fields
}

func MakeTable

func MakeTable(header string, columns ...string) MessageTable

MakeTable generates a html table with the first parameter as a header on top of the table and subsequent as column headers for the table

func (MessageTable) AddRow

func (msgTbl MessageTable) AddRow(cells ...string)

AddRow adds cells to a MessageTable

func (MessageTable) String

func (msgTbl MessageTable) String() string

String escapes the tbody and table elements of a MessageTable and then returns a string of the MessageTable

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL