mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
move some helpers
This commit is contained in:
parent
7f4dd149e6
commit
62980d76bd
2 changed files with 20 additions and 20 deletions
|
|
@ -3367,26 +3367,6 @@ func metadataSubsHandler(client *Client, subcommand string, params []string, rb
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func playMetadataList(rb *ResponseBuffer, nick, target string, values map[string]string) {
|
|
||||||
batchId := rb.StartNestedBatch("metadata", target)
|
|
||||||
defer rb.EndNestedBatch(batchId)
|
|
||||||
|
|
||||||
for key, val := range values {
|
|
||||||
visibility := "*"
|
|
||||||
rb.Add(nil, rb.session.client.server.name, RPL_KEYVALUE, nick, target, key, visibility, val)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func playMetadataVerbBatch(rb *ResponseBuffer, target string, values map[string]string) {
|
|
||||||
batchId := rb.StartNestedBatch("metadata", target)
|
|
||||||
defer rb.EndNestedBatch(batchId)
|
|
||||||
|
|
||||||
for key, val := range values {
|
|
||||||
visibility := "*"
|
|
||||||
rb.Add(nil, rb.session.client.server.name, "METADATA", target, key, visibility, val)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// REHASH
|
// REHASH
|
||||||
func rehashHandler(server *Server, client *Client, msg ircmsg.Message, rb *ResponseBuffer) bool {
|
func rehashHandler(server *Server, client *Client, msg ircmsg.Message, rb *ResponseBuffer) bool {
|
||||||
nick := client.Nick()
|
nick := client.Nick()
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,26 @@ func syncChannelMetadata(server *Server, rb *ResponseBuffer, channel *Channel) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func playMetadataList(rb *ResponseBuffer, nick, target string, values map[string]string) {
|
||||||
|
batchId := rb.StartNestedBatch("metadata", target)
|
||||||
|
defer rb.EndNestedBatch(batchId)
|
||||||
|
|
||||||
|
for key, val := range values {
|
||||||
|
visibility := "*"
|
||||||
|
rb.Add(nil, rb.session.client.server.name, RPL_KEYVALUE, nick, target, key, visibility, val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func playMetadataVerbBatch(rb *ResponseBuffer, target string, values map[string]string) {
|
||||||
|
batchId := rb.StartNestedBatch("metadata", target)
|
||||||
|
defer rb.EndNestedBatch(batchId)
|
||||||
|
|
||||||
|
for key, val := range values {
|
||||||
|
visibility := "*"
|
||||||
|
rb.Add(nil, rb.session.client.server.name, "METADATA", target, key, visibility, val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var validMetadataKeyRegexp = regexp.MustCompile("^[a-z0-9_./-]+$")
|
var validMetadataKeyRegexp = regexp.MustCompile("^[a-z0-9_./-]+$")
|
||||||
|
|
||||||
func metadataKeyIsEvil(key string) bool {
|
func metadataKeyIsEvil(key string) bool {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue