Document downstreamConn.{,un}marshalEntity
git-svn-id: file:///srv/svn/repo/suika/trunk@249 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This commit is contained in:
parent
cec36bb0e1
commit
1f25d77be5
@ -121,6 +121,11 @@ func (dc *downstreamConn) upstream() *upstreamConn {
|
|||||||
return dc.network.upstream()
|
return dc.network.upstream()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// marshalEntity converts an upstream entity name (ie. channel or nick) into a
|
||||||
|
// downstream entity name.
|
||||||
|
//
|
||||||
|
// This involves adding a "/<network>" suffix if the entity isn't the current
|
||||||
|
// user.
|
||||||
func (dc *downstreamConn) marshalEntity(uc *upstreamConn, entity string) string {
|
func (dc *downstreamConn) marshalEntity(uc *upstreamConn, entity string) string {
|
||||||
if uc.isChannel(entity) {
|
if uc.isChannel(entity) {
|
||||||
return dc.marshalChannel(uc, entity)
|
return dc.marshalChannel(uc, entity)
|
||||||
@ -135,6 +140,10 @@ func (dc *downstreamConn) marshalChannel(uc *upstreamConn, name string) string {
|
|||||||
return name + "/" + uc.network.GetName()
|
return name + "/" + uc.network.GetName()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// unmarshalEntity converts a downstream entity name (ie. channel or nick) into
|
||||||
|
// an upstream entity name.
|
||||||
|
//
|
||||||
|
// This involves removing the "/<network>" suffix.
|
||||||
func (dc *downstreamConn) unmarshalEntity(name string) (*upstreamConn, string, error) {
|
func (dc *downstreamConn) unmarshalEntity(name string) (*upstreamConn, string, error) {
|
||||||
if uc := dc.upstream(); uc != nil {
|
if uc := dc.upstream(); uc != nil {
|
||||||
return uc, name, nil
|
return uc, name, nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user