Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow sending messages with leading slash in Riot #4630

Closed
MurzNN opened this issue Jul 18, 2017 · 11 comments · Fixed by matrix-org/matrix-react-sdk#3893
Closed

Allow sending messages with leading slash in Riot #4630

MurzNN opened this issue Jul 18, 2017 · 11 comments · Fixed by matrix-org/matrix-react-sdk#3893
Assignees
Labels
P2 S-Minor Impairs non-critical functionality or suitable workarounds exist T-Enhancement

Comments

@MurzNN
Copy link
Contributor

MurzNN commented Jul 18, 2017

At now when I try to send message via Riot, that starting with slash (for example, linux path to file like /home/murz/file.txt or path of code like /* code */ echo "hello world"; /* code end */) - I got the error:

Command error
Unrecognised command: /home/murz/file.txt

So I must add trailing space or other symbol for send this path to file.

I understand that Riot have commands that sends via trailing slash, but this broke ability to send some messages without manual editing.

Will be good if Riot try to recognize the command with slash, and if there are no exact matches - send message to room, instead of stop sending process and shows the error.

@t3chguy
Copy link
Member

t3chguy commented Jul 18, 2017

I'd hate that, what if you mistype a command that has some info you wouldn't really want others to see.

The right way to do this, as IRC Clients have done for a looong time and how Riot already does it is to
Prepend a /
to make it //home.... and that will send the message exactly as you want it
though might be broken on RTE right now, think its fixed in Develop

@MurzNN
Copy link
Contributor Author

MurzNN commented Jul 18, 2017

IRC with / commands is too old protocol, so most of new users, that moved to Matrix not from IRC, but from XMPP, Telegram, Skype and other modern messengers, don't know about those commands and will be seriosly confused when see Command error window in Riot on message with trailing slash instead of send process.

Even me, that was be active user of IRC about 10 years ago (and moved to XMPP from this protocol), forgot this trick that I can add additional / to send message, and confused with this error message - solve the problem via adding spaces instead of next slash.

So best solution will be add option "Enable IRC-style commands with trailing /" in Riot settings and recognize commands only with enabled option.

Or as workaround for this problem - we can add button "Force send as message" to current error popup window, that automatically prepend additional / to message and send the message to room, or text notice that user can prepend / for succesfully send current message instead of execute command.

@MurzNN
Copy link
Contributor Author

MurzNN commented Jul 18, 2017

Our company actively send link to files like /mnt/sharedfolder/projectfile.odt and after moving all conversations from XMPP to Matrix&Riot - every user of our company already asks me - how to solve the problem with sending links to file? And no one can solve this problem without my help, even don't try to adding space or other symbol before first slash, because they are not programmers and don't know anything about slash-commands and source of this problem. So this is bad default behavior of Riot for not-improved IRC users.

@t3chguy
Copy link
Member

t3chguy commented Jul 18, 2017

I like the solutions you suggested, a way to disable SlashCommands and a way to send the message anyway

@uhoreg uhoreg changed the title Allow sending messages with trailing slash in Riot Allow sending messages with leading slash in Riot Jul 18, 2017
@lampholder lampholder added feature S-Minor Impairs non-critical functionality or suitable workarounds exist P2 labels Jul 19, 2017
@lampholder
Copy link
Member

We do need a nicer way to handle this, and as you say the current error popup could be a lot more useful.

Instead of saying "Unrecognised command: /whatever" we could say:

Sorry, /whatever is not a valid command 😢

Riot.im interprets messages that start with a / as commands. If you want to send /whatever to the room as a message, add an extra / at the beginning, e.g. //whatever.

Alternatively you can click here to send ```/whatever```` to the room now.

Obviously we'd need Riot to render '//.....' messages as '/.....', too.

@t3chguy
Copy link
Member

t3chguy commented Jul 19, 2017

@lampholder //whatever already works to send /whatever (not on /app RTE though)

@MurzNN
Copy link
Contributor Author

MurzNN commented Jul 20, 2017

Yes, text is good, but message text repeats 3 times. Message text can be very long and multiline (even when sending code snippets), so will be good to display them one time:

Your message start with / that means command instead of message:
[q]full message text with scroll[/q]

Riot can't recognize typed command. List of available commands you can look here.

Riot.im interprets messages that start with a / as commands. If you want to send /whatever to the room as a message, add an extra / at the beginning, e.g. //whatever. Also you can disable recognizing all commands in Riot options.
[button: Return to edit command] [button: Send current text as message]

Also I add link to disable command recognition in Riot settings, if this will added in future.

@MurzNN
Copy link
Contributor Author

MurzNN commented Jul 20, 2017

//whatever already works to send /whatever

This can give problems with sending code snippets starting with comments, like:

// Example of PHP code:
echo "Hello world!";

For solve this problem we can change recognition process to regexp ^/\w+ for work only on messages with one leading slash and word next to them.

@Ralith
Copy link

Ralith commented Sep 3, 2017

This can give problems with sending code snippets starting with comments

Typically that would be in a code block, and not be parsed as a command to begin with. If you wanted to send a line starting with // for other reasons then you'd just enter ///. This rule is simple, consistent, and familiar to users of other chat programs.

For solve this problem we can change recognition process to regexp ^/\w+ for work only on messages with one leading slash and word next to them.

That would be even more confusing than not supporting leading slashes at all; sometimes it would work and sometimes it wouldn't.

@MurzNN
Copy link
Contributor Author

MurzNN commented Sep 4, 2017

If you wanted to send a line starting with // for other reasons then you'd just enter ///. This rule is simple, consistent, and familiar to users of other chat programs.

WAT? This is familiar only for IRC users! All other popular chats (Skype, WhatsAPP, Viber, XMPP, Telegram, Hangouts) don't use slash-commands, and even if they use - I can't remember that they don't allow send messages like /mnt/sharedfolder/projectfile.odt without warnings.

Neoteric users prefers to use nice buttons and menu options instead of remember plaintext commands. Even smiles they select via mouse from list instead of typing.

@MurzNN
Copy link
Contributor Author

MurzNN commented Sep 6, 2019

Issue is still exists with "new, faster, but still experimental composer" too :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 S-Minor Impairs non-critical functionality or suitable workarounds exist T-Enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants