Remove upstream prefix for outgoing MODE and PRIVMSG
We shouldn't set the prefix when sending these commands.
This commit is contained in:
parent
c366b5320c
commit
d1550a3cdb
@ -421,7 +421,6 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
|
|||||||
|
|
||||||
if modeStr != "" {
|
if modeStr != "" {
|
||||||
uc.SendMessage(&irc.Message{
|
uc.SendMessage(&irc.Message{
|
||||||
Prefix: uc.prefix(),
|
|
||||||
Command: "MODE",
|
Command: "MODE",
|
||||||
Params: []string{upstreamName, modeStr},
|
Params: []string{upstreamName, modeStr},
|
||||||
})
|
})
|
||||||
@ -451,7 +450,6 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
|
|||||||
if modeStr != "" {
|
if modeStr != "" {
|
||||||
dc.user.forEachUpstream(func(uc *upstreamConn) {
|
dc.user.forEachUpstream(func(uc *upstreamConn) {
|
||||||
uc.SendMessage(&irc.Message{
|
uc.SendMessage(&irc.Message{
|
||||||
Prefix: uc.prefix(),
|
|
||||||
Command: "MODE",
|
Command: "MODE",
|
||||||
Params: []string{uc.nick, modeStr},
|
Params: []string{uc.nick, modeStr},
|
||||||
})
|
})
|
||||||
@ -477,7 +475,6 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uc.SendMessage(&irc.Message{
|
uc.SendMessage(&irc.Message{
|
||||||
Prefix: uc.prefix(),
|
|
||||||
Command: "PRIVMSG",
|
Command: "PRIVMSG",
|
||||||
Params: []string{upstreamName, text},
|
Params: []string{upstreamName, text},
|
||||||
})
|
})
|
||||||
|
@ -91,14 +91,6 @@ func connectToUpstream(u *user, upstream *Upstream) (*upstreamConn, error) {
|
|||||||
return uc, nil
|
return uc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (uc *upstreamConn) prefix() *irc.Prefix {
|
|
||||||
return &irc.Prefix{
|
|
||||||
Name: uc.nick,
|
|
||||||
User: uc.upstream.Username,
|
|
||||||
// TODO: fill the host?
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (uc *upstreamConn) Close() error {
|
func (uc *upstreamConn) Close() error {
|
||||||
if uc.closed {
|
if uc.closed {
|
||||||
return fmt.Errorf("upstream connection already closed")
|
return fmt.Errorf("upstream connection already closed")
|
||||||
|
Loading…
Reference in New Issue
Block a user