Disallow marshalling for anotehr network
This commit is contained in:
parent
e508f2ca81
commit
96be0b5945
@ -128,6 +128,9 @@ func (dc *downstreamConn) upstream() *upstreamConn {
|
|||||||
// user.
|
// user.
|
||||||
func (dc *downstreamConn) marshalEntity(uc *upstreamConn, name string) string {
|
func (dc *downstreamConn) marshalEntity(uc *upstreamConn, name string) string {
|
||||||
if dc.network != nil {
|
if dc.network != nil {
|
||||||
|
if dc.network != uc.network {
|
||||||
|
panic("soju: tried to marshal an entity for another network")
|
||||||
|
}
|
||||||
return name
|
return name
|
||||||
}
|
}
|
||||||
if name == uc.nick {
|
if name == uc.nick {
|
||||||
@ -149,6 +152,9 @@ func (dc *downstreamConn) marshalUserPrefix(uc *upstreamConn, prefix *irc.Prefix
|
|||||||
return dc.prefix()
|
return dc.prefix()
|
||||||
}
|
}
|
||||||
if dc.network != nil {
|
if dc.network != nil {
|
||||||
|
if dc.network != uc.network {
|
||||||
|
panic("soju: tried to marshal a user prefix for another network")
|
||||||
|
}
|
||||||
return prefix
|
return prefix
|
||||||
}
|
}
|
||||||
return &irc.Prefix{
|
return &irc.Prefix{
|
||||||
|
Loading…
Reference in New Issue
Block a user