Index: trunk/upstream.go
===================================================================
--- trunk/upstream.go	(revision 259)
+++ trunk/upstream.go	(revision 260)
@@ -765,5 +765,5 @@
 
 			uc.forEachDownstream(func(dc *downstreamConn) {
-				params := []string{dc.nick, dc.marshalEntity(uc, channel), modeStr}
+				params := []string{dc.nick, dc.marshalEntity(uc.network, channel), modeStr}
 				params = append(params, modeParams...)
 
@@ -827,5 +827,5 @@
 				Prefix:  dc.srv.prefix(),
 				Command: irc.RPL_LIST,
-				Params:  []string{dc.nick, dc.marshalEntity(uc, channel), clients, topic},
+				Params:  []string{dc.nick, dc.marshalEntity(uc.network, channel), clients, topic},
 			})
 		})
@@ -845,9 +845,9 @@
 			// NAMES on a channel we have not joined, forward to downstream
 			uc.forEachDownstreamByID(downstreamID, func(dc *downstreamConn) {
-				channel := dc.marshalEntity(uc, name)
+				channel := dc.marshalEntity(uc.network, name)
 				members := splitSpace(members)
 				for i, member := range members {
 					membership, nick := uc.parseMembershipPrefix(member)
-					members[i] = membership.String() + dc.marshalEntity(uc, nick)
+					members[i] = membership.String() + dc.marshalEntity(uc.network, nick)
 				}
 				memberStr := strings.Join(members, " ")
@@ -882,5 +882,5 @@
 			// NAMES on a channel we have not joined, forward to downstream
 			uc.forEachDownstreamByID(downstreamID, func(dc *downstreamConn) {
-				channel := dc.marshalEntity(uc, name)
+				channel := dc.marshalEntity(uc.network, name)
 
 				dc.SendMessage(&irc.Message{
@@ -923,7 +923,7 @@
 			channel := channel
 			if channel != "*" {
-				channel = dc.marshalEntity(uc, channel)
-			}
-			nick := dc.marshalEntity(uc, nick)
+				channel = dc.marshalEntity(uc.network, channel)
+			}
+			nick := dc.marshalEntity(uc.network, nick)
 			dc.SendMessage(&irc.Message{
 				Prefix:  dc.srv.prefix(),
@@ -942,5 +942,5 @@
 			if name != "*" {
 				// TODO: support WHO masks
-				name = dc.marshalEntity(uc, name)
+				name = dc.marshalEntity(uc.network, name)
 			}
 			dc.SendMessage(&irc.Message{
@@ -957,5 +957,5 @@
 
 		uc.forEachDownstreamByID(downstreamID, func(dc *downstreamConn) {
-			nick := dc.marshalEntity(uc, nick)
+			nick := dc.marshalEntity(uc.network, nick)
 			dc.SendMessage(&irc.Message{
 				Prefix:  dc.srv.prefix(),
@@ -971,5 +971,5 @@
 
 		uc.forEachDownstreamByID(downstreamID, func(dc *downstreamConn) {
-			nick := dc.marshalEntity(uc, nick)
+			nick := dc.marshalEntity(uc.network, nick)
 			dc.SendMessage(&irc.Message{
 				Prefix:  dc.srv.prefix(),
@@ -985,5 +985,5 @@
 
 		uc.forEachDownstreamByID(downstreamID, func(dc *downstreamConn) {
-			nick := dc.marshalEntity(uc, nick)
+			nick := dc.marshalEntity(uc.network, nick)
 			dc.SendMessage(&irc.Message{
 				Prefix:  dc.srv.prefix(),
@@ -999,5 +999,5 @@
 
 		uc.forEachDownstreamByID(downstreamID, func(dc *downstreamConn) {
-			nick := dc.marshalEntity(uc, nick)
+			nick := dc.marshalEntity(uc.network, nick)
 			params := []string{dc.nick, nick}
 			params = append(params, msg.Params[2:]...)
@@ -1016,9 +1016,9 @@
 
 		uc.forEachDownstreamByID(downstreamID, func(dc *downstreamConn) {
-			nick := dc.marshalEntity(uc, nick)
+			nick := dc.marshalEntity(uc.network, nick)
 			channelList := make([]string, len(channels))
 			for i, channel := range channels {
 				prefix, channel := uc.parseMembershipPrefix(channel)
-				channel = dc.marshalEntity(uc, channel)
+				channel = dc.marshalEntity(uc.network, channel)
 				channelList[i] = prefix.String() + channel
 			}
@@ -1037,5 +1037,5 @@
 
 		uc.forEachDownstreamByID(downstreamID, func(dc *downstreamConn) {
-			nick := dc.marshalEntity(uc, nick)
+			nick := dc.marshalEntity(uc.network, nick)
 			dc.SendMessage(&irc.Message{
 				Prefix:  dc.srv.prefix(),
@@ -1077,7 +1077,7 @@
 		uc.forEachDownstream(func(dc *downstreamConn) {
 			dc.SendMessage(&irc.Message{
-				Prefix:  dc.marshalUserPrefix(uc, msg.Prefix),
+				Prefix:  dc.marshalUserPrefix(uc.network, msg.Prefix),
 				Command: "INVITE",
-				Params:  []string{dc.marshalEntity(uc, nick), dc.marshalEntity(uc, channel)},
+				Params:  []string{dc.marshalEntity(uc.network, nick), dc.marshalEntity(uc.network, channel)},
 			})
 		})
@@ -1093,5 +1093,5 @@
 				Prefix:  dc.srv.prefix(),
 				Command: irc.RPL_INVITING,
-				Params:  []string{dc.nick, dc.marshalEntity(uc, nick), dc.marshalEntity(uc, channel)},
+				Params:  []string{dc.nick, dc.marshalEntity(uc.network, nick), dc.marshalEntity(uc.network, channel)},
 			})
 		})
