[APIv4] add getChannelMembersTimezone (#9286)

* add getChannelMembersTimezone

* update per feedback review

* add delimeter to error
This commit is contained in:
Carlos Tadeu Panato Junior
2018-10-13 12:35:57 +02:00
committed by GitHub
parent e87965f39d
commit 908ed5555f
11 changed files with 203 additions and 7 deletions

View File

@@ -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"]
}