helpers

package
v0.0.0-...-327bd39 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLogger

func AddLogger(l zerolog.Logger)

AddLogger sets the logger for the sublibrary

func BuildCallRequestMessage

func BuildCallRequestMessage(users []string, expiry uint64, srvuid string) ([]byte, string, error)

func BuildProcessedMessage

func BuildProcessedMessage(messageUid string, peer_uid string, processed int64) (*meowlib.PackedUserMessage, string, error)

func BuildReceivedMessage

func BuildReceivedMessage(messageUid string, peer_uid string, received int64) (*meowlib.PackedUserMessage, string, error)

func ConsumeInboxFile

func ConsumeInboxFile(messageFilename string) ([]string, []string, string, error)

ConsumeInboxFile

func CreateAndStoreUserMessage

func CreateAndStoreUserMessage(message string, peer_uid string, replyToUid string, filelist []string) (*meowlib.PackedUserMessage, string, int64, string, error)

CreateAndStoreUserMessage creates, signs, and stores an outbound message for peer_uid. It returns the packed (encrypted) form ready for server transport, the peer DB file UUID (dbFile), the SQLite row ID (dbId), an error context string, and any error.

func CreateStorePackUserMessageForServer

func CreateStorePackUserMessageForServer(message string, srvuid string, peer_uid string, replyToUid string, filelist []string) ([]byte, string, error)

func CreateUserMessageAndSendJob

func CreateUserMessageAndSendJob(storagePath, message, peerUid, replyToUid string, filelist []string, servers []client.Server, timeout int) error

CreateUserMessageAndSendJob is the single entry point for sending a message. It creates and stores the user message, serialises the packed form to storagePath/outbox/{dbFile}_{dbId}, and enqueues a SendJob in storagePath/queues/{peerUid}.

func LoadMessagesHistory

func LoadMessagesHistory(peer_uid string) ([]client.InternalUserMessage, string, error)

func LongPollAllServerJobs

func LongPollAllServerJobs(storage_path string, jobs []client.RequestsJob, timeout int, longPoll bool) (int, string, error)

LongPollAllSerevrJobs checks for messages on a all servers defived in job file

func MarkMessageProcessed

func MarkMessageProcessed(peerUid string, dbFile string, dbId int64) error

MarkMessageProcessed stamps the stored message with a processed timestamp of now(), persists the updated record, and — if the peer has SendProcessingAck enabled and the message carries a UUID — enqueues a processed acknowledgment to the peer's contact pull servers.

func PackMessageForServer

func PackMessageForServer(packedMsg *meowlib.PackedUserMessage, srvuid string) ([]byte, string, error)

func PollServer

func PollServer(storage_path string, job *client.RequestsJob, timeout int, longPoll bool) (int, string, error)

PollServer checks for messages on a single server

func ProcessSendQueues

func ProcessSendQueues(storagePath string) int

ProcessSendQueues discovers every queue DB file under storagePath/queues/ and processes each queue concurrently in its own goroutine. Call this from the send isolate on wake-up notification or on a periodic timer. It returns the total number of successfully sent messages across all queues.

func ProcessSentMessages

func ProcessSentMessages(storagePath string) int

ProcessSentMessages scans every send queue under storagePath/queues/, updates the message storage entry with server delivery info for each sent job, then removes the job from the queue. Returns the number of messages updated.

The message DB location is recovered from the job's File basename, which must follow the naming convention produced by CreateUserMessageAndSendJob:

outbox/{dbFile}_{dbId}

func ReadAckMessageResponse

func ReadAckMessageResponse()

func ReadCallRequestResponseMessage

func ReadCallRequestResponseMessage(data []byte, srvuid string) (*meowlib.VideoData, string, error)

func SaveCheckJobs

func SaveCheckJobs() (string, error)

SaveCheckJobs

Types

type ReceivedMessage

type ReceivedMessage struct {
	Text string

	Server        string
	Sent          uint64
	Received      uint64
	LocalUuid     string
	LocalSequence uint64
	AppData       string
	Location      meowlib.Location
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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