summaryrefslogtreecommitdiff
path: root/indra/newview/llconversationloglist.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2026-08-18 13:57:14 +0800
committerErik Kundiman <erik@megapahit.org>2026-08-18 13:57:14 +0800
commit2fa8281b2d8ce8bdbcacf139ec674480da6c9d81 (patch)
treeffb343fee97f21942123fd322d88fea3ef1a4811 /indra/newview/llconversationloglist.cpp
parent742d802f073e81abc6d4cd512e58a4d03b414b83 (diff)
parent214fa765986b4c1e1de1b917581f8508278abd8e (diff)
Merge branch '26.3'
Diffstat (limited to 'indra/newview/llconversationloglist.cpp')
-rw-r--r--indra/newview/llconversationloglist.cpp65
1 files changed, 61 insertions, 4 deletions
diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp
index 65863f0a5e..e9c6df3ed8 100644
--- a/indra/newview/llconversationloglist.cpp
+++ b/indra/newview/llconversationloglist.cpp
@@ -45,6 +45,7 @@ LLConversationLogList::LLConversationLogList(const Params& p)
mIsDirty(true)
{
LLConversationLog::instance().addObserver(this);
+ LLMuteList::instance().addObserver(this);
// Set up context menu.
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
@@ -65,6 +66,15 @@ LLConversationLogList::LLConversationLogList(const Params& p)
}
mIsFriendsOnTop = gSavedSettings.getBOOL("SortFriendsFirst");
+ LLControlVariable* cntrl_ptr = gSavedSettings.getControl("ShowBlockedConvHistory");
+ if (cntrl_ptr)
+ {
+ mShowBlockedSignal = cntrl_ptr->getCommitSignal()->connect(
+ [this](LLControlVariable* control, const LLSD& value, const LLSD& previous)
+ {
+ setDirty(true);
+ });
+ }
}
LLConversationLogList::~LLConversationLogList()
@@ -74,6 +84,7 @@ LLConversationLogList::~LLConversationLogList()
mContextMenu.get()->die();
}
+ LLMuteList::getInstance()->removeObserver(this);
LLConversationLog::instance().removeObserver(this);
}
@@ -178,6 +189,44 @@ void LLConversationLogList::changed(const LLUUID& session_id, U32 mask)
}
}
+// inherited from LLMuteListObserver
+void LLConversationLogList::onChange()
+{
+}
+
+// inherited from LLMuteListObserver
+void LLConversationLogList::onChangeDetailed(const LLMute& mute)
+{
+ if (isDirty())
+ {
+ // Going to refresh either way.
+ return;
+ }
+
+ static LLCachedControl<bool> show_blocked(gSavedSettings, "ShowBlockedConvHistory", false);
+ if (!show_blocked())
+ {
+ // Check if any conversation in the log has this participant
+ const std::vector<LLConversation>& conversations = LLConversationLog::instance().getConversations();
+
+ // Note sure if actually need this update. List can be rather large
+ // and rebuilding it on every event can be expensive.
+ // But 'mute' events are also rare, so maybe not a problem.
+ // There also might be a way to react only to relevant changes,
+ // instead of reacting to everything, like ignoring voice only mutes,
+ // which are not relevant for this log by themselves.
+ for (const LLConversation& conversation : conversations)
+ {
+ if (conversation.getParticipantID() == mute.mID)
+ {
+ setDirty(true);
+ break;
+ }
+ }
+ }
+ // else don't need to hide anything
+}
+
void LLConversationLogList::addNewItem(const LLConversation* conversation)
{
LLConversationLogListItem* item = new LLConversationLogListItem(&*conversation);
@@ -207,6 +256,9 @@ void LLConversationLogList::rebuildList()
const std::vector<LLConversation>& conversations = log_instance.getConversations();
std::vector<LLConversation>::const_iterator iter = conversations.begin();
+ LLMuteList* mutes = LLMuteList::getInstance();
+
+ static LLCachedControl<bool> show_blocked(gSavedSettings, "ShowBlockedConvHistory", false);
for (; iter != conversations.end(); ++iter)
{
@@ -214,6 +266,11 @@ void LLConversationLogList::rebuildList()
if (not_found)
continue;
+ if (!show_blocked() && mutes->isMuted(iter->getParticipantID()))
+ {
+ continue;
+ }
+
addNewItem(&*iter);
}
@@ -517,8 +574,8 @@ bool LLConversationLogListNameComparator::doCompare(const LLConversationLogListI
LLStringUtil::toUpper(name1);
LLStringUtil::toUpper(name2);
- bool friends_first = gSavedSettings.getBOOL("SortFriendsFirst");
- if (friends_first && (LLAvatarActions::isFriend(id1) ^ LLAvatarActions::isFriend(id2)))
+ static LLCachedControl<bool> sort_friends_first(gSavedSettings, "SortFriendsFirst", true);
+ if (sort_friends_first() && (LLAvatarActions::isFriend(id1) ^ LLAvatarActions::isFriend(id2)))
{
return LLAvatarActions::isFriend(id1);
}
@@ -533,8 +590,8 @@ bool LLConversationLogListDateComparator::doCompare(const LLConversationLogListI
const LLUUID& id1 = conversation1->getConversation()->getParticipantID();
const LLUUID& id2 = conversation2->getConversation()->getParticipantID();
- bool friends_first = gSavedSettings.getBOOL("SortFriendsFirst");
- if (friends_first && (LLAvatarActions::isFriend(id1) ^ LLAvatarActions::isFriend(id2)))
+ static LLCachedControl<bool> sort_friends_first(gSavedSettings, "SortFriendsFirst", true);
+ if (sort_friends_first() && (LLAvatarActions::isFriend(id1) ^ LLAvatarActions::isFriend(id2)))
{
return LLAvatarActions::isFriend(id1);
}