LoChat/TODO.md

2.6 KiB

LoChat Development TODO

Last updated: 2026-07-05


✅ COMPLETED THIS SESSION

Architecture (SOLID/KISS/DRY)

  • AppearanceConfig — fixed double-call bug
  • config/ — 9→3 files per folder (subfolders: chat/, filter/, mute/, manager/)
  • api/service/ + core/service/ — 8→3 files per folder (subfolders: chat/, player/, moderation/, pm/, spy/, ignore/)
  • ConfigManager — god class → facade + 6 managers (Chat/Pm/Mention/ClearChat/CustomMessages/Filters)
  • MessagingService — fat interface → 3 services (PrivateMessageService/SpyService/IgnoreService)
  • AdvancedMessageFilter — hardcoded pipeline → FilterPipeline with dynamic registration
  • 25 commands → BaseCommand/AdminCommand/PlayerCommand hierarchy
  • MuteCommand — decomposed into helper methods (KISS fix)

Encapsulation

  • ChatEventListener — removed instanceof cast to PlayerServiceImpl
  • PunishmentSnapshot — mutable fields → private + getters
  • BaseConfig — protected fields → private + protected getters
  • 29 files with import.* → explicit imports

Checkstyle

  • Config: 4-space indent, 140-char lines, Google-style naming/quality
  • Warnings: 520 → 0 (both main and test)
  • Wired into build.gradle.kts

Configs

  • All rewritten: clean, English comments, no Spacelegacy palette

🟡 REMAINING (COULD DO)

1. Shared Persistence Utility

5 services repeat load/save/ensureDir pattern:

  • NickServiceImpl, PlayerServiceImpl, ChatServiceImpl, PunishmentServiceImpl, IgnoreServiceImpl

Fix: Extract FilePersistenceUtil or base class

2. Mute Duration Permissions Not Declared in plugin.yml

lochat.mute.dur.5m, lochat.mute.dur.3h, lochat.mute.reason.* — used in code/configs but missing from plugin.yml declarations.

3. DIP: Service Locator Anti-Pattern

ServiceRegistry.get(Xxx.class) used everywhere instead of constructor DI. Big refactor.

4. DRY: PM Send Logic Duplicated

MsgCommand + ReplyCommand still have near-identical send logic.

5. PM Send Logic Duplicated Between MsgCommand and ReplyCommand


🔵 LOW PRIORITY

6. Tests

Only 4 test files for 150+ main files. Very low coverage.

7. Aho-Corasick for Swear Filter

Performance optimization for word filtering.

8. Discord Rate Limiter

Prevent rate limiting when sending many webhook messages.


📋 KNOWN ISSUES

  • Gradients may not display correctly on clients < 1.16
  • Some filters may block legitimate messages (configurable in config/filters.yml)