Nicknames: source-picker favourites + B.net cross-session fix#137
Nicknames: source-picker favourites + B.net cross-session fix#137Maelareth wants to merge 4 commits into
Conversation
- Favourites: star any group/guild/friend/B.net member to pin them to the top of the "Add from" picker. Each list now sorts into tiers (favourites, then online, then offline; A-Z within) with a divider between the favourites and the rest. Stored account-wide; characters share one list across the group/guild/friends pickers, B.net is keyed by BattleTag. - B.net rules now key off the stable BattleTag instead of the session-only bnetAccountID, fixing rules that silently stopped applying after a full relog. Existing rules are migrated where possible; any that can't be matched are flagged in the list so they can be re-added. - Add a per-GUID resolve cache (wiped in RefreshAllFrames) to drop the repeated string work on the name path. - Guard the received-nickname short-name key against cross-realm collisions.
Use GetNormalizedRealmName() for the player's own name so the self-message guard matches the realm spelling the server puts on our own broadcasts; space-stripping GetRealmName() can diverge on some realms.
C_BattleNet.GetFriendAccountInfo().accountName is a session-scoped |K...|k name token that renders as a different friend after a relog, so it must not be persisted. Derive the rule's display label from the stable BattleTag instead, repair labels already saved as a token on load, and stop the legacy migration from matching a token pattern (which could mis-assign a different friend).
|
Pushed one more commit ( What it fixes: a B.net rule's display label was being saved from The BattleTag-based matching was already correct (nicknames applied to the right people); only the persisted label drifted. The commit:
Worth noting both this and the original cross-session matching bug exist in the current alpha, so this PR fixes two real B.net issues alongside the favourites feature. |
Summary
Two things, both in the Nicknames feature:
Favourites (feature)
B.net cross-session fix (bug)
bnetAccountID, so after a full relog the id changed and the rule silently stopped applying — the rule stayed in the list but the nickname vanished. Confirmed against the API docs (bnetAccountIDis documented as a temporary, session-scoped id) and a code review.Also included
RefreshAllFrames) removes repeated string work on the name path.GetNormalizedRealmName()for realm-spelling parity with the addon-message sender string; the received-nickname short-name key no longer collides across realms.Testing