mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 04:18:53 +01:00
transactional versions of addPendingContact, getPendingContacts, getConversationId and respondToIntroduction
This commit is contained in:
committed by
Sebastian Kürten
parent
c340071469
commit
5b27eb354c
@@ -377,6 +377,12 @@ class IntroductionManagerImpl extends ConversationClientImpl
|
||||
respondToIntroduction(contactId, sessionId, accept, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void respondToIntroduction(Transaction txn, ContactId contactId,
|
||||
SessionId sessionId, boolean accept) throws DbException {
|
||||
respondToIntroduction(txn, contactId, sessionId, accept, false);
|
||||
}
|
||||
|
||||
private void respondToIntroduction(ContactId contactId, SessionId sessionId,
|
||||
boolean accept, boolean isAutoDecline) throws DbException {
|
||||
db.transaction(false,
|
||||
|
||||
@@ -389,14 +389,13 @@ class MessagingManagerImpl implements MessagingManager, IncomingMessageHook,
|
||||
|
||||
@Override
|
||||
public GroupId getConversationId(ContactId c) throws DbException {
|
||||
Contact contact;
|
||||
Transaction txn = db.startTransaction(true);
|
||||
try {
|
||||
contact = db.getContact(txn, c);
|
||||
db.commitTransaction(txn);
|
||||
} finally {
|
||||
db.endTransaction(txn);
|
||||
}
|
||||
return db.transactionWithResult(true,
|
||||
txn -> getConversationId(txn, c));
|
||||
}
|
||||
|
||||
@Override
|
||||
public GroupId getConversationId(Transaction txn, ContactId c) throws DbException {
|
||||
Contact contact = db.getContact(txn, c);
|
||||
return getContactGroup(contact).getId();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user