-
Notifications
You must be signed in to change notification settings - Fork 4
/
sessionbuilder.h
51 lines (44 loc) · 2.03 KB
/
sessionbuilder.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef SESSIONBUILDER_H
#define SESSIONBUILDER_H
#include <QSharedPointer>
#include "state/sessionstore.h"
#include "state/signedprekeystore.h"
#include "state/prekeybundle.h"
#include "state/prekeystore.h"
#include "state/identitykeystore.h"
#include "state/axolotlstore.h"
#include "protocol/prekeywhispermessage.h"
#include "protocol/keyexchangemessage.h"
#include "axolotladdress.h"
class SessionBuilder
{
public:
SessionBuilder();
SessionBuilder(QSharedPointer<SessionStore> sessionStore,
QSharedPointer<PreKeyStore> preKeyStore,
QSharedPointer<SignedPreKeyStore> signedPreKeyStore,
QSharedPointer<IdentityKeyStore> identityKeyStore,
const AxolotlAddress &remoteAddress);
SessionBuilder(QSharedPointer<AxolotlStore> store, const AxolotlAddress &remoteAddress);
ulong process(SessionRecord *sessionRecord, QSharedPointer<PreKeyWhisperMessage> message);
ulong processV3(SessionRecord *sessionRecord, QSharedPointer<PreKeyWhisperMessage> message);
ulong processV2(SessionRecord *sessionRecord, QSharedPointer<PreKeyWhisperMessage> message);
void process(const PreKeyBundle &preKey);
KeyExchangeMessage process(QSharedPointer<KeyExchangeMessage> message);
KeyExchangeMessage process();
private:
void init(QSharedPointer<SessionStore> sessionStore,
QSharedPointer<PreKeyStore> preKeyStore,
QSharedPointer<SignedPreKeyStore> signedPreKeyStore,
QSharedPointer<IdentityKeyStore> identityKeyStore,
const AxolotlAddress &remoteAddress);
KeyExchangeMessage processInitiate(QSharedPointer<KeyExchangeMessage> message);
void processResponse(QSharedPointer<KeyExchangeMessage> message);
private:
QSharedPointer<SessionStore> sessionStore;
QSharedPointer<PreKeyStore> preKeyStore;
QSharedPointer<SignedPreKeyStore> signedPreKeyStore;
QSharedPointer<IdentityKeyStore> identityKeyStore;
AxolotlAddress remoteAddress;
};
#endif // SESSIONBUILDER_H