mirror of
https://github.com/IllusionMan1212/gorc.git
synced 2026-10-24 02:12:33 +00:00
feat: add prefix for not implemented commands
This commit is contained in:
+12
-1
@@ -23,12 +23,16 @@ import (
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
"github.com/illusionman1212/gorc/cmds"
|
||||
"github.com/illusionman1212/gorc/irc"
|
||||
"github.com/illusionman1212/gorc/irc/commands"
|
||||
"github.com/illusionman1212/gorc/irc/parser"
|
||||
"github.com/illusionman1212/gorc/ui"
|
||||
)
|
||||
|
||||
var notImpl = lipgloss.NewStyle().Foreground(ui.Red).Render("[NOT IMPL]")
|
||||
|
||||
func ReadLoop(client *irc.Client) {
|
||||
// 512 bytes as a base + 8192 additional bytes for tags
|
||||
r := bufio.NewReaderSize(client.TcpConn, 8192+512)
|
||||
@@ -310,7 +314,14 @@ func HandleCommand(msg parser.IRCMessage, client *irc.Client) {
|
||||
// start a timeout and update said timeout on every RPL_MOTD
|
||||
// and log an error if timeout ends without receiving this command.
|
||||
default:
|
||||
fullMsg := fmt.Sprintf("%s %s %s %s", msg.Tags, msg.Source, msg.Command, strings.Join(msg.Parameters, " "))
|
||||
fullMsg := fmt.Sprintf(
|
||||
"%s %s %s %s %s",
|
||||
notImpl,
|
||||
msg.Tags,
|
||||
msg.Source,
|
||||
msg.Command,
|
||||
strings.Join(msg.Parameters, " "),
|
||||
)
|
||||
|
||||
client.Channels[0].History += fullMsg + irc.CRLF
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user