Unify introduction response methods and handle ProtocolStateException

It is possible that a remote DECLINE message arrives short before the
user responds to the introduction.
This will cause a ProtocolStateException which (for now) is just caught
and a generic (existing) error message will be shown.
This commit is contained in:
Torsten Grote
2018-04-26 18:18:31 -03:00
parent f8f98ed95d
commit 337f7e7b8f
4 changed files with 22 additions and 46 deletions

View File

@@ -34,16 +34,10 @@ public interface IntroductionManager extends ConversationClient {
long timestamp) throws DbException;
/**
* Accepts an introduction.
* Responds to an introduction.
*/
void acceptIntroduction(ContactId contactId, SessionId sessionId,
long timestamp) throws DbException;
/**
* Declines an introduction.
*/
void declineIntroduction(ContactId contactId, SessionId sessionId,
long timestamp) throws DbException;
void respondToIntroduction(ContactId contactId, SessionId sessionId,
long timestamp, boolean accept) throws DbException;
/**
* Returns all introduction messages for the given contact.