newsfeed

package
v0.0.0-...-3a1e09c Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const MaxContentLength = 280 // twitter

MaxContentLength is the maximum length of content for a news item.

View Source
const OptOutTag = "#private"

Variables

This section is empty.

Functions

This section is empty.

Types

type NewsAuthor

type NewsAuthor struct {
	Username string `json:"username"`
}

NewsAuthor represents the author of a news item.

type NewsContent

type NewsContent string

NewsContent represents the content of a news item.

func (*NewsContent) Sanitize

func (c *NewsContent) Sanitize()

Sanitize sanitizes the content. It does the necessary whitespace stripping.

func (NewsContent) String

func (c NewsContent) String() string

String returns the string representation of the NewsContent.

func (*NewsContent) Validate

func (c *NewsContent) Validate() error

type NewsItem

type NewsItem struct {
	ID                int32       `json:"id"`
	CreatedAt         time.Time   `json:"created_at"`
	EditedAt          *time.Time  `json:"edited_at,omitempty"`
	Author            *NewsAuthor `json:"author"`
	Content           NewsContent `json:"content"`
	ThumbnailURL      string      `json:"thumbnail_url,omitempty"`
	ThumbnailURLSmall string      `json:"thumbnail_url_small,omitempty"`
	TracTicketID      int32       `json:"trac_ticket_id,omitempty"`
}

NewsItem represents a single news item in the news feed.

type PostFromMatrixArgs

type PostFromMatrixArgs struct {
	RoomID  id.RoomID
	EventID id.EventID
}

func (PostFromMatrixArgs) Kind

func (PostFromMatrixArgs) Kind() string

type PostFromMatrixWorker

type PostFromMatrixWorker struct {
	river.WorkerDefaults[PostFromMatrixArgs]
}

func (*PostFromMatrixWorker) Work

type PostToMatrixArgs

type PostToMatrixArgs struct {
	ItemID int32
	// ViaMatrix, if true, indicates that the post is being made via Matrix.
	// Then, the message won't be bridged to the primary news feed room.
	ViaMatrix bool
}

PostToMatrixArgs is the arguments for the PostNewsFeed job. It is also the argument for the message templates.

func (PostToMatrixArgs) Kind

func (PostToMatrixArgs) Kind() string

type PostToMatrixWorker

type PostToMatrixWorker struct {
	river.WorkerDefaults[PostToMatrixArgs]
}

func (*PostToMatrixWorker) Work

Jump to

Keyboard shortcuts

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