You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/feature/messages/composer/MessageComposerController.kt
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1249,6 +1249,8 @@ public class MessageComposerController(
1249
1249
if (!config.activeCommandEnabled) returnfalse
1250
1250
val action = activeAction as?Edit?:returnfalse
1251
1251
if (!CommandText.isTrigger(messageText)) returnfalse
1252
+
val prefix = messageText.removePrefix("/")
1253
+
if (commands.none { it.name.startsWith(prefix) }) returnfalse
Copy file name to clipboardExpand all lines: stream-chat-android-ui-common/src/test/kotlin/io/getstream/chat/android/ui/common/feature/messages/composer/MessageComposerControllerTest.kt
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1050,6 +1050,35 @@ internal class MessageComposerControllerTest {
1050
1050
}
1051
1051
}
1052
1052
1053
+
@Test
1054
+
fun`Given edit mode When user types slash prefix that matches no command Then no event is emitted`() = runTest {
1055
+
// Given
1056
+
val command = randomCommand(name ="giphy")
1057
+
val editedMessage = randomMessage(cid =CID, text ="")
0 commit comments