diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m index 688428819..c3b400513 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m @@ -709,7 +709,7 @@ NS_ASSUME_NONNULL_BEGIN NSString *text = displayableText.displayText; NSError *error1; - NSRegularExpression *regex1 = [[NSRegularExpression alloc] initWithPattern:@"@\\w*" options:0 error:&error1]; + NSRegularExpression *regex1 = [[NSRegularExpression alloc] initWithPattern:@"@[0-9a-fA-F]*" options:0 error:&error1]; OWSAssertDebug(error1 == nil); NSSet *knownUserIDs = LKAPI.userIDCache[thread.uniqueId]; NSMutableArray *mentions = [NSMutableArray new]; diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 4e98858b2..c5cc8e79c 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -3773,13 +3773,11 @@ typedef enum : NSUInteger { [self.typingIndicators didStartTypingOutgoingInputInThread:self.thread]; NSUInteger currentEndIndex = textView.text.length - 1; unichar lastCharacter = [textView.text characterAtIndex:currentEndIndex]; - NSMutableCharacterSet *allowedCharacters = NSMutableCharacterSet.lowercaseLetterCharacterSet; - [allowedCharacters formUnionWithCharacterSet:NSCharacterSet.uppercaseLetterCharacterSet]; if (lastCharacter == '@') { NSArray *userIDs = [LKAPI getUserIDsFor:@"" in:self.thread.uniqueId]; self.mentionStartIndex = (NSInteger)currentEndIndex + 1; [self.inputToolbar showUserSelectionViewFor:userIDs in:self.thread]; - } else if (![allowedCharacters characterIsMember:lastCharacter]) { + } else if ([NSCharacterSet.whitespaceAndNewlineCharacterSet characterIsMember:lastCharacter]) { self.mentionStartIndex = -1; [self.inputToolbar hideUserSelectionView]; } else {