Documentation ¶
Index ¶
- Variables
- func AvatarImageProvider(id string, width, height int) image.Image
- func CopyAttachment(src string) (string, error)
- func DeleteGroup(hexid string) error
- func DeleteMessage(id int64) error
- func DeleteSession(tel string) error
- func FetchAllGroups() error
- func GetContactForTel(tel string) *textsecure.Contact
- func GroupUpdateMsg(tels []string, title string) string
- func IsEncrypted(filename string) (bool, error)
- func LoadMessagesFromDB() error
- func RefreshContacts() error
- func RefreshDevices() error
- func SaveAttachment(a *textsecure.Attachment) (string, error)
- func SaveGroup(g *GroupRecord) error
- func SaveMessage(m *Message) error
- func SaveSession(s *Session) error
- func TelToName(tel string) string
- func UpdateGroup(g *GroupRecord) error
- func UpdateMessageRead(m *Message) error
- func UpdateMessageSent(m *Message) error
- func UpdateSession(s *Session) error
- func UpdateSessionTable() error
- func UpdateTimestamps()
- type Contacts
- type DataStore
- func (ds *DataStore) Convert(password string) error
- func (ds *DataStore) DBX() *sqlx.DB
- func (ds *DataStore) Decrypt(dbPath string) error
- func (ds *DataStore) DecryptDb(password string) bool
- func (ds *DataStore) Encrypt(dbFile string, password string) error
- func (ds *DataStore) EncryptDb(password string) bool
- func (ds *DataStore) ResetDb()
- func (ds *DataStore) SetupDb(password string) bool
- type GroupRecord
- type LinkedDevices
- type Message
- type Session
- type Sessions
Constants ¶
This section is empty.
Variables ¶
View Source
var AllGroups []*GroupRecord
View Source
var AllSessions []*Session
TODO that hasn't to be in the db controller
View Source
var Groups = map[string]*GroupRecord{}
View Source
var SessionsModel = &Sessions{ Sess: make([]*Session, 0), }
Functions ¶
func CopyAttachment ¶
copyAttachment makes a copy of a file that is in the volatile content hub cache
func DeleteGroup ¶
func DeleteMessage ¶
func DeleteSession ¶
func FetchAllGroups ¶
func FetchAllGroups() error
func GetContactForTel ¶
func GetContactForTel(tel string) *textsecure.Contact
func GroupUpdateMsg ¶
func IsEncrypted ¶
IsEncrypted returns true, if the database with the given filename is encrypted, and false otherwise. If the database header cannot be read properly an error is returned.
func LoadMessagesFromDB ¶
func LoadMessagesFromDB() error
func RefreshContacts ¶
func RefreshContacts() error
func RefreshDevices ¶
func RefreshDevices() error
func SaveAttachment ¶
func SaveAttachment(a *textsecure.Attachment) (string, error)
func SaveGroup ¶
func SaveGroup(g *GroupRecord) error
func SaveMessage ¶
func SaveSession ¶
func UpdateGroup ¶
func UpdateGroup(g *GroupRecord) error
func UpdateMessageRead ¶
func UpdateMessageSent ¶
func UpdateSession ¶
func UpdateTimestamps ¶
func UpdateTimestamps()
updateTimestamps keeps the timestamps of the last message of each session updated in human readable form. FIXME: make this lazier, to only update timestamps the user sees at the moment
Types ¶
type Contacts ¶
type Contacts struct { Contacts []textsecure.Contact Len int }
func (*Contacts) GetContact ¶
func (c *Contacts) GetContact(i int) textsecure.Contact
type DataStore ¶
var DS *DataStore
func NewDataStore ¶
type GroupRecord ¶
type LinkedDevices ¶
type LinkedDevices struct { LinkedDevices []textsecure.DeviceInfo Len int }
var LinkedDevicesModel *LinkedDevices = &LinkedDevices{}
func (*LinkedDevices) DeleteDevice ¶
func (c *LinkedDevices) DeleteDevice() error
func (*LinkedDevices) GetDevice ¶
func (c *LinkedDevices) GetDevice(i int) textsecure.DeviceInfo
func (*LinkedDevices) RefreshDevices ¶
func (c *LinkedDevices) RefreshDevices() error
func (*LinkedDevices) UnlinkDevice ¶
func (c *LinkedDevices) UnlinkDevice(id int) error
type Message ¶
type Session ¶
type Session struct { ID int64 Name string Tel string IsGroup bool Last string Timestamp uint64 When string CType int Messages []*Message Unread int Active bool Len int Notification bool }
func (*Session) Add ¶
func (s *Session) Add(text string, source string, file string, mimetype string, outgoing bool, sessionID string) *Message
func (s *Sessions) GetActiveChat() *string { return s.ActiveChat }
func (*Session) GetMessages ¶
func (*Session) ToggleSessionNotifcation ¶
type Sessions ¶
func (*Sessions) GetSession ¶
func (*Sessions) UpdateSessionNames ¶
func (s *Sessions) UpdateSessionNames()
Click to show internal directories.
Click to hide internal directories.