Example #1
0
 public void setSignedPreKey(uint signedPreKeyId, SignedPreKeyRecord signedPreKey, string accountId)
 {
     dB.InsertOrReplace(new OmemoSignedPreKeyTable
     {
         id             = OmemoSignedPreKeyTable.generateId(signedPreKeyId, accountId),
         signedPreKeyId = signedPreKeyId,
         accountId      = accountId,
         signedPreKey   = signedPreKey.serialize()
     });
 }
Example #2
0
        public SignedPreKeyRecord getSignedPreKey(uint signedPreKeyId, string accountId)
        {
            List <OmemoSignedPreKeyTable> list = dB.Query <OmemoSignedPreKeyTable>(true, "SELECT * FROM " + DBTableConsts.OMEMO_SIGNED_PRE_KEY_TABLE + " WHERE id = ?;", OmemoSignedPreKeyTable.generateId(signedPreKeyId, accountId));

            return(list.Count <= 0 ? null : new SignedPreKeyRecord(list[0].signedPreKey));
        }
Example #3
0
 public void deleteSignedPreKey(uint signedPreKeyId, string accountId)
 {
     dB.Execute("DELETE FROM " + DBTableConsts.OMEMO_SIGNED_PRE_KEY_TABLE + " WHERE id = ?;", OmemoSignedPreKeyTable.generateId(signedPreKeyId, accountId));
 }
Example #4
0
        //--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\
        #region --Misc Methods (Public)--
        public bool containsSignedPreKey(uint signedPreKeyId, string accountId)
        {
            List <OmemoSignedPreKeyTable> list = dB.Query <OmemoSignedPreKeyTable>(true, "SELECT * FROM " + DBTableConsts.OMEMO_SIGNED_PRE_KEY_TABLE + " WHERE id = ?;", OmemoSignedPreKeyTable.generateId(signedPreKeyId, accountId));

            return(list.Count > 0);
        }