diff --git a/downstream.go b/downstream.go index 1ccad42..32ffd6f 100644 --- a/downstream.go +++ b/downstream.go @@ -997,7 +997,7 @@ func (dc *downstreamConn) welcome() error { // Fast-forward history to last message for target, entry := range net.delivered.innerMap { - delivered := entry.value.(map[string]string) + delivered := entry.value.(deliveredClientMap) ch := net.channels.Value(target) if ch != nil && ch.Detached { continue diff --git a/irc.go b/irc.go index ae0ae43..5aeeb95 100644 --- a/irc.go +++ b/irc.go @@ -600,12 +600,12 @@ func (cm *membershipsCasemapMap) Value(name string) *memberships { return entry.value.(*memberships) } -type mapStringStringCasemapMap struct{ casemapMap } +type deliveredCasemapMap struct{ casemapMap } -func (cm *mapStringStringCasemapMap) Value(name string) map[string]string { +func (cm *deliveredCasemapMap) Value(name string) deliveredClientMap { entry, ok := cm.innerMap[cm.casemap(name)] if !ok { return nil } - return entry.value.(map[string]string) + return entry.value.(deliveredClientMap) } diff --git a/upstream.go b/upstream.go index 42143e2..616151e 100644 --- a/upstream.go +++ b/upstream.go @@ -1754,7 +1754,7 @@ func (uc *upstreamConn) appendLog(entity string, msg *irc.Message) (msgID string return "" } - delivered = make(map[string]string) + delivered = make(deliveredClientMap) uc.network.delivered.SetValue(entity, delivered) for clientName, _ := range uc.network.offlineClients { diff --git a/user.go b/user.go index c7a0aa9..9dcc260 100644 --- a/user.go +++ b/user.go @@ -55,6 +55,8 @@ type eventChannelDetach struct { type eventStop struct{} +type deliveredClientMap map[string]string // client name -> msg ID + type network struct { Network user *user @@ -62,8 +64,8 @@ type network struct { conn *upstreamConn channels channelCasemapMap - delivered mapStringStringCasemapMap // entity -> client name -> msg ID - offlineClients map[string]struct{} // indexed by client name + delivered deliveredCasemapMap + offlineClients map[string]struct{} // indexed by client name lastError error casemap casemapping } @@ -80,7 +82,7 @@ func newNetwork(user *user, record *Network, channels []Channel) *network { user: user, stopped: make(chan struct{}), channels: m, - delivered: mapStringStringCasemapMap{newCasemapMap(0)}, + delivered: deliveredCasemapMap{newCasemapMap(0)}, offlineClients: make(map[string]struct{}), casemap: casemapRFC1459, }