Documentation ¶
Index ¶
- Constants
- func NumericFingerprint(localStableIdentifier string, localIdentityKey []byte, ...) string
- type Contact
- type DataStore
- func (ds *DataStore) DBX() *sqlx.DB
- func (ds *DataStore) Decrypt(path string) error
- func (ds *DataStore) DeleteAllMessages(sid int64) error
- func (ds *DataStore) DeleteMessage(id int64) error
- func (ds *DataStore) DeleteSession(id int64) error
- func (ds *DataStore) DequeueSent(id int64) error
- func (ds *DataStore) Encrypt(path, password string) error
- func (ds *DataStore) FetchAllMessages(sessionID int64) ([]*Message, error)
- func (ds *DataStore) FetchAllSessions() ([]*Session, error)
- func (ds *DataStore) FetchMessage(id int64) (*Message, error)
- func (ds *DataStore) FetchQueuedMessage(id int64) (*Message, error)
- func (ds *DataStore) FetchSentq() ([]*Message, error)
- func (ds *DataStore) FetchSession(id int64) (*Session, error)
- func (ds *DataStore) FetchSessionByGroupID(groupID string) (*Session, error)
- func (ds *DataStore) FetchSessionBySource(source string) (*Session, error)
- func (ds *DataStore) MarkMessageReceived(source string, ts uint64) (int64, int64, error)
- func (ds *DataStore) MarkMessageSent(id int64, ts uint64) error
- func (ds *DataStore) MarkSessionRead(id int64) error
- func (ds *DataStore) MarkSessionSent(id int64, msg string, ts uint64) error
- func (ds *DataStore) ProcessMessage(message *Message, group *textsecure.Group, unread bool) (*Session, error)
- func (ds *DataStore) QueueSent(message *Message) error
- func (ds *DataStore) SaveMessage(msg *Message) error
- func (ds *DataStore) SaveSession(session *Session) error
- func (ds *DataStore) TotalMessages() (int, error)
- func (ds *DataStore) TotalUnread() (int, error)
- type Message
- type Session
Constants ¶
View Source
const ( // Signal fingerprint version FingerprintVersion = 0 // The number of internal iterations to perform in the process of // generating a fingerprint Iterations = 5200 )
View Source
const ( MessageSchema = `` /* 320-byte string literal not displayed */ SentqSchema = ` create table if not exists sentq (message_id integer primary key, timestamp timestamp) ` SessionSchema = `` /* 322-byte string literal not displayed */ )
View Source
const (
// Path to Sailfish read-only contacts database
QtcontactsPath = "/home/nemo/.local/share/system/Contacts/qtcontacts-sqlite/contacts.db"
)
Variables ¶
This section is empty.
Functions ¶
func NumericFingerprint ¶
func NumericFingerprint(localStableIdentifier string, localIdentityKey []byte, remoteStableIdentifier string, remoteIdentityKey []byte) string
Generate a displayable numeric fingerprint from the client's "stable" identifier localStableIdentifier, the client's identity key localIdentityKey, the remort party's stable identifier remoteStableIdentifier, and the remote party's identity key. Returns a unique fingerprint for the conversation. This is a port of libsignal-protocol-java NumericFingerprintGenerator.
Types ¶
type Contact ¶
func SailfishContacts ¶
Get local sailfish contacts
type DataStore ¶
type DataStore struct {
// contains filtered or unexported fields
}
var DS *DataStore
func NewDataStore ¶
Create new data store at path. If salt and password are provided the store will be encrypted
func (*DataStore) DeleteAllMessages ¶
func (*DataStore) DeleteMessage ¶
func (*DataStore) DeleteSession ¶
func (*DataStore) DequeueSent ¶
func (*DataStore) FetchAllMessages ¶
func (*DataStore) FetchAllSessions ¶
func (*DataStore) FetchQueuedMessage ¶
func (*DataStore) FetchSentq ¶
func (*DataStore) FetchSessionByGroupID ¶
func (*DataStore) FetchSessionBySource ¶
func (*DataStore) MarkMessageReceived ¶
func (*DataStore) MarkSessionRead ¶
func (*DataStore) MarkSessionSent ¶
func (*DataStore) ProcessMessage ¶
func (ds *DataStore) ProcessMessage(message *Message, group *textsecure.Group, unread bool) (*Session, error)
Process message and store in database and update or create a session
func (*DataStore) SaveMessage ¶
func (*DataStore) SaveSession ¶
func (*DataStore) TotalMessages ¶
func (*DataStore) TotalUnread ¶
type Message ¶
type Message struct { ID int64 `db:"id"` SID int64 `db:"session_id"` Source string `db:"source"` Message string `db:"message"` Timestamp uint64 `db:"timestamp"` Outgoing bool `db:"outgoing"` Sent bool `db:"sent"` Received bool `db:"received"` Attachment string `db:"attachment"` MimeType string `db:"mime_type"` HasAttachment bool `db:"has_attachment"` Flags uint32 `db:"flags"` Queued bool `db:"queued"` }
func (*Message) SaveAttachment ¶
func (m *Message) SaveAttachment(dir string, a *textsecure.Attachment) error
type Session ¶
type Session struct { ID int64 `db:"id"` Source string `db:"source"` IsGroup bool `db:"is_group"` GroupID string `db:"group_id"` GroupName string `db:"group_name"` Members string `db:"group_members"` Message string `db:"message"` Section string `db:"-"` Timestamp uint64 `db:"timestamp"` Unread bool `db:"unread"` Sent bool `db:"sent"` Received bool `db:"received"` HasAttachment bool `db:"has_attachment"` }
Click to show internal directories.
Click to hide internal directories.