Update join slash command constant in RoomViewController from MXKSlashCommands

This commit is contained in:
SBiOSoftWhare
2018-07-24 12:24:12 +02:00
parent 8aa7548fb4
commit 0dec08510c
+5 -3
View File
@@ -118,6 +118,7 @@
#import "StickerPickerViewController.h"
#import "EventFormatter.h"
#import "MXKSlashCommands.h"
#import "Riot-Swift.h"
@@ -201,6 +202,7 @@
// Observe kRiotDesignValuesDidChangeThemeNotification to handle user interface theme change.
id kRiotDesignValuesDidChangeThemeNotificationObserver;
// Tell whether the input text field is in send reply mode. If true typed message will be sent to highlighted event.
BOOL isInReplyMode;
}
@@ -986,15 +988,15 @@
{
// Override the default behavior for `/join` command in order to open automatically the joined room
if ([string hasPrefix:kCmdJoinRoom])
if ([string hasPrefix:kMXKSlashCmdJoinRoom])
{
// Join a room
NSString *roomAlias;
// Sanity check
if (string.length > kCmdJoinRoom.length)
if (string.length > kMXKSlashCmdJoinRoom.length)
{
roomAlias = [string substringFromIndex:kCmdJoinRoom.length + 1];
roomAlias = [string substringFromIndex:kMXKSlashCmdJoinRoom.length + 1];
// Remove white space from both ends
roomAlias = [roomAlias stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];