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