commit cf883fc

Hubert Hirtz  ·  2020-08-19 09:28:00 +0000 UTC
parent 3adffd7
ui: Show self /msg and /r even if echo-message is off
1 files changed,  +17, -1
M app.go
M app.go
+17, -1
 1@@ -379,8 +379,24 @@ func (app *App) handleInput(buffer, content string) {
 2 		target := split[0]
 3 		content := split[1]
 4 		app.s.PrivMsg(target, content)
 5-		// TODO echo mssage
 6+		if !app.s.HasCapability("echo-message") {
 7+			if app.s.IsChannel(target) {
 8+				buffer = ui.Home
 9+			} else {
10+				buffer = target
11+			}
12+			line := ui.LineFromIRCMessage(time.Now(), app.s.Nick(), content, false, false)
13+			app.win.AddLine(buffer, line)
14+		}
15 	case "R":
16+		if buffer != ui.Home {
17+			return
18+		}
19+
20 		app.s.PrivMsg(app.lastQuery, args)
21+		if !app.s.HasCapability("echo-message") {
22+			line := ui.LineFromIRCMessage(time.Now(), app.s.Nick(), args, false, false)
23+			app.win.AddLine(ui.Home, line)
24+		}
25 	}
26 }