mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-23 20:42:06 +01:00
Add method to establish fresh session
This commit is contained in:
parent
f5b199158d
commit
8751138e19
1 changed files with 24 additions and 0 deletions
|
@ -931,6 +931,30 @@ public final class OmemoManager extends Manager {
|
||||||
CarbonManager.getInstanceFor(connection()).removeCarbonCopyReceivedListener(internalOmemoCarbonCopyListener);
|
CarbonManager.getInstanceFor(connection()).removeCarbonCopyReceivedListener(internalOmemoCarbonCopyListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build a fresh session with a contacts device.
|
||||||
|
* This might come in handy if a session is broken.
|
||||||
|
*
|
||||||
|
* @param contactsDevice OmemoDevice of a contact.
|
||||||
|
*
|
||||||
|
* @throws InterruptedException
|
||||||
|
* @throws SmackException.NoResponseException
|
||||||
|
* @throws CorruptedOmemoKeyException if our or their identityKey is corrupted.
|
||||||
|
* @throws SmackException.NotConnectedException
|
||||||
|
* @throws CannotEstablishOmemoSessionException if no new session can be established.
|
||||||
|
* @throws SmackException.NotLoggedInException if the connection is not authenticated.
|
||||||
|
*/
|
||||||
|
public void rebuildSessionWith(OmemoDevice contactsDevice)
|
||||||
|
throws InterruptedException, SmackException.NoResponseException, CorruptedOmemoKeyException,
|
||||||
|
SmackException.NotConnectedException, CannotEstablishOmemoSessionException,
|
||||||
|
SmackException.NotLoggedInException
|
||||||
|
{
|
||||||
|
if (!connection().isAuthenticated()) {
|
||||||
|
throw new SmackException.NotLoggedInException();
|
||||||
|
}
|
||||||
|
getOmemoService().buildFreshSessionWithDevice(connection(), getOwnDevice(), contactsDevice);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get our connection.
|
* Get our connection.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue