Add a setting to automatically decline and leave incoming conferences

Look under Communication preferences for "Block incoming conference chats" to activate.
This commit is contained in:
Inusaito Sayori
2014-05-14 03:34:32 -04:00
parent 3febec4aa4
commit 81affe719f
3 changed files with 31 additions and 9 deletions

View File

@@ -651,6 +651,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>LiruBlockConferences</key>
<map>
<key>Comment</key>
<string>When true, new incoming conference chats will not be opened.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>LiruContinueFlyingOnUnsit</key>
<map>
<key>Comment</key>

View File

@@ -448,8 +448,8 @@ void LLIMMgr::addMessage(
// create IM window as necessary
if(!floater)
{
// Return now if we're blocking this group's chat
if (getIgnoreGroup(session_id) && gAgent.isInGroup(session_id))
// 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"))
return;
std::string name = (session_name.size() > 1) ? session_name : from;
@@ -1423,6 +1423,17 @@ public:
};
void leave_group_chat(const LLUUID& from_id, const LLUUID& session_id)
{
// Tell the server we've left group chat
std::string name;
gAgent.buildFullname(name);
pack_instant_message(gMessageSystem, gAgentID, false, gAgentSessionID, from_id,
name, LLStringUtil::null, IM_ONLINE, IM_SESSION_LEAVE, session_id);
gAgent.sendReliableMessage();
gIMMgr->removeSession(session_id);
}
class LLViewerChatterBoxInvitation : public LLHTTPNode
{
public:
@@ -1535,13 +1546,7 @@ public:
{
if (gIMMgr->getIgnoreGroup(session_id))
{
// Tell the server we've left group chat
std::string name;
gAgent.buildFullname(name);
pack_instant_message(gMessageSystem, gAgentID, false, gAgent.getSessionID(), from_id,
name, LLStringUtil::null, IM_ONLINE, IM_SESSION_LEAVE, session_id);
gAgent.sendReliableMessage();
gIMMgr->removeSession(session_id);
leave_group_chat(from_id, session_id);
return;
}
else if (gSavedSettings.getBOOL("OptionShowGroupNameInChatIM"))
@@ -1555,6 +1560,11 @@ public:
}
else
{
if (from_id != session_id && gSavedSettings.getBOOL("LiruBlockConferences")) // from and session are equal for IMs only.
{
leave_group_chat(from_id, session_id);
return;
}
prepend_msg = std::string("IM: ");
}
chat.mText = prepend_msg + name + separator_string + saved + message.substr(message_offset);

View File

@@ -8,6 +8,7 @@
<check_box bottom="-65" height="16" initial_value="false" label="Include IM in chat console" name="include_im_in_chat_console"/>
<check_box bottom="-85" height="16" initial_value="false" label="Show timestamps in IM" name="show_timestamps_check"/>
<check_box bottom="-105" height="16" initial_value="false" label="Show online Friend notifications" name="friends_online_notify_checkbox"/>
<check_box follows="top|left" bottom_delta="-20" height="16" label="Block incoming conference chats" control_name="LiruBlockConferences" name="block_conferences_checkbox"/>
<text bottom="-218" height="10" left="12" name="text_box4">Logging Options:</text>
<check_box bottom="-225" height="16" initial_value="false" label="Save a log of IM on my computer" left="148" name="log_instant_messages" />
<check_box bottom="-245" height="16" initial_value="false" label="Show timestamps in IM log" left="168" name="log_instant_messages_timestamp"/>