summaryrefslogtreecommitdiff
path: root/app.go
diff options
context:
space:
mode:
Diffstat (limited to 'app.go')
-rw-r--r--app.go18
1 files changed, 12 insertions, 6 deletions
diff --git a/app.go b/app.go
index 48621a2..4ccf47a 100644
--- a/app.go
+++ b/app.go
@@ -359,15 +359,21 @@ func (app *App) handleInput(buffer, content string) {
case "J", "JOIN":
app.s.Join(args)
case "PART":
- if buffer == ui.Home {
- return
+ channel := buffer
+ reason := args
+ spl := strings.SplitN(args, " ", 2)
+ if 0 < len(spl) && app.s.IsChannel(spl[0]) {
+ channel = spl[0]
+ if 1 < len(spl) {
+ reason = spl[1]
+ } else {
+ reason = ""
+ }
}
- if args == "" {
- args = buffer
+ if channel != ui.Home {
+ app.s.Part(channel, reason)
}
-
- app.s.Part(args)
case "NAMES":
if buffer == ui.Home {
return