mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-22 18:52:41 +01:00
omit prefix for non-numeric replies from the server
This commit is contained in:
parent
23f01ff9ee
commit
0ad05abf5f
@ -8,7 +8,14 @@ import (
|
||||
|
||||
func NewStringReply(source Identifier, code StringCode,
|
||||
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...)
|
||||
return header + message
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user