From 705cd43ae88b5d095e7953ef8ddf670f3bbc9e1a Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 28 Jul 2025 17:01:34 +0800 Subject: Show Discord Rich Presence Activity Party By setting CurrentSize to the number of people within chat radius, and MaxSize to the number of people within (MP's) near range. --- indra/newview/llappviewer.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 9124651e84..bc97e5b852 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -6017,7 +6017,19 @@ void LLAppViewer::updateDiscordActivity() pos_x -= pos_x % 2; pos_y -= pos_y % 2; } - activity.SetState(llformat("%s (%d, %d, %d)", gAgent.getRegion()->getName().c_str(), pos_x, pos_y, pos_z)); + auto location = llformat("%s (%d, %d, %d)", gAgent.getRegion()->getName().c_str(), pos_x, pos_y, pos_z); + activity.SetState(location); + + auto world = LLWorld::getInstance(); + uuid_vec_t chat_radius_uuids, near_me_uuids; + auto position = gAgent.getPositionGlobal(); + world->getAvatars(&chat_radius_uuids, NULL, position, CHAT_NORMAL_RADIUS); + world->getAvatars(&near_me_uuids, NULL, position, gSavedSettings.getF32("MPVNearMeRange")); + discordpp::ActivityParty party; + party.SetId(location); + party.SetCurrentSize(chat_radius_uuids.size()); + party.SetMaxSize(near_me_uuids.size()); + activity.SetParty(party); } gDiscordClient->UpdateRichPresence(activity, [](discordpp::ClientResult) {}); -- cgit v1.2.3