Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reactions: Send them in clear in e2e rooms for the moment #687

Merged
merged 1 commit into from
Jul 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion MatrixSDK/Data/MXRoom.m
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,9 @@ - (MXHTTPOperation*)sendEventOfType:(MXEventTypeString)eventTypeString
};

// Check whether the content must be encrypted before sending
if (mxSession.crypto && self.summary.isEncrypted)
if (mxSession.crypto
&& self.summary.isEncrypted
&& [self isEncryptionRequiredForEventType:eventTypeString])
{
// Check whether the provided content is already encrypted
if ([eventTypeString isEqualToString:kMXEventTypeStringRoomEncrypted])
Expand Down Expand Up @@ -3067,6 +3069,25 @@ - (MXHTTPOperation *)enableEncryptionWithAlgorithm:(NSString *)algorithm
return operation;
}

/**
Check if we need to encrypt event with a given type.

@param eventType the event type
@return YES to event.
*/
- (BOOL)isEncryptionRequiredForEventType:(MXEventTypeString)eventType
{
BOOL isEncryptionRequired = YES;

if ([eventType isEqualToString:kMXEventTypeStringReaction])
{
// Do not encrypt reaction for the moment
isEncryptionRequired = NO;
}

return isEncryptionRequired;
}


#pragma mark - Utils

Expand Down