Feature Request: Allow blocking conferences from nonfriends exclusively.

Option is in Communication tab, as the old one was.

Translators will need to localize this. (panel_preferences_im.xml)
This commit is contained in:
Inusaito Sayori
2015-05-12 18:00:14 -04:00
parent 235693f134
commit 1db2ffe02b
3 changed files with 17 additions and 5 deletions

View File

@@ -107,6 +107,13 @@ LLColor4 agent_chat_color(const LLUUID& id, const std::string& name, bool local_
return local_chat ? gSavedSettings.getColor4("AgentChatColor") : gSavedSettings.getColor("IMChatColor");
}
bool block_conference(const LLUUID& id)
{
const U32 block(gSavedSettings.getU32("LiruBlockConferences"));
if (block == 2) return !LLAvatarActions::isFriend(id);
return block;
}
class LLViewerChatterBoxInvitationAcceptResponder : public LLHTTPClient::ResponderWithResult
{
@@ -451,7 +458,7 @@ void LLIMMgr::addMessage(
if(!floater)
{
// Return now if we're blocking this group's chat or conferences
if (gAgent.isInGroup(session_id) ? getIgnoreGroup(session_id) : dialog != IM_NOTHING_SPECIAL && dialog != IM_SESSION_P2P_INVITE && gSavedSettings.getBOOL("LiruBlockConferences"))
if (gAgent.isInGroup(session_id) ? getIgnoreGroup(session_id) : dialog != IM_NOTHING_SPECIAL && dialog != IM_SESSION_P2P_INVITE && block_conference(other_participant_id))
return;
std::string name = (session_name.size() > 1) ? session_name : from;
@@ -1568,7 +1575,7 @@ public:
}
else
{
if (from_id != session_id && gSavedSettings.getBOOL("LiruBlockConferences")) // from and session are equal for IMs only.
if (from_id != session_id && block_conference(from_id)) // from and session are equal for IMs only.
{
leave_group_chat(from_id, session_id);
return;