Documentation ¶
Index ¶
- type Conversation
- type ConversationQuery
- func (cq *ConversationQuery) Delete(ctx context.Context, loginID networkid.UserLoginID, chatJID types.JID) error
- func (cq *ConversationQuery) DeleteAll(ctx context.Context, loginID networkid.UserLoginID) error
- func (cq *ConversationQuery) Get(ctx context.Context, loginID networkid.UserLoginID, chatJID types.JID) (*Conversation, error)
- func (cq *ConversationQuery) GetRecent(ctx context.Context, loginID networkid.UserLoginID, limit int) ([]*Conversation, error)
- func (cq *ConversationQuery) Put(ctx context.Context, conv *Conversation) error
- type Database
- type HistorySyncMessageTuple
- type MediaBackfillRequestStatus
- type MediaRequest
- type MediaRequestQuery
- func (mrq *MediaRequestQuery) Delete(ctx context.Context, loginID networkid.UserLoginID, ...) error
- func (mrq *MediaRequestQuery) GetUnrequestedForUserLogin(ctx context.Context, loginID networkid.UserLoginID) ([]*MediaRequest, error)
- func (mrq *MediaRequestQuery) Put(ctx context.Context, mr *MediaRequest) error
- type MessageQuery
- func (mq *MessageQuery) ConversationHasMessages(ctx context.Context, loginID networkid.UserLoginID, chatJID types.JID) (exists bool, err error)
- func (mq *MessageQuery) DeleteAll(ctx context.Context, loginID networkid.UserLoginID) error
- func (mq *MessageQuery) DeleteAllInChat(ctx context.Context, loginID networkid.UserLoginID, chatJID types.JID) error
- func (mq *MessageQuery) DeleteBetween(ctx context.Context, loginID networkid.UserLoginID, chatJID types.JID, ...) error
- func (mq *MessageQuery) GetBetween(ctx context.Context, loginID networkid.UserLoginID, chatJID types.JID, ...) ([]*waWeb.WebMessageInfo, error)
- func (mq *MessageQuery) Put(ctx context.Context, loginID networkid.UserLoginID, chatJID types.JID, ...) error
- type PollOptionQuery
- func (poq *PollOptionQuery) GetHashes(ctx context.Context, mxid id.EventID, ids []string) (map[string][32]byte, error)
- func (poq *PollOptionQuery) GetIDs(ctx context.Context, mxid id.EventID, hashes [][]byte) (map[[32]byte]string, error)
- func (poq *PollOptionQuery) Put(ctx context.Context, mxid id.EventID, opts map[[32]byte]string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conversation ¶
type Conversation struct { BridgeID networkid.BridgeID UserLoginID networkid.UserLoginID ChatJID types.JID LastMessageTimestamp time.Time Archived *bool Pinned *bool MuteEndTime time.Time EndOfHistoryTransferType *waHistorySync.Conversation_EndOfHistoryTransferType EphemeralExpiration *uint32 EphemeralSettingTimestamp *int64 MarkedAsUnread *bool UnreadCount *uint32 }
func NewConversation ¶
func NewConversation(loginID networkid.UserLoginID, chatJID types.JID, conv *waHistorySync.Conversation) *Conversation
func (*Conversation) Scan ¶
func (c *Conversation) Scan(row dbutil.Scannable) (*Conversation, error)
type ConversationQuery ¶
type ConversationQuery struct { BridgeID networkid.BridgeID *dbutil.QueryHelper[*Conversation] }
func (*ConversationQuery) Delete ¶
func (cq *ConversationQuery) Delete(ctx context.Context, loginID networkid.UserLoginID, chatJID types.JID) error
func (*ConversationQuery) DeleteAll ¶
func (cq *ConversationQuery) DeleteAll(ctx context.Context, loginID networkid.UserLoginID) error
func (*ConversationQuery) Get ¶
func (cq *ConversationQuery) Get(ctx context.Context, loginID networkid.UserLoginID, chatJID types.JID) (*Conversation, error)
func (*ConversationQuery) GetRecent ¶
func (cq *ConversationQuery) GetRecent(ctx context.Context, loginID networkid.UserLoginID, limit int) ([]*Conversation, error)
func (*ConversationQuery) Put ¶
func (cq *ConversationQuery) Put(ctx context.Context, conv *Conversation) error
type Database ¶
type Database struct { *dbutil.Database Conversation *ConversationQuery Message *MessageQuery PollOption *PollOptionQuery MediaRequest *MediaRequestQuery }
type HistorySyncMessageTuple ¶
type HistorySyncMessageTuple struct { Info *types.MessageInfo Message []byte }
func (*HistorySyncMessageTuple) GetMassInsertValues ¶
func (t *HistorySyncMessageTuple) GetMassInsertValues() [4]any
type MediaBackfillRequestStatus ¶
type MediaBackfillRequestStatus int
const ( MediaBackfillRequestStatusNotRequested MediaBackfillRequestStatus = 0 MediaBackfillRequestStatusRequested MediaBackfillRequestStatus = 1 MediaBackfillRequestStatusRequestFailed MediaBackfillRequestStatus = 2 MediaBackfillRequestStatusRequestSkipped MediaBackfillRequestStatus = 3 )
type MediaRequest ¶
type MediaRequest struct { BridgeID networkid.BridgeID UserLoginID networkid.UserLoginID MessageID networkid.MessageID PortalKey networkid.PortalKey MediaKey []byte Status MediaBackfillRequestStatus Error string }
func (*MediaRequest) Scan ¶
func (mr *MediaRequest) Scan(row dbutil.Scannable) (*MediaRequest, error)
type MediaRequestQuery ¶
type MediaRequestQuery struct { BridgeID networkid.BridgeID *dbutil.QueryHelper[*MediaRequest] }
func (*MediaRequestQuery) Delete ¶
func (mrq *MediaRequestQuery) Delete(ctx context.Context, loginID networkid.UserLoginID, messageID networkid.MessageID) error
func (*MediaRequestQuery) GetUnrequestedForUserLogin ¶
func (mrq *MediaRequestQuery) GetUnrequestedForUserLogin(ctx context.Context, loginID networkid.UserLoginID) ([]*MediaRequest, error)
func (*MediaRequestQuery) Put ¶
func (mrq *MediaRequestQuery) Put(ctx context.Context, mr *MediaRequest) error
type MessageQuery ¶
func (*MessageQuery) ConversationHasMessages ¶
func (mq *MessageQuery) ConversationHasMessages(ctx context.Context, loginID networkid.UserLoginID, chatJID types.JID) (exists bool, err error)
func (*MessageQuery) DeleteAll ¶
func (mq *MessageQuery) DeleteAll(ctx context.Context, loginID networkid.UserLoginID) error
func (*MessageQuery) DeleteAllInChat ¶
func (mq *MessageQuery) DeleteAllInChat(ctx context.Context, loginID networkid.UserLoginID, chatJID types.JID) error
func (*MessageQuery) DeleteBetween ¶
func (mq *MessageQuery) DeleteBetween(ctx context.Context, loginID networkid.UserLoginID, chatJID types.JID, before, after uint64) error
func (*MessageQuery) GetBetween ¶
func (mq *MessageQuery) GetBetween(ctx context.Context, loginID networkid.UserLoginID, chatJID types.JID, startTime, endTime *time.Time, limit int) ([]*waWeb.WebMessageInfo, error)
func (*MessageQuery) Put ¶
func (mq *MessageQuery) Put(ctx context.Context, loginID networkid.UserLoginID, chatJID types.JID, messages []*HistorySyncMessageTuple) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.