Skip to content

Audit ChatMessageType coverage end-to-end#60

Open
phyceClaw wants to merge 1 commit into
phyce:1.3.0from
phyceClaw:qol/chat-message-type-audit
Open

Audit ChatMessageType coverage end-to-end#60
phyceClaw wants to merge 1 commit into
phyce:1.3.0from
phyceClaw:qol/chat-message-type-audit

Conversation

@phyceClaw

Copy link
Copy Markdown
Contributor

Summary

End-to-end pass over net.runelite.api.ChatMessageType. Every value is now either explicitly voiced (with a sensible config gate) or explicitly muted — no more silent drops through the "didn't match" branch.

Bug fixes

# What Was Now
1 MODPRIVATECHAT duplicated in both isChatInnerVoice and isChatOtherPlayerVoice Incoming PM from a mod spoke in your voice (inner won the if/else) Removed from inner; mod's PM uses the mod's voice via other-player path
2 CHALREQ_TRADE / CHALREQ_FRIENDSCHAT / CHALREQ_CLANCHAT had a request-gate but no voice routing Even with requests enabled, these fell through and never spoke Added to isChatSystemVoice

Voice routing for previously-dropped types

  • TRADE_SENT → inner voice (it's your own action)
  • FRIENDNOTIFICATION / FRIENDSCHATNOTIFICATION / SNAPSHOTFEEDBACK / DIDYOUKNOW / LEVELUPMESSAGE → system voice
  • SPAM / MODAUTOTYPER → always muted (matches existing AUTOTYPER)

System-message gating consistency

Previously only GAMEMESSAGE / WELCOME / CONSOLE actually respected systemMesagesEnabled. Now all system-voice types do:

  • ENGINE, BROADCAST, IGNORENOTIFICATION, TRADE, PLAYERRELATED, TENSECTIMEOUT, SNAPSHOTFEEDBACK, CLAN_GIM_FORM_GROUP, CLAN_GIM_GROUP_WITH → gated on systemMesagesEnabled.

Dual-gating (channel + system)

Following the precedent PR #40 set for CLAN_MESSAGE:

  • LOGINLOGOUTNOTIFICATION, FRIENDNOTIFICATION, FRIENDSCHATNOTIFICATIONfriendsChat AND systemMesages (these are system messages about friends).
  • CLAN_CREATION_INVITATIONclanChat AND systemMesages.

New toggles (Speech Generation section)

Key Default What
didYouKnow off Speak the periodic "Did you know?" tips.
levelUpMessages off Speak the "Check the skill guide" line that fires with the level-up jingle.

Both default off — they're frequent and most users probably don't want them.

Request-class

  • TRADE_SENTrequestsEnabled (joins existing TRADEREQ / CHALREQ_*).

Out of scope / follow-ups

  • MESBOX (dialog box / book pages) needs widget plumbing like DIALOG already has — separate PR.
  • NPC_SAY likely duplicates OverheadTextChanged events — leaving until verified to avoid double-speech.
  • CLAN_GIM_FORM_GROUP / CLAN_GIM_GROUP_WITH are gated on systemMesages alone here. After PR Add Group Ironman chat support (issue #26) #47 lands they should be dual-gated on groupIronmanChatEnabled + systemMesages to match CLAN_GIM_MESSAGE.
  • PR Gate CLAN_MESSAGE / CLAN_GUEST_MESSAGE on their channel toggle #40 also adds CLAN_GUEST_MESSAGE to isChatSystemVoice and gates it on clanGuestChat + system. Whichever of these two PRs merges second will hit a trivial conflict in those same locations — keep both branches' additions.

Test plan

  • Receive a PM from an actual mod → speaks in the mod's voice (not yours).
  • Send a duel request → voiced (with requests enabled).
  • Send a trade request → voiced (with requests enabled).
  • Friend logs in → voiced only when both friendsChat AND systemMesages are on.
  • Add someone to friends list → "X has been added to your friend list" voiced only with friends + system on.
  • Toggle didYouKnow on → next "Did you know?" tip speaks.
  • Toggle levelUpMessages on → next level-up "Check the skill guide" line speaks.
  • Turn systemMesages off → all system types fall silent (login/logout, broadcasts, trade complete, etc.).
  • AUTOTYPER / MODAUTOTYPER / SPAM messages never speak.

🤖 Generated with Claude Code

On behalf of @phyce

Goes through every value in net.runelite.api.ChatMessageType and makes
sure each one is either (a) explicitly voiced and gated by a sensible
config toggle, or (b) explicitly muted. Previously many types fell into
the silent "didn't match" branch in onChatMessage and were dropped
entirely.

Bug fixes:
  * MODPRIVATECHAT was listed in both isChatInnerVoice and
    isChatOtherPlayerVoice. Inner won the if/else, so an incoming PM
    from a mod was spoken in the local player's voice. Removed from
    isChatInnerVoice so MODPRIVATECHAT now correctly uses the mod's
    voice via the other-player path.
  * CHALREQ_TRADE / CHALREQ_FRIENDSCHAT / CHALREQ_CLANCHAT were gated
    on requestsEnabled but never routed to any voice, so even when
    enabled they fell through to "didn't match" and never spoke. Added
    to isChatSystemVoice.

Voice routing for previously-dropped types:
  * TRADE_SENT  -> inner voice (it's your own action)
  * FRIENDNOTIFICATION, FRIENDSCHATNOTIFICATION, SNAPSHOTFEEDBACK,
    DIDYOUKNOW, LEVELUPMESSAGE -> system voice
  * SPAM, MODAUTOTYPER -> always muted (matches existing AUTOTYPER)

Config gating consistency. System-voice types that were previously
ungated now respect systemMesagesEnabled the way GAMEMESSAGE / WELCOME
already do:
  * ENGINE, BROADCAST, IGNORENOTIFICATION, TRADE, PLAYERRELATED,
    TENSECTIMEOUT, SNAPSHOTFEEDBACK, CLAN_GIM_FORM_GROUP,
    CLAN_GIM_GROUP_WITH -> systemMesagesEnabled

Dual-gating for system messages that live inside a chat channel
(following the CLAN_MESSAGE precedent from PR phyce#40):
  * LOGINLOGOUTNOTIFICATION, FRIENDNOTIFICATION,
    FRIENDSCHATNOTIFICATION -> friendsChatEnabled + systemMesagesEnabled
  * CLAN_CREATION_INVITATION -> clanChatEnabled + systemMesagesEnabled

Single-purpose gating with new toggles:
  * DIDYOUKNOW -> new didYouKnow toggle (default off)
  * LEVELUPMESSAGE -> new levelUpMessages toggle (default off)

Request-class:
  * TRADE_SENT -> requestsEnabled (joins the existing TRADEREQ /
    CHALREQ_* gate).

Out of scope / follow-up:
  * MESBOX (dialog box / book pages) needs widget plumbing like DIALOG
    has - left for a separate PR.
  * NPC_SAY likely duplicates OverheadTextChanged - left until verified.
  * CLAN_GIM_FORM_GROUP / CLAN_GIM_GROUP_WITH are currently single-gated
    on system messages here; after PR phyce#47 lands they could be
    dual-gated with groupIronmanChatEnabled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant