add capability to disable chat feature for groups/syncshells

This commit is contained in:
Abelfreyja
2025-12-22 10:24:34 +09:00
parent 6d49389bd4
commit e58210e770
6 changed files with 105 additions and 9 deletions

View File

@@ -80,6 +80,9 @@ public class LightlessDbContext : DbContext
.WithOne(p => p.Group)
.HasForeignKey<GroupProfile>(p => p.GroupGID)
.IsRequired(false);
mb.Entity<Group>()
.Property(g => g.ChatEnabled)
.HasDefaultValue(true);
mb.Entity<GroupPair>().ToTable("group_pairs");
mb.Entity<GroupPair>().HasKey(u => new { u.GroupGID, u.GroupUserUID });
mb.Entity<GroupPair>().HasIndex(c => c.GroupUserUID);

View File

@@ -468,6 +468,11 @@ namespace LightlessSyncServer.Migrations
.HasColumnType("boolean")
.HasColumnName("prefer_disable_vfx");
b.Property<bool>("ChatEnabled")
.HasColumnType("boolean")
.HasColumnName("chat_enabled")
.HasDefaultValue(true);
b.HasKey("GID")
.HasName("pk_groups");

View File

@@ -19,5 +19,6 @@ public class Group
public bool PreferDisableSounds { get; set; }
public bool PreferDisableAnimations { get; set; }
public bool PreferDisableVFX { get; set; }
public bool ChatEnabled { get; set; } = true;
public DateTime CreatedDate { get; set; } = DateTime.UtcNow;
}