fix: also append the day's date if we append a message with a different date than the last channel date

This commit is contained in:
2025-08-29 15:59:46 +02:00
parent f88c2af404
commit 096743adca
6 changed files with 78 additions and 92 deletions
+4 -8
View File
@@ -17,7 +17,6 @@
package cmds
import (
"fmt"
"time"
tea "github.com/charmbracelet/bubbletea"
@@ -41,18 +40,15 @@ func Quit(client *irc.Client) tea.Cmd {
}
type SendPrivMsgMsg struct {
Msg string
Timestamp string
Msg string
Datetime time.Time
}
func SendPrivMsg(msg string) tea.Cmd {
return func() tea.Msg {
now := time.Now()
timestamp := fmt.Sprintf("[%02d:%02d]", now.Hour(), now.Minute())
return SendPrivMsgMsg{
Msg: msg,
Timestamp: timestamp,
Msg: msg,
Datetime: time.Now(),
}
}
}