4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-05 03:34:03 +00:00

Update vendor (#1297)

This commit is contained in:
Wim
2020-11-22 15:55:57 +01:00
committed by GitHub
parent cbb46293ab
commit 4cc2c914e6
166 changed files with 25790 additions and 14376 deletions

View File

@ -6,6 +6,7 @@ package model
import (
"encoding/json"
"io"
"regexp"
)
type SidebarCategoryType string
@ -109,3 +110,15 @@ func (o OrderedSidebarCategories) ToJson() []byte {
return b
}
}
var categoryIdPattern = regexp.MustCompile("(favorites|channels|direct_messages)_[a-z0-9]{26}_[a-z0-9]{26}")
func IsValidCategoryId(s string) bool {
// Category IDs can either be regular IDs
if IsValidId(s) {
return true
}
// Or default categories can follow the pattern {type}_{userID}_{teamID}
return categoryIdPattern.MatchString(s)
}