diff options
| author | pepper <3782201+rohvani@users.noreply.github.com> | 2026-09-21 17:20:34 -0400 |
|---|---|---|
| committer | pepper <3782201+rohvani@users.noreply.github.com> | 2026-09-23 15:24:03 -0400 |
| commit | 8248b904d4962050b00620fa81e09ec85194b4c8 (patch) | |
| tree | d1832bc76e0c126785163b64b9218ac15d0c53ba /indra | |
| parent | a47d7a2b35dd0f9f854af5b9c612c784b173f977 (diff) | |
Centralize history availability in the transcript query
Make LLLogChat::isTranscriptExist apply the deletion gate and check both
plaintext and direct service history. Restore its menu and profile callers
to that existing query, removing their repeated policy and extra includes.
Keep group history on the ordinary transcript path.
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llavataractions.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llchathistory.cpp | 8 | ||||
| -rw-r--r-- | indra/newview/llfloaterimcontainer.cpp | 8 | ||||
| -rw-r--r-- | indra/newview/lllogchat.cpp | 8 | ||||
| -rw-r--r-- | indra/newview/lllogchat.h | 1 | ||||
| -rw-r--r-- | indra/newview/llpanelpeoplemenus.cpp | 5 | ||||
| -rw-r--r-- | indra/newview/llpanelprofile.cpp | 6 |
7 files changed, 14 insertions, 24 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 70f722a247..b0f9d5ac59 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -1277,7 +1277,7 @@ void LLAvatarActions::viewChatHistory(const LLUUID& id) } } - if (LLLogChat::isTranscriptExist(id) || LLChatServiceHistory::localHistoryExists(id)) + if (LLLogChat::isTranscriptExist(id)) { LLAvatarName avatar_name; LLSD extended_id(id); diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 8db072b445..68f7e48b3e 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -31,7 +31,6 @@ #include <boost/signals2.hpp> #include "llavatarnamecache.h" -#include "llchatservicehistory.h" #include "llinstantmessage.h" #include "llimview.h" @@ -1020,12 +1019,7 @@ protected: menu->setItemVisible("Zoom In", should_show_zoom && gObjectList.findObject(mAvatarID)); menu->setItemEnabled("Block Unblock", LLAvatarActions::canBlock(mAvatarID)); menu->setItemEnabled("Mute Text", LLAvatarActions::canBlock(mAvatarID)); - - const bool history_available = - !LLChatServiceHistory::historySuppressed() && - (LLLogChat::isTranscriptExist(mAvatarID) || - LLChatServiceHistory::localHistoryExists(mAvatarID)); - menu->setItemEnabled("Chat History", history_available); + menu->setItemEnabled("Chat History", LLLogChat::isTranscriptExist(mAvatarID)); } menu->setItemEnabled("Map", (LLAvatarTracker::instance().isBuddyOnline(mAvatarID) && is_agent_mappable(mAvatarID)) || gAgent.isGodlike() ); diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 91201e5770..db57c549f4 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1558,9 +1558,7 @@ bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata) else { bool is_group = (getCurSelectedViewModelItem()->getType() == LLConversationItem::CONV_SESSION_GROUP); - return !LLChatServiceHistory::historySuppressed() && - (LLLogChat::isTranscriptExist(uuids.front(), is_group) || - (!is_group && LLChatServiceHistory::localHistoryExists(uuids.front()))); + return LLLogChat::isTranscriptExist(uuids.front(), is_group); } } } @@ -1592,9 +1590,7 @@ bool LLFloaterIMContainer::enableContextMenuItem(const std::string& item, uuid_v if ("can_chat_history" == item && is_single_select) { - return !LLChatServiceHistory::historySuppressed() && - (LLLogChat::isTranscriptExist(uuids.front(), false) || - LLChatServiceHistory::localHistoryExists(uuids.front())); + return LLLogChat::isTranscriptExist(uuids.front(), false); } // Handle options that are applicable to all including the user agent diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 060352ab4c..6e43b54178 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -963,13 +963,19 @@ void LLLogChat::notifyTranscriptCreated() // static bool LLLogChat::isTranscriptExist(const LLUUID& avatar_id, bool is_group) { + // History actions share the deletion gate and both direct transcript sources. + if (LLChatServiceHistory::historySuppressed()) + { + return false; + } LLAvatarName avatar_name; LLAvatarNameCache::get(avatar_id, &avatar_name); std::string avatar_user_name = avatar_name.getAccountName(); if(!is_group) { std::replace(avatar_user_name.begin(), avatar_user_name.end(), '.', '_'); - return isTranscriptFileFound(makeLogFileName(avatar_user_name)); + return isTranscriptFileFound(makeLogFileName(avatar_user_name)) || + LLChatServiceHistory::localHistoryExists(avatar_id); } else { diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h index 5e24a658b3..73253961a3 100644 --- a/indra/newview/lllogchat.h +++ b/indra/newview/lllogchat.h @@ -134,6 +134,7 @@ public: // until every legacy transcript target has been removed safely. static bool deleteTranscriptContent(const std::string& directory); static void notifyTranscriptCreated(); + // Whether history can be opened: plaintext or direct service rows, subject to deletion. static bool isTranscriptExist(const LLUUID& avatar_id, bool is_group=false); static bool isNearbyTranscriptExist(); static bool isAdHocTranscriptExist(std::string file_name); diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index 2640285ecd..62e726d21d 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -38,7 +38,6 @@ #include "llavataractions.h" #include "llcallingcard.h" // for LLAvatarTracker #include "lllogchat.h" -#include "llchatservicehistory.h" #include "llparcel.h" #include "llviewermenu.h" // for gMenuHolder #include "llconversationmodel.h" @@ -248,9 +247,7 @@ bool PeopleContextMenu::enableContextMenuItem(const LLSD& userdata) } else if (item == std::string("can_callog")) { - return !LLChatServiceHistory::historySuppressed() && - (LLLogChat::isTranscriptExist(mUUIDs.front()) || - LLChatServiceHistory::localHistoryExists(mUUIDs.front())); + return LLLogChat::isTranscriptExist(mUUIDs.front()); } else if (item == std::string("can_im") || item == std::string("can_invite")) { diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index b2afe7e054..b77c947f8f 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -57,7 +57,6 @@ #include "llagent.h" //gAgent #include "llagentpicksinfo.h" #include "llavataractions.h" -#include "llchatservicehistory.h" #include "llavatarpropertiesprocessor.h" #include "llcallingcard.h" #include "llcommandhandler.h" @@ -1567,9 +1566,7 @@ bool LLPanelProfileSecondLife::onEnableMenu(const LLSD& userdata) } else if (item_name == "chat_history") { - return !LLChatServiceHistory::historySuppressed() && - (LLLogChat::isTranscriptExist(agent_id) || - LLChatServiceHistory::localHistoryExists(agent_id)); + return LLLogChat::isTranscriptExist(agent_id); } else if (item_name == "add_friend") { @@ -2493,4 +2490,3 @@ void LLPanelProfile::createClassified() mPanelClassifieds->createClassified(); mTabContainer->selectTabPanel(mPanelClassifieds); } - |
