mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-21 23:08:11 -07:00
make TAGMSG storage configurable
This commit is contained in:
@@ -29,12 +29,6 @@ const (
|
||||
initialAutoSize = 32
|
||||
)
|
||||
|
||||
// a Tagmsg that consists entirely of transient tags is not stored
|
||||
var transientTags = map[string]bool{
|
||||
"+draft/typing": true,
|
||||
"+typing": true, // future-proofing
|
||||
}
|
||||
|
||||
// Item represents an event (e.g., a PRIVMSG or a JOIN) and its associated data
|
||||
type Item struct {
|
||||
Type ItemType
|
||||
@@ -57,23 +51,6 @@ func (item *Item) HasMsgid(msgid string) bool {
|
||||
return item.Message.Msgid == msgid
|
||||
}
|
||||
|
||||
func (item *Item) IsStorable() bool {
|
||||
switch item.Type {
|
||||
case Tagmsg:
|
||||
for name := range item.Tags {
|
||||
if !transientTags[name] {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false // all tags were blacklisted
|
||||
case Privmsg, Notice:
|
||||
// don't store CTCP other than ACTION
|
||||
return !item.Message.IsRestrictedCTCPMessage()
|
||||
default:
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
type Predicate func(item *Item) (matches bool)
|
||||
|
||||
func Reverse(results []Item) {
|
||||
|
||||
Reference in New Issue
Block a user