diff --git a/Riot/Modules/Room/MXKRoomViewController.h b/Riot/Modules/Room/MXKRoomViewController.h index 17aa34a37..0ff875fc3 100644 --- a/Riot/Modules/Room/MXKRoomViewController.h +++ b/Riot/Modules/Room/MXKRoomViewController.h @@ -394,7 +394,7 @@ typedef NS_ENUM(NSUInteger, MXKRoomViewControllerJoinRoomResult) { @param string to analyse @return YES if IRC style command has been detected and interpreted. */ -- (BOOL)isIRCStyleCommand:(NSString*)string; +- (BOOL)sendAsIRCStyleCommandIfPossible:(NSString*)string; /** Mention the member display name in the current text of the message composer. diff --git a/Riot/Modules/Room/MXKRoomViewController.m b/Riot/Modules/Room/MXKRoomViewController.m index 17c4c2b5e..814977644 100644 --- a/Riot/Modules/Room/MXKRoomViewController.m +++ b/Riot/Modules/Room/MXKRoomViewController.m @@ -1250,7 +1250,7 @@ customEventDetailsViewClass = eventDetailsViewClass; } -- (BOOL)isIRCStyleCommand:(NSString*)string +- (BOOL)sendAsIRCStyleCommandIfPossible:(NSString*)string { // Check whether the provided text may be an IRC-style command if ([string hasPrefix:@"/"] == NO || [string hasPrefix:@"//"] == YES) @@ -3375,7 +3375,7 @@ - (void)roomInputToolbarView:(MXKRoomInputToolbarView*)toolbarView sendTextMessage:(NSString*)textMessage { // Handle potential IRC commands in typed string - if ([self isIRCStyleCommand:textMessage] == NO) + if ([self sendAsIRCStyleCommandIfPossible:textMessage] == NO) { // Send text message in the current room [self sendTextMessage:textMessage]; diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index 7b1de8bf2..26dd78547 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -1228,7 +1228,7 @@ static CGSize kThreadListBarButtonItemImageSize; } } -- (BOOL)isIRCStyleCommand:(NSString*)string +- (BOOL)sendAsIRCStyleCommandIfPossible:(NSString*)string { // Override the default behavior for `/join` command in order to open automatically the joined room @@ -1271,7 +1271,7 @@ static CGSize kThreadListBarButtonItemImageSize; } return YES; } - return [super isIRCStyleCommand:string]; + return [super sendAsIRCStyleCommandIfPossible:string]; } - (void)setKeyboardHeight:(CGFloat)keyboardHeight @@ -4816,7 +4816,7 @@ static CGSize kThreadListBarButtonItemImageSize; message = attributedTextMessage.string; } // Try to send the slash command - isMessageAHandledCommand = [self isIRCStyleCommand:message]; + isMessageAHandledCommand = [self sendAsIRCStyleCommandIfPossible:message]; } if (!isMessageAHandledCommand)