store

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StateStore

type StateStore struct {
	DB              *sql.DB
	Client          *mautrix.Client
	UserConfigRooms map[mid.UserID]mid.RoomID
	// contains filtered or unexported fields
}

func NewStateStore

func NewStateStore(db *sql.DB) *StateStore

func (*StateStore) CreateTables

func (store *StateStore) CreateTables() error

func (*StateStore) FindSharedRooms

func (store *StateStore) FindSharedRooms(userId mid.UserID) []mid.RoomID

func (*StateStore) GetAccessToken

func (store *StateStore) GetAccessToken() (string, error)

func (*StateStore) GetConfigRoomId added in v0.2.7

func (store *StateStore) GetConfigRoomId(userID mid.UserID) mid.RoomID

func (*StateStore) GetCurrentWeekdayInUserTimezone

func (store *StateStore) GetCurrentWeekdayInUserTimezone(userID mid.UserID) time.Weekday

func (*StateStore) GetEncryptionEvent

func (store *StateStore) GetEncryptionEvent(roomId mid.RoomID) *mevent.EncryptionEventContent

func (*StateStore) GetNotify added in v0.4.0

func (store *StateStore) GetNotify(userID mid.UserID) (int, error)

func (*StateStore) GetNotifyUsersForMinutesAfterUtcForToday

func (store *StateStore) GetNotifyUsersForMinutesAfterUtcForToday() map[int]map[mid.UserID]mid.RoomID

func (*StateStore) GetRoomMembers

func (store *StateStore) GetRoomMembers(roomId mid.RoomID) []mid.UserID

func (*StateStore) GetSendRoomId

func (store *StateStore) GetSendRoomId(userID mid.UserID) (mid.RoomID, error)

func (*StateStore) GetTimezone added in v0.4.0

func (store *StateStore) GetTimezone(userID mid.UserID) *time.Location

func (*StateStore) GetUseThreads added in v0.4.0

func (store *StateStore) GetUseThreads(userID mid.UserID) (bool, error)

func (*StateStore) IsEncrypted

func (store *StateStore) IsEncrypted(roomID mid.RoomID) bool

IsEncrypted returns whether a room is encrypted.

func (*StateStore) LoadFilterID

func (store *StateStore) LoadFilterID(userID mid.UserID) string

func (*StateStore) LoadNextBatch

func (store *StateStore) LoadNextBatch(userID mid.UserID) string

func (*StateStore) LoadRoom

func (store *StateStore) LoadRoom(roomId mid.RoomID) *mautrix.Room

func (*StateStore) SaveFilterID

func (store *StateStore) SaveFilterID(userID mid.UserID, filterID string)

func (*StateStore) SaveNextBatch

func (store *StateStore) SaveNextBatch(userID mid.UserID, nextBatchToken string)

func (*StateStore) SaveRoom

func (store *StateStore) SaveRoom(room *mautrix.Room)

func (*StateStore) SetAccessToken

func (store *StateStore) SetAccessToken(accessToken string) error

func (*StateStore) SetConfigRoom

func (store *StateStore) SetConfigRoom(userID mid.UserID, roomID mid.RoomID)

Setting which room to look for as the config room for a given user.

func (*StateStore) SetEncryptionEvent

func (store *StateStore) SetEncryptionEvent(event *mevent.Event)

func (*StateStore) SetMembership

func (store *StateStore) SetMembership(event *mevent.Event)

func (*StateStore) SetNotify

func (store *StateStore) SetNotify(userID mid.UserID, minutesAfterMidnight int)

func (*StateStore) SetSendRoomId

func (store *StateStore) SetSendRoomId(userID mid.UserID, sendRoomID mid.RoomID)

func (*StateStore) SetTimezone

func (store *StateStore) SetTimezone(userID mid.UserID, timezone string)

func (*StateStore) SetUseThreads added in v0.4.0

func (store *StateStore) SetUseThreads(userID mid.UserID, useThreads bool)

Use threads or not?

Jump to

Keyboard shortcuts

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