Versions in this module Expand all Collapse all v0 v0.3.2 Jul 16, 2024 v0.3.1 May 16, 2024 v0.3.0 Apr 16, 2024 v0.2.0 Mar 16, 2024 Changes in this version + var MessagixPlatform types.Platform v0.1.0 Feb 16, 2024 Changes in this version + const BulkInsertChunkSize + var NewCookies func() cookies.Cookies + type BackfillTask struct + CompletedAt time.Time + CooldownUntil time.Time + DispatchedAt time.Time + Finished bool + Key PortalKey + PageCount int + Priority int + UserMXID id.UserID + func (task *BackfillTask) InsertIfNotExists(ctx context.Context) error + func (task *BackfillTask) Scan(row dbutil.Scannable) (*BackfillTask, error) + func (task *BackfillTask) Upsert(ctx context.Context) error + type BackfillTaskQuery struct + func (btq *BackfillTaskQuery) GetNext(ctx context.Context, userID id.UserID) (*BackfillTask, error) + func (btq *BackfillTaskQuery) NewWithValues(portalKey PortalKey, userID id.UserID) *BackfillTask + type Database struct + BackfillTask *BackfillTaskQuery + Message *MessageQuery + Portal *PortalQuery + Puppet *PuppetQuery + Reaction *ReactionQuery + User *UserQuery + func New(db *dbutil.Database) *Database + type Message struct + EditCount int64 + ID string + MXID id.EventID + OTID int64 + PartIndex int + RoomID id.RoomID + Sender int64 + ThreadID int64 + ThreadReceiver int64 + Timestamp time.Time + func (msg *Message) Delete(ctx context.Context) error + func (msg *Message) EditTimestamp() int64 + func (msg *Message) Insert(ctx context.Context) error + func (msg *Message) IsUnencrypted() bool + func (msg *Message) Scan(row dbutil.Scannable) (*Message, error) + func (msg *Message) UpdateEditCount(ctx context.Context, count int64) error + func (msg *Message) UpdateEditTimestamp(ctx context.Context, ts int64) error + type MessageQuery struct + func (mq *MessageQuery) BulkInsert(ctx context.Context, thread PortalKey, roomID id.RoomID, messages []*Message) error + func (mq *MessageQuery) BulkInsertChunk(ctx context.Context, thread PortalKey, roomID id.RoomID, messages []*Message) error + func (mq *MessageQuery) FindEditTargetPortal(ctx context.Context, id string, receiver int64) (key PortalKey, err error) + func (mq *MessageQuery) GetAllBetweenTimestamps(ctx context.Context, key PortalKey, min, max time.Time) ([]*Message, error) + func (mq *MessageQuery) GetAllPartsByID(ctx context.Context, id string, receiver int64) ([]*Message, error) + func (mq *MessageQuery) GetByID(ctx context.Context, id string, partIndex int, receiver int64) (*Message, error) + func (mq *MessageQuery) GetByMXID(ctx context.Context, mxid id.EventID) (*Message, error) + func (mq *MessageQuery) GetLastByTimestamp(ctx context.Context, key PortalKey, timestamp time.Time) (*Message, error) + func (mq *MessageQuery) GetLastPartByID(ctx context.Context, id string, receiver int64) (*Message, error) + type Portal struct + AvatarID string + AvatarSet bool + AvatarURL id.ContentURI + Encrypted bool + MXID id.RoomID + MoreToBackfill bool + Name string + NameSet bool + OldestMessageID string + OldestMessageTS int64 + RelayUserID id.UserID + ThreadType table.ThreadType + WhatsAppServer string + func (p *Portal) Delete(ctx context.Context) error + func (p *Portal) Insert(ctx context.Context) error + func (p *Portal) IsPrivateChat() bool + func (p *Portal) JID() types.JID + func (p *Portal) Scan(row dbutil.Scannable) (*Portal, error) + func (p *Portal) Update(ctx context.Context) error + type PortalKey struct + Receiver int64 + ThreadID int64 + type PortalQuery struct + func (pq *PortalQuery) FindPrivateChatsNotInSpace(ctx context.Context, receiver int64) ([]PortalKey, error) + func (pq *PortalQuery) FindPrivateChatsOf(ctx context.Context, receiver int64) ([]*Portal, error) + func (pq *PortalQuery) FindPrivateChatsWith(ctx context.Context, userID int64) ([]*Portal, error) + func (pq *PortalQuery) GetAllWithMXID(ctx context.Context) ([]*Portal, error) + func (pq *PortalQuery) GetByMXID(ctx context.Context, mxid id.RoomID) (*Portal, error) + func (pq *PortalQuery) GetByThreadID(ctx context.Context, pk PortalKey) (*Portal, error) + type Puppet struct + AccessToken string + AvatarID string + AvatarSet bool + AvatarURL id.ContentURI + ContactInfoSet bool + CustomMXID id.UserID + ID int64 + Name string + NameSet bool + Username string + WhatsAppServer string + func (p *Puppet) Insert(ctx context.Context) error + func (p *Puppet) JID() types.JID + func (p *Puppet) Scan(row dbutil.Scannable) (*Puppet, error) + func (p *Puppet) Update(ctx context.Context) error + type PuppetQuery struct + func (pq *PuppetQuery) GetAllWithCustomMXID(ctx context.Context) ([]*Puppet, error) + func (pq *PuppetQuery) GetByCustomMXID(ctx context.Context, mxid id.UserID) (*Puppet, error) + func (pq *PuppetQuery) GetByID(ctx context.Context, id int64) (*Puppet, error) + type Reaction struct + Emoji string + MXID id.EventID + MessageID string + RoomID id.RoomID + Sender int64 + ThreadID int64 + ThreadReceiver int64 + func (r *Reaction) Delete(ctx context.Context) error + func (r *Reaction) Insert(ctx context.Context) error + func (r *Reaction) Scan(row dbutil.Scannable) (*Reaction, error) + func (r *Reaction) Update(ctx context.Context) error + type ReactionQuery struct + func (rq *ReactionQuery) BulkInsert(ctx context.Context, thread PortalKey, roomID id.RoomID, reactions []*Reaction) error + func (rq *ReactionQuery) BulkInsertChunk(ctx context.Context, thread PortalKey, roomID id.RoomID, reactions []*Reaction) error + func (rq *ReactionQuery) GetByID(ctx context.Context, msgID string, threadReceiver, reactionSender int64) (*Reaction, error) + func (rq *ReactionQuery) GetByMXID(ctx context.Context, mxid id.EventID) (*Reaction, error) + type User struct + Cookies cookies.Cookies + InboxFetched bool + MXID id.UserID + ManagementRoom id.RoomID + MetaID int64 + SpaceRoom id.RoomID + WADeviceID uint16 + func (u *User) GetLastReadTS(ctx context.Context, portal PortalKey) time.Time + func (u *User) Insert(ctx context.Context) error + func (u *User) IsInSpace(ctx context.Context, portal PortalKey) bool + func (u *User) MarkInSpace(ctx context.Context, portal PortalKey) + func (u *User) RemoveInSpaceCache(key PortalKey) + func (u *User) Scan(row dbutil.Scannable) (*User, error) + func (u *User) SetLastReadTS(ctx context.Context, portal PortalKey, ts time.Time) + func (u *User) Update(ctx context.Context) error + type UserQuery struct + func (uq *UserQuery) GetAllLoggedIn(ctx context.Context) ([]*User, error) + func (uq *UserQuery) GetByMXID(ctx context.Context, mxid id.UserID) (*User, error) + func (uq *UserQuery) GetByMetaID(ctx context.Context, id int64) (*User, error)