fix: group invite popup never showing (hasPendingGroupInvite stale getter)

hasPendingGroupInvite() and getPendingInviterName() were inline getters
reading GameHandler's stale copies. SocialHandler owns the canonical
pendingGroupInvite/pendingInviterName state. Players were auto-added to
groups without seeing the accept/decline popup.

Now delegates to socialHandler_.
This commit is contained in:
Kelsi 2026-03-28 15:29:19 -07:00
parent 1af1c66b04
commit 6edcad421b
2 changed files with 10 additions and 2 deletions

View file

@ -1253,8 +1253,8 @@ public:
bool isInGroup() const { return !partyData.isEmpty(); }
const GroupListData& getPartyData() const { return partyData; }
const std::vector<ContactEntry>& getContacts() const { return contacts_; }
bool hasPendingGroupInvite() const { return pendingGroupInvite; }
const std::string& getPendingInviterName() const { return pendingInviterName; }
bool hasPendingGroupInvite() const;
const std::string& getPendingInviterName() const;
// ---- Item text (books / readable items) ----
bool isItemTextOpen() const;

View file

@ -9766,6 +9766,14 @@ bool GameHandler::isInGuild() const {
return ch && ch->hasGuild();
}
bool GameHandler::hasPendingGroupInvite() const {
return socialHandler_ ? socialHandler_->hasPendingGroupInvite() : pendingGroupInvite;
}
const std::string& GameHandler::getPendingInviterName() const {
if (socialHandler_) return socialHandler_->getPendingInviterName();
return pendingInviterName;
}
const std::string& GameHandler::getGuildName() const {
if (socialHandler_) return socialHandler_->getGuildName();
static const std::string empty;