예제 #1
0
 public void setIdentityKey(string name, IdentityKey identityKey, string accountId)
 {
     dB.InsertOrReplace(new OmemoIdentityKeyTable
     {
         id          = OmemoIdentityKeyTable.generateId(name, accountId),
         name        = name,
         accountId   = accountId,
         identityKey = identityKey.serialize()
     });
 }
예제 #2
0
        public IdentityKey getIdentityKey(string name, string accountId)
        {
            List <OmemoIdentityKeyTable> list = dB.Query <OmemoIdentityKeyTable>(true, "SELECT * FROM " + DBTableConsts.OMEMO_IDENTITY_KEY_TABLE + " WHERE id = ?;", OmemoIdentityKeyTable.generateId(name, accountId));

            if (list.Count <= 0)
            {
                return(null);
            }
            return(new IdentityKey(list[0].identityKey, 0));
        }
예제 #3
0
 public void deleteIdentityKey(string name, string accountId)
 {
     dB.Execute("DELETE FROM " + DBTableConsts.OMEMO_IDENTITY_KEY_TABLE + " WHERE id = ?;", OmemoIdentityKeyTable.generateId(name, accountId));
 }
예제 #4
0
        public bool containsIdentityKey(string name, string accountId)
        {
            List <OmemoIdentityKeyTable> list = dB.Query <OmemoIdentityKeyTable>(true, "SELECT * FROM " + DBTableConsts.OMEMO_IDENTITY_KEY_TABLE + " WHERE id = ?;", OmemoIdentityKeyTable.generateId(name, accountId));

            return(list.Count > 0);
        }