1
0
Fork 0
forked from External/ergo

add client compatibility switches

This commit is contained in:
Shivaram Lingamneni 2019-05-09 14:18:30 -04:00
parent 939729a7c0
commit fbc6c84a01
6 changed files with 54 additions and 17 deletions

View file

@ -1085,7 +1085,8 @@ var (
func (session *Session) SendRawMessage(message ircmsg.IrcMessage, blocking bool) error {
// use dumb hack to force the last param to be a trailing param if required
var usedTrailingHack bool
if commandsThatMustUseTrailing[message.Command] && len(message.Params) > 0 {
config := session.client.server.Config()
if config.Server.Compatibility.forceTrailing && commandsThatMustUseTrailing[message.Command] && len(message.Params) > 0 {
lastParam := message.Params[len(message.Params)-1]
// to force trailing, we ensure the final param contains a space
if strings.IndexByte(lastParam, ' ') == -1 {