|
@@ -1737,7 +1737,7 @@ func metadataHandler(server *Server, client *Client, msg ircmsg.Message, rb *Res
|
1737
|
1737
|
continue
|
1738
|
1738
|
}
|
1739
|
1739
|
|
1740
|
|
- if len(rb.session.subscribedMetadataKeys)+len(addedKeys) > config.MaxSubs {
|
|
1740
|
+ if rb.session.subscribedMetadataKeys.Size() > config.MaxSubs {
|
1741
|
1741
|
rb.Add(nil, server.name, ERR_METADATATOOMANYSUBS, client.nick, key)
|
1742
|
1742
|
break
|
1743
|
1743
|
}
|
|
@@ -1754,8 +1754,8 @@ func metadataHandler(server *Server, client *Client, msg ircmsg.Message, rb *Res
|
1754
|
1754
|
}
|
1755
|
1755
|
|
1756
|
1756
|
addedKeys = append(addedKeys, key)
|
|
1757
|
+ rb.session.subscribedMetadataKeys.Add(key)
|
1757
|
1758
|
}
|
1758
|
|
- rb.session.subscribedMetadataKeys.Add(addedKeys...)
|
1759
|
1759
|
|
1760
|
1760
|
if len(addedKeys) > 0 {
|
1761
|
1761
|
rb.Add(nil, server.name, RPL_METADATASUBOK, client.nick, strings.Join(addedKeys, " "))
|
|
@@ -1779,8 +1779,8 @@ func metadataHandler(server *Server, client *Client, msg ircmsg.Message, rb *Res
|
1779
|
1779
|
}
|
1780
|
1780
|
|
1781
|
1781
|
removedKeys = append(removedKeys, key)
|
|
1782
|
+ rb.session.subscribedMetadataKeys.Remove(key)
|
1782
|
1783
|
}
|
1783
|
|
- rb.session.subscribedMetadataKeys.Remove(removedKeys...)
|
1784
|
1784
|
|
1785
|
1785
|
if len(removedKeys) > 0 {
|
1786
|
1786
|
rb.Add(nil, server.name, RPL_METADATAUNSUBOK, client.nick, strings.Join(removedKeys, " "))
|
|
@@ -1792,7 +1792,7 @@ func metadataHandler(server *Server, client *Client, msg ircmsg.Message, rb *Res
|
1792
|
1792
|
defer rb.session.stateMutex.RUnlock()
|
1793
|
1793
|
if rb.session.subscribedMetadataKeys.Size() > 0 {
|
1794
|
1794
|
//TODO: loop and return subscriptions with multiple numerics if we need to
|
1795
|
|
- rb.Add(nil, server.name, RPL_METADATASUBS, client.nick, strings.Join(rb.session.subscribedMetadataKeys.AsSlice(), " "))
|
|
1795
|
+ rb.Add(nil, server.name, RPL_METADATASUBS, client.nick, strings.Join(rb.session.subscribedMetadataKeys.Keys(), " "))
|
1796
|
1796
|
}
|
1797
|
1797
|
rb.Add(nil, server.name, RPL_METADATAEND, client.nick, "end of metadata")
|
1798
|
1798
|
}
|