Do not send push notifications for channels being actively viewed (#3931)

Этот коммит содержится в:
Joram Wilander
2016-09-02 12:50:15 -04:00
коммит произвёл GitHub
родитель eb0111f6bb
Коммит f32eb525f3
20 изменённых файлов: 213 добавлений и 47 удалений

Просмотреть файл

@@ -378,24 +378,6 @@ func (u *User) IsLDAPUser() bool {
return false
}
func (u *User) StatusAllowsPushNotification(status *Status) bool {
props := u.NotifyProps
if props["push"] == "none" {
return false
}
if pushStatus, ok := props["push_status"]; pushStatus == STATUS_ONLINE || !ok {
return true
} else if pushStatus == STATUS_AWAY && (status.Status == STATUS_AWAY || status.Status == STATUS_OFFLINE) {
return true
} else if pushStatus == STATUS_OFFLINE && status.Status == STATUS_OFFLINE {
return true
}
return false
}
// UserFromJson will decode the input and return a User
func UserFromJson(data io.Reader) *User {
decoder := json.NewDecoder(data)