3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-10 22:19:31 +01:00

omit prefix for non-numeric replies from the server

This commit is contained in:
Jeremy Latt 2014-02-20 19:55:17 -08:00
parent 23f01ff9ee
commit 0ad05abf5f

View File

@ -8,7 +8,14 @@ import (
func NewStringReply(source Identifier, code StringCode, func NewStringReply(source Identifier, code StringCode,
format string, args ...interface{}) string { format string, args ...interface{}) string {
header := fmt.Sprintf(":%s %s ", source, code) var header string
switch source.(type) {
case *Server:
// TODO only omit prefix for local server
header = fmt.Sprintf("%s ", code)
default:
header = fmt.Sprintf(":%s %s ", source, code)
}
message := fmt.Sprintf(format, args...) message := fmt.Sprintf(format, args...)
return header + message return header + message
} }