mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-07-21 13:04:30 +02:00
Allow escaping for messages beginning with /
This commit is contained in:
parent
3e9214a893
commit
f57de43d73
@ -164,6 +164,14 @@ func (c *Client) handleShell(channel ssh.Channel) {
|
|||||||
parts := strings.SplitN(line, " ", 3)
|
parts := strings.SplitN(line, " ", 3)
|
||||||
isCmd := strings.HasPrefix(parts[0], "/")
|
isCmd := strings.HasPrefix(parts[0], "/")
|
||||||
|
|
||||||
|
// Allow for messages starting with / that aren't commands to be escaped
|
||||||
|
if len(line) > 2 {
|
||||||
|
if line[:3] == "/ /" {
|
||||||
|
line = line[2:]
|
||||||
|
isCmd = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if isCmd {
|
if isCmd {
|
||||||
// TODO: Factor this out.
|
// TODO: Factor this out.
|
||||||
switch parts[0] {
|
switch parts[0] {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user