Convert autoproxy timeout to use seconds

This commit is contained in:
Ske
2020-12-08 12:57:17 +01:00
parent ab3ccac60f
commit db4e41a232
6 changed files with 36 additions and 25 deletions

View File

@@ -25,6 +25,6 @@ namespace PluralKit.Core
public string? SystemTag { get; }
public string? SystemAvatar { get; }
public bool AllowAutoproxy { get; }
public int LatchTimeout { get; }
public int? LatchTimeout { get; }
}
}

View File

@@ -1,9 +1,10 @@
-- SCHEMA VERSION 12: <insert date> --
-- SCHEMA VERSION 12: 2020-12-08 --
-- Add disabling front/latch autoproxy per-member --
-- Add disabling autoproxy per-account --
-- Add configurable latch timeout --
alter table members add column allow_autoproxy bool not null default true;
alter table accounts add column allow_autoproxy bool not null default true;
alter table systems add column latch_timeout int not null default -1;
alter table systems add column latch_timeout int; -- in seconds
update info set schema_version = 12;

View File

@@ -18,7 +18,7 @@ namespace PluralKit.Core {
public Instant Created { get; }
public string UiTz { get; set; }
public bool PingsEnabled { get; }
public int LatchTimeout { get; }
public int? LatchTimeout { get; }
public PrivacyLevel DescriptionPrivacy { get; }
public PrivacyLevel MemberListPrivacy { get;}
public PrivacyLevel FrontPrivacy { get; }

View File

@@ -15,7 +15,7 @@ namespace PluralKit.Core
public Partial<PrivacyLevel> FrontPrivacy { get; set; }
public Partial<PrivacyLevel> FrontHistoryPrivacy { get; set; }
public Partial<bool> PingsEnabled { get; set; }
public Partial<int> LatchTimeout { get; set; }
public Partial<int?> LatchTimeout { get; set; }
public override UpdateQueryBuilder Apply(UpdateQueryBuilder b) => b
.With("name", Name)