Verified Commit d3f774f3 authored by akwizgran's avatar akwizgran

Avoid some unnecessary session parsing.

parent 3fe7aae9
Pipeline #2660 passed with stage
in 10 minutes and 8 seconds
...@@ -422,7 +422,7 @@ class IntroductionManagerImpl extends ConversationClientImpl ...@@ -422,7 +422,7 @@ class IntroductionManagerImpl extends ConversationClientImpl
MessageType type = meta.getMessageType(); MessageType type = meta.getMessageType();
if (type == REQUEST) { if (type == REQUEST) {
messages.add(parseInvitationRequest(txn, contactGroupId, m, messages.add(parseInvitationRequest(txn, contactGroupId, m,
meta, status, ss.bdfSession, authorInfos)); meta, status, meta.getSessionId(), authorInfos));
} else if (type == ACCEPT) { } else if (type == ACCEPT) {
messages.add(parseInvitationResponse(txn, contactGroupId, m, messages.add(parseInvitationResponse(txn, contactGroupId, m,
meta, status, ss.bdfSession, authorInfos, true)); meta, status, ss.bdfSession, authorInfos, true));
...@@ -439,20 +439,9 @@ class IntroductionManagerImpl extends ConversationClientImpl ...@@ -439,20 +439,9 @@ class IntroductionManagerImpl extends ConversationClientImpl
private IntroductionRequest parseInvitationRequest(Transaction txn, private IntroductionRequest parseInvitationRequest(Transaction txn,
GroupId contactGroupId, MessageId m, MessageMetadata meta, GroupId contactGroupId, MessageId m, MessageMetadata meta,
MessageStatus status, BdfDictionary bdfSession, MessageStatus status, SessionId sessionId,
Map<AuthorId, AuthorInfo> authorInfos) Map<AuthorId, AuthorInfo> authorInfos)
throws DbException, FormatException { throws DbException, FormatException {
Role role = sessionParser.getRole(bdfSession);
SessionId sessionId;
if (role == INTRODUCER) {
IntroducerSession session =
sessionParser.parseIntroducerSession(bdfSession);
sessionId = session.getSessionId();
} else if (role == INTRODUCEE) {
IntroduceeSession session = sessionParser
.parseIntroduceeSession(contactGroupId, bdfSession);
sessionId = session.getSessionId();
} else throw new AssertionError();
Message msg = clientHelper.getMessage(txn, m); Message msg = clientHelper.getMessage(txn, m);
BdfList body = clientHelper.toList(msg); BdfList body = clientHelper.toList(msg);
RequestMessage rm = messageParser.parseRequestMessage(msg, body); RequestMessage rm = messageParser.parseRequestMessage(msg, body);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment