Skip to content

Commit

Permalink
Merge pull request #687 from matrix-org/riot_2448
Browse files Browse the repository at this point in the history
Reactions: Send them in clear in e2e rooms for the moment
  • Loading branch information
manuroe authored Jul 3, 2019
2 parents 20b10c2 + ffc6316 commit c5eea4b
Showing 1 changed file with 22 additions and 1 deletion.
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

0 comments on commit c5eea4b

Please sign in to comment.