forked from CODeRUS/libaxolotl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sessionbuilder.h
51 lines (44 loc) · 2 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"
class SessionBuilder
{
public:
SessionBuilder();
SessionBuilder(QSharedPointer<SessionStore> sessionStore,
QSharedPointer<PreKeyStore> preKeyStore,
QSharedPointer<SignedPreKeyStore> signedPreKeyStore,
QSharedPointer<IdentityKeyStore> identityKeyStore,
qulonglong recipientId, int deviceId);
SessionBuilder(QSharedPointer<AxolotlStore> store, qulonglong recipientId, int deviceId);
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,
qulonglong recipientId, int deviceId);
KeyExchangeMessage processInitiate(QSharedPointer<KeyExchangeMessage> message);
void processResponse(QSharedPointer<KeyExchangeMessage> message);
private:
QSharedPointer<SessionStore> sessionStore;
QSharedPointer<PreKeyStore> preKeyStore;
QSharedPointer<SignedPreKeyStore> signedPreKeyStore;
QSharedPointer<IdentityKeyStore> identityKeyStore;
qulonglong recipientId;
int deviceId;
};
#endif // SESSIONBUILDER_H