store

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const MaxMessageCacheSize = 50

Variables

This section is empty.

Functions

func CloseSettings

func CloseSettings() error

func ExtractMessageText

func ExtractMessageText(msg *waE2E.Message) string

ExtractMessageText extracts a text representation from a WhatsApp message

func GetSettings

func GetSettings() map[string]any

func LoadSettings

func LoadSettings()

func SaveSettings

func SaveSettings(data map[string]any) error

Types

type ChatMessage

type ChatMessage struct {
	JID         types.JID
	MessageText string
	MessageTime int64
}

type Message

type Message struct {
	Info    types.MessageInfo
	Content *waE2E.Message
}

type MessageStore

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

func NewMessageStore

func NewMessageStore() (*MessageStore, error)

func (*MessageStore) GetChatList

func (ms *MessageStore) GetChatList() []ChatMessage

func (*MessageStore) GetMessage

func (ms *MessageStore) GetMessage(chatJID types.JID, messageID string) *Message

func (*MessageStore) GetMessageByID

func (ms *MessageStore) GetMessageByID(messageID string) *Message

GetMessageByID searches for a message by ID across all chats

func (*MessageStore) GetMessagesPaged

func (ms *MessageStore) GetMessagesPaged(jid types.JID, beforeTimestamp int64, limit int) []Message

GetMessagesPaged returns a page of messages for a chat beforeTimestamp: only return messages before this timestamp (0 = latest) limit: max number of messages to return Returns messages in chronological order (oldest first within the page) todo: optimize with caching

func (*MessageStore) ProcessMessageEvent

func (ms *MessageStore) ProcessMessageEvent(msg *events.Message)

Jump to

Keyboard shortcuts

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