Do not send push notifications for channels being actively viewed (#3931)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
eb0111f6bb
Коммит
f32eb525f3
@@ -24,6 +24,7 @@ func NewSqlStatusStore(sqlStore *SqlStore) StatusStore {
|
||||
table := db.AddTableWithName(model.Status{}, "Status").SetKeys(false, "UserId")
|
||||
table.ColMap("UserId").SetMaxSize(26)
|
||||
table.ColMap("Status").SetMaxSize(32)
|
||||
table.ColMap("ActiveChannel").SetMaxSize(26)
|
||||
}
|
||||
|
||||
return s
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
func TestSqlStatusStore(t *testing.T) {
|
||||
Setup()
|
||||
|
||||
status := &model.Status{model.NewId(), model.STATUS_ONLINE, false, 0}
|
||||
status := &model.Status{model.NewId(), model.STATUS_ONLINE, false, 0, ""}
|
||||
|
||||
if err := (<-store.Status().SaveOrUpdate(status)).Err; err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -28,12 +28,12 @@ func TestSqlStatusStore(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
status2 := &model.Status{model.NewId(), model.STATUS_AWAY, false, 0}
|
||||
status2 := &model.Status{model.NewId(), model.STATUS_AWAY, false, 0, ""}
|
||||
if err := (<-store.Status().SaveOrUpdate(status2)).Err; err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
status3 := &model.Status{model.NewId(), model.STATUS_OFFLINE, false, 0}
|
||||
status3 := &model.Status{model.NewId(), model.STATUS_OFFLINE, false, 0, ""}
|
||||
if err := (<-store.Status().SaveOrUpdate(status3)).Err; err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -81,7 +81,7 @@ func TestSqlStatusStore(t *testing.T) {
|
||||
func TestActiveUserCount(t *testing.T) {
|
||||
Setup()
|
||||
|
||||
status := &model.Status{model.NewId(), model.STATUS_ONLINE, false, model.GetMillis()}
|
||||
status := &model.Status{model.NewId(), model.STATUS_ONLINE, false, model.GetMillis(), ""}
|
||||
Must(store.Status().SaveOrUpdate(status))
|
||||
|
||||
if result := <-store.Status().GetTotalActiveUsersCount(); result.Err != nil {
|
||||
|
||||
@@ -180,7 +180,9 @@ func UpgradeDatabaseToVersion33(sqlStore *SqlStore) {
|
||||
|
||||
func UpgradeDatabaseToVersion34(sqlStore *SqlStore) {
|
||||
if shouldPerformUpgrade(sqlStore, VERSION_3_3_0, VERSION_3_4_0) {
|
||||
|
||||
sqlStore.CreateColumnIfNotExists("Status", "Manual", "BOOLEAN", "BOOLEAN", "0")
|
||||
sqlStore.CreateColumnIfNotExists("Status", "ActiveChannel", "varchar(26)", "varchar(26)", "")
|
||||
|
||||
// TODO XXX FIXME should be removed before release
|
||||
//saveSchemaVersion(sqlStore, VERSION_3_4_0)
|
||||
|
||||
Ссылка в новой задаче
Block a user