mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[APIv4] add getChannelMembersTimezone (#9286)
* add getChannelMembersTimezone * update per feedback review * add delimeter to error
This commit is contained in:
committed by
GitHub
parent
e87965f39d
commit
908ed5555f
@@ -564,3 +564,26 @@ func IsDomainName(s string) bool {
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
func RemoveDuplicateStrings(in []string) []string {
|
||||
out := []string{}
|
||||
seen := make(map[string]bool, len(in))
|
||||
|
||||
for _, item := range in {
|
||||
if !seen[item] {
|
||||
out = append(out, item)
|
||||
|
||||
seen[item] = true
|
||||
}
|
||||
}
|
||||
|
||||
return out
|
||||
}
|
||||
|
||||
func GetPreferredTimezone(timezone StringMap) string {
|
||||
if timezone["useAutomaticTimezone"] == "true" {
|
||||
return timezone["automaticTimezone"]
|
||||
}
|
||||
|
||||
return timezone["manualTimezone"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user