Documentation ¶
Index ¶
- Variables
- func AddDevice(url string) error
- 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 LoadChats() error
- func LoadGroups() error
- func LoadMessagesFromDB() error
- func RefreshContacts() error
- func SaveGroup(g *GroupRecord) 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 UpdateMessagesTable_v_0_7_8() error
- func UpdateSession(s *Session) error
- func UpdateSessionTable() error
- func UpdateSessionTable_v_0_7_8() error
- func UpdateTimestamps()
- type Attachment
- 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 MessageList
- type Session
- type Sessions
- func (s *Sessions) Get(tel string) *Session
- func (s *Sessions) GetIndex(tel string) int
- func (s *Sessions) GetMessageList(id string) (error, *MessageList)
- func (s *Sessions) GetMoreMessageList(id string, lastId string) (error, *MessageList)
- func (s *Sessions) GetSession(i int) *Session
- func (s *Sessions) UpdateSessionNames()
Constants ¶
This section is empty.
Variables ¶
View Source
var ActiveSessionID string
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 LoadMessagesList(id int64) (error, *MessageList) { messageList := &MessageList{ ID: id, } log.Printf("Loading Messages for " + string(id)) err := DS.Dbx.Select(&messageList.Messages, messagesSelectWhere, id) if err != nil { return err, nil } return nil, messageList }
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 LoadGroups ¶ added in v0.7.5
func LoadGroups() error
func LoadMessagesFromDB ¶
func LoadMessagesFromDB() error
func RefreshContacts ¶
func RefreshContacts() error
func SaveGroup ¶
func SaveGroup(g *GroupRecord) error
func SaveSession ¶
func UpdateGroup ¶
func UpdateGroup(g *GroupRecord) error
func UpdateMessageRead ¶
func UpdateMessageSent ¶
func UpdateMessagesTable_v_0_7_8 ¶ added in v0.8.0
func UpdateMessagesTable_v_0_7_8() error
fix v.0.7.8 add SendingError + expireTimer
func UpdateSession ¶
func UpdateSessionTable ¶
func UpdateSessionTable() error
func UpdateSessionTable_v_0_7_8 ¶ added in v0.8.0
func UpdateSessionTable_v_0_7_8() error
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 Attachment ¶ added in v0.8.0
func SaveAttachment ¶
func SaveAttachment(a *textsecure.Attachment) (Attachment, error)
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 GroupRecord struct { ID int64 Uuid string GroupID string Name string Members string Avatar []byte Active bool }
func GetGroupById ¶ added in v0.7.5
func GetGroupById(hexid string) *GroupRecord
type LinkedDevices ¶
type LinkedDevices struct { LinkedDevices []textsecure.DeviceInfo Len int }
var LinkedDevicesModel *LinkedDevices = &LinkedDevices{}
func RefreshDevices ¶
func RefreshDevices() (*LinkedDevices, error)
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 Message struct { ID int64 `db:"id"` SID int64 ChatID string Source string Message string Outgoing bool SentAt uint64 ReceivedAt uint64 HTime string CType int Attachment string IsSent bool IsRead bool Flags int ExpireTimer uint32 `db:"expireTimer"` SendingError bool `db:"sendingError"` Receipt bool `db:"receipt"` StatusMessage bool `db:"statusMessage"` }
func SaveMessage ¶
type MessageList ¶
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 ExpireTimer uint32 `db:"expireTimer"` }
func (*Session) Add ¶
func (s *Session) Add(text string, source string, file []Attachment, mimetype string, outgoing bool, sessionID string) *Message
func (s *Sessions) GetActiveChat() *string { return s.ActiveChat }
func (*Session) GetMessages ¶
func (*Session) ToggleSessionNotifcation ¶
func (s *Session) ToggleSessionNotifcation()
type Sessions ¶
func (*Sessions) GetMessageList ¶
func (s *Sessions) GetMessageList(id string) (error, *MessageList)
func (*Sessions) GetMoreMessageList ¶
func (s *Sessions) GetMoreMessageList(id string, lastId string) (error, *MessageList)
func (*Sessions) GetSession ¶
func (*Sessions) UpdateSessionNames ¶
func (s *Sessions) UpdateSessionNames()
Click to show internal directories.
Click to hide internal directories.