mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 17:12:45 +02:00
Merge pull request #6039 from vector-im/aringenbach/3526_user_pills
Add mention pills to timeline & composer
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
#import "MXKMessageTextView.h"
|
||||
#import "UITextView+MatrixKit.h"
|
||||
#import "GeneratedInterface-Swift.h"
|
||||
|
||||
@interface MXKMessageTextView()
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
return NO;
|
||||
}
|
||||
|
||||
return [self isThereALinkNearPoint:point];
|
||||
return [self isThereALinkNearLocation:point];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -269,6 +269,11 @@ typedef enum : NSUInteger
|
||||
*/
|
||||
- (IBAction)onTouchUpInside:(UIButton*)button;
|
||||
|
||||
/**
|
||||
Send message currently displayed inside toolbar's ` UITextView`.
|
||||
*/
|
||||
- (void)sendCurrentMessage;
|
||||
|
||||
/**
|
||||
Handle image attachment
|
||||
Save the image in user's photos library when 'isPhotoLibraryAsset' flag is NO and auto saving is enabled.
|
||||
|
||||
@@ -277,22 +277,27 @@
|
||||
}
|
||||
else if (button == self.rightInputToolbarButton && self.textMessage.length)
|
||||
{
|
||||
// This forces an autocorrect event to happen when "Send" is pressed, which is necessary to accept a pending correction on send
|
||||
self.textMessage = [NSString stringWithFormat:@"%@ ", self.textMessage];
|
||||
self.textMessage = [self.textMessage substringToIndex:[self.textMessage length]-1];
|
||||
[self sendCurrentMessage];
|
||||
}
|
||||
}
|
||||
|
||||
NSString *message = self.textMessage;
|
||||
|
||||
// Reset message, disable view animation during the update to prevent placeholder distorsion.
|
||||
[UIView setAnimationsEnabled:NO];
|
||||
self.textMessage = nil;
|
||||
[UIView setAnimationsEnabled:YES];
|
||||
|
||||
// Send button has been pressed
|
||||
if (message.length && [self.delegate respondsToSelector:@selector(roomInputToolbarView:sendTextMessage:)])
|
||||
{
|
||||
[self.delegate roomInputToolbarView:self sendTextMessage:message];
|
||||
}
|
||||
- (void)sendCurrentMessage
|
||||
{
|
||||
// This forces an autocorrect event to happen when "Send" is pressed, which is necessary to accept a pending correction on send
|
||||
self.textMessage = [NSString stringWithFormat:@"%@ ", self.textMessage];
|
||||
self.textMessage = [self.textMessage substringToIndex:[self.textMessage length]-1];
|
||||
|
||||
NSString *message = self.textMessage;
|
||||
|
||||
// Reset message, disable view animation during the update to prevent placeholder distorsion.
|
||||
[UIView setAnimationsEnabled:NO];
|
||||
self.textMessage = nil;
|
||||
[UIView setAnimationsEnabled:YES];
|
||||
|
||||
// Send button has been pressed
|
||||
if (message.length && [self.delegate respondsToSelector:@selector(roomInputToolbarView:sendTextMessage:)])
|
||||
{
|
||||
[self.delegate roomInputToolbarView:self sendTextMessage:message];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user