FIRE-24171: Ignore group chats on startup until mute list is loaded to prevent showing unwanted group chats
parent
b076811684
commit
a01747f446
|
|
@ -29,6 +29,9 @@
|
|||
// <FS:Ansariel> Server-side storage
|
||||
#include "llmutelist.h"
|
||||
#include "llviewernetwork.h"
|
||||
#include "llimview.h"
|
||||
#include "llagent.h"
|
||||
#include "llviewercontrol.h"
|
||||
|
||||
exoGroupMuteList::exoGroupMuteList()
|
||||
: mMuted()
|
||||
|
|
@ -57,6 +60,17 @@ bool exoGroupMuteList::isMuted(const LLUUID& group) const
|
|||
// </FS:Ansariel> Server-side storage
|
||||
}
|
||||
|
||||
bool exoGroupMuteList::isLoaded() const
|
||||
{
|
||||
#ifdef OPENSIM
|
||||
if (LLGridManager::instance().isInOpenSim())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
return LLMuteList::instance().isLoaded();
|
||||
}
|
||||
|
||||
void exoGroupMuteList::add(const LLUUID& group)
|
||||
{
|
||||
LLGroupActions::endIM(group); // Actually kill ongoing conversation
|
||||
|
|
@ -150,9 +164,47 @@ std::string exoGroupMuteList::getFilePath() const
|
|||
return gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "muted_groups.xml");
|
||||
}
|
||||
|
||||
// <FS:Ansariel> Server-side storage
|
||||
|
||||
void exoGroupMuteList::addDeferredGroupChat(const LLUUID& group)
|
||||
{
|
||||
if (mDeferredGroupChatSessionIDs.find(group) == mDeferredGroupChatSessionIDs.end())
|
||||
{
|
||||
mDeferredGroupChatSessionIDs.insert(group);
|
||||
}
|
||||
}
|
||||
|
||||
bool exoGroupMuteList::restoreDeferredGroupChat(const LLUUID& group)
|
||||
{
|
||||
if (!isLoaded())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
auto groupIt = mDeferredGroupChatSessionIDs.find(group);
|
||||
if (groupIt != mDeferredGroupChatSessionIDs.end())
|
||||
{
|
||||
mDeferredGroupChatSessionIDs.erase(groupIt);
|
||||
|
||||
LLGroupData groupData;
|
||||
if (gAgent.getGroupData(group, groupData))
|
||||
{
|
||||
gIMMgr->addSession(groupData.mName, IM_SESSION_INVITE, group);
|
||||
|
||||
uuid_vec_t ids;
|
||||
LLIMModel::sendStartSession(group, group, ids, IM_SESSION_GROUP_START);
|
||||
|
||||
if (!gAgent.isDoNotDisturb() && gSavedSettings.getU32("PlayModeUISndNewIncomingGroupIMSession") != 0)
|
||||
{
|
||||
make_ui_sound("UISndNewIncomingGroupIMSession");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string exoGroupMuteList::getMutelistString(const LLUUID& group) const
|
||||
{
|
||||
return std::string("Group:" + group.asString());
|
||||
}
|
||||
// </FS:Ansariel> Server-side storage
|
||||
|
|
|
|||
|
|
@ -28,17 +28,20 @@ class exoGroupMuteList : public LLSingleton<exoGroupMuteList>
|
|||
|
||||
public:
|
||||
bool isMuted(const LLUUID &group) const;
|
||||
bool isLoaded() const;
|
||||
void add(const LLUUID &group);
|
||||
void remove(const LLUUID &group);
|
||||
bool loadMuteList();
|
||||
void addDeferredGroupChat(const LLUUID& group);
|
||||
bool restoreDeferredGroupChat(const LLUUID& group);
|
||||
|
||||
private:
|
||||
bool saveMuteList();
|
||||
std::string getFilePath() const;
|
||||
|
||||
std::set<LLUUID> mMuted;
|
||||
uuid_set_t mMuted;
|
||||
uuid_set_t mDeferredGroupChatSessionIDs;
|
||||
|
||||
// <FS:Ansariel> Server-side storage
|
||||
std::string getMutelistString(const LLUUID& group) const;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@
|
|||
// [/RLVa:KB]
|
||||
|
||||
// Firestorm includes
|
||||
#include "exogroupmutelist.h"
|
||||
#include "fscommon.h"
|
||||
#include "fsdata.h"
|
||||
#include "fskeywords.h"
|
||||
|
|
@ -1621,8 +1622,8 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
|
|||
// should happen after you get an "invitation"
|
||||
// [SL:KB] - Patch: Chat-GroupSnooze | Checked: 2012-06-16 (Catznip-3.3)
|
||||
//if ( !gIMMgr->hasSession(session_id) )
|
||||
if ( (!gIMMgr->hasSession(session_id)) &&
|
||||
( (!gAgent.isInGroup(session_id)) || (!gIMMgr->checkSnoozeExpiration(session_id)) || LLAvatarActions::isBlocked(from_id) || (!gIMMgr->restoreSnoozedSession(session_id)) ) )
|
||||
if (!gIMMgr->hasSession(session_id) &&
|
||||
(!gAgent.isInGroup(session_id) || LLAvatarActions::isBlocked(from_id) || (!exoGroupMuteList::instance().restoreDeferredGroupChat(session_id) && (!gIMMgr->checkSnoozeExpiration(session_id) || !gIMMgr->restoreSnoozedSession(session_id)) )))
|
||||
// [/SL:KB]
|
||||
{
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -2991,9 +2991,9 @@ void LLIMMgr::addMessage(
|
|||
static LLCachedControl<U32> PlayModeUISndNewIncomingIMSession(gSavedSettings, "PlayModeUISndNewIncomingIMSession");
|
||||
static LLCachedControl<U32> PlayModeUISndNewIncomingGroupIMSession(gSavedSettings, "PlayModeUISndNewIncomingGroupIMSession");
|
||||
static LLCachedControl<U32> PlayModeUISndNewIncomingConfIMSession(gSavedSettings, "PlayModeUISndNewIncomingConfIMSession");
|
||||
BOOL do_not_disturb = gAgent.isDoNotDisturb();
|
||||
BOOL is_group_chat = FALSE;
|
||||
if (!new_session && dialog != IM_NOTHING_SPECIAL)
|
||||
bool do_not_disturb = gAgent.isDoNotDisturb();
|
||||
bool is_group_chat = false;
|
||||
if (dialog != IM_NOTHING_SPECIAL)
|
||||
{
|
||||
is_group_chat = gAgent.isInGroup(new_session_id);
|
||||
}
|
||||
|
|
@ -3010,6 +3010,13 @@ void LLIMMgr::addMessage(
|
|||
// <FS:Ansariel> Clear muted group chat early to prevent contacts floater
|
||||
// (re-)gaining focus; the server already knows the correct
|
||||
// session id, so we can leave it!
|
||||
if (is_group_chat && !exoGroupMuteList::instance().isLoaded())
|
||||
{
|
||||
LL_INFOS() << "Received group chat from " << fixed_session_name << " (" << new_session_id.asString() << ") before must list has been loaded - skipping message" << LL_ENDL;
|
||||
exoGroupMuteList::instance().addDeferredGroupChat(new_session_id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (exoGroupMuteList::instance().isMuted(new_session_id))
|
||||
{
|
||||
LL_INFOS() << "Muting group chat from " << new_session_id.asString() << ": " << fixed_session_name << LL_ENDL;
|
||||
|
|
@ -3033,6 +3040,7 @@ void LLIMMgr::addMessage(
|
|||
gAgent.isInGroup(new_session_id) && LLMuteList::getInstance()->isMuted(other_participant_id) && !from_linden)
|
||||
{
|
||||
LL_INFOS() << "Ignoring group chat initiated by muted resident." << LL_ENDL;
|
||||
exoGroupMuteList::instance().addDeferredGroupChat(new_session_id);
|
||||
return;
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
|
@ -3084,11 +3092,6 @@ void LLIMMgr::addMessage(
|
|||
// //Play sound for new conversations
|
||||
// if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNewConversation") == TRUE))
|
||||
|
||||
if (dialog != IM_NOTHING_SPECIAL)
|
||||
{
|
||||
is_group_chat = gAgent.isInGroup(new_session_id);
|
||||
}
|
||||
|
||||
// <FS:PP> Option to automatically ignore and leave all conference (ad-hoc) chats
|
||||
static LLCachedControl<bool> ignoreAdHocSessions(gSavedSettings, "FSIgnoreAdHocSessions");
|
||||
if (dialog != IM_NOTHING_SPECIAL && !is_group_chat && ignoreAdHocSessions && !from_linden)
|
||||
|
|
|
|||
Loading…
Reference in New Issue