helpers

package
v0.0.0-...-b722a91 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: AGPL-3.0 Imports: 14 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 BuildAckMessage

func BuildAckMessage(messageUid string, srvuid string, peer_uid string, received int64, processed int64) ([]byte, string, error)

func BuildCallRequestMessage

func BuildCallRequestMessage(users []string, expiry uint64, srvuid string) ([]byte, 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, error)

func CreateStorePackUserMessageForServer

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

func GetPeerLastMessageDbInfo

func GetPeerLastMessageDbInfo(peer_uid string) (dbFile string, dbId int64, errTxt string, err error)

GetPeerLastMessageDbInfo returns the DB location of the most recently stored message for the given peer. Call this immediately after CreateAndStoreUserMessage to get the values needed for SendJob.MessageDbFile and SendJob.MessageDbId.

func InvitationAnswer

func InvitationAnswer(cc *meowlib.ContactCard, nickname string, myNickname string, serverUids []string) (*client.Peer, string, error)

InvitationAnswer

func InvitationAnswerFile

func InvitationAnswerFile(invitationFile string, nickname string, myNickname string, serverUids []string) (string, error)

InvitationAnswerFile

func InvitationAnswerMessage

func InvitationAnswerMessage(invitationId string, invitationServerUid string, timeout int) ([]byte, string, error)

InvitationAnswerMessage

func InvitationAnswerMessageReadResponse

func InvitationAnswerMessageReadResponse(invitationData []byte, invitationServerUid string) (*meowlib.Invitation, string, error)

InvitationAnswerMessageReadResponse Called by the invitation receiver invitationData: the data received from the server invitationServerUid: the uid of the server holding the invitation

func InvitationCreateFile

func InvitationCreateFile(name string, myNickname string, invitationMessage string, serverUids []string, format string) (*client.Peer, string, error)

InvitationCreateFile creates a new peer and writes the invitation to a file Called by invitation initiator name: the name of the peer myNickname: my nickname for that peer invitationMessage: the message to send to the peer serverUids: the list of server uids format: the format of the file (qr or mwiv)

func InvitationCreateMessage

func InvitationCreateMessage(invitationId string, invitationServerUid string, timeOut int, urlLen int, password string) ([]byte, string, error)

InvitationCreateMessage creates a new invitation message for an invited peer Called by invitation initiator invitationId: the invitation id of the peer invitationServerUid: the uid of the server for sending the invitation timeOut: the timeout for the invitation urlLen: the length of the invitation url password: the password for the invitation

func InvitationCreatePeer

func InvitationCreatePeer(name string, myNickname string, invitationMessage string, serverUids []string) (*client.Peer, string, error)

InvitationCreatePeer creates a new peer and returns it Called by invitation initiator name: the name of the peer myNickname: my nickname for that peer invitationMessage: the message to send to the peer serverUids: the list of server uids

func InvitationCreateReadResponse

func InvitationCreateReadResponse(invitationServerUid string, invitationResponse []byte) (*meowlib.Invitation, string, error)

InvitationCreateReadResponse reads the response of an invitation creation (url, expiry) Called by invitation initiator invitationServerUid: the uid of the server where we sent the invitation invitationResponse: the response we got from the server

func InvitationGetMessage

func InvitationGetMessage(invitationUrl string, serverPublicKey string, invitationPassword string) ([]byte, string, error)

InvitationGetMessage Called by the invitation receiver invitationUrl: the url of server holding the invitation serverPublicKey: the public key of the server holding the invitation invitationPassword: the password of the invitation

func InvitationGetMessageReadResponse

func InvitationGetMessageReadResponse(invitationData []byte, invitationServerUid string) (*meowlib.ContactCard, string, error)

InvitationGetMessageReadResponse Called by the invitation receiver invitationData: the data received from the server invitationServerUid: the uid of the server holding the invitation

func InvitationSetUrlInfo

func InvitationSetUrlInfo(invitationId string, url string, expiry int64)

InvitationSetUrlInfo sets the url info for an invitation Called by invitation initiator invitationId: the invitation id of the peer url: the url of the invitation we got from the server

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 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.

Each SendJob must have MessageDbFile and MessageDbId set (populated via GetPeerLastMessageDbInfo right after the message is stored).

func ReadAckMessageResponse

func ReadAckMessageResponse()

func ReadCallRequestResponseMessage

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

func SaveCheckJobs

func SaveCheckJobs() (string, error)

SaveCheckJobs

func WriteSendJob

func WriteSendJob(storagePath string, job *client.SendJob) error

WriteSendJob enqueues a SendJob from the main Flutter isolate. It is a thin wrapper over client.PushSendJob and is safe to call concurrently with ProcessSendQueues.

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