summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2012-03-09 15:50:51 -0600
committerDave Parks <davep@lindenlab.com>2012-03-09 15:50:51 -0600
commit8e60cdb3335ec198c71b29d37ab08c4aff9f8223 (patch)
tree2e043ee721d725dcc8d654a8f51eaafaaeb423de /indra/newview/llimview.cpp
parent1d200c56e151eb8fc384693175d1b9318ff0f919 (diff)
parent4b20d72a991cfebaf5765fe7756190f4a9645a3b (diff)
merge
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r--indra/newview/llimview.cpp106
1 files changed, 74 insertions, 32 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 4de6976534..a856bd0bdc 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -46,7 +46,6 @@
#include "llagentui.h"
#include "llappviewer.h"
#include "llavatariconctrl.h"
-#include "llbottomtray.h"
#include "llcallingcard.h"
#include "llchat.h"
#include "llimfloater.h"
@@ -61,6 +60,7 @@
#include "llnearbychat.h"
#include "llspeakers.h" //for LLIMSpeakerMgr
#include "lltextbox.h"
+#include "lltoolbarview.h"
#include "llviewercontrol.h"
#include "llviewerparcelmgr.h"
@@ -1675,27 +1675,48 @@ LLCallDialog::~LLCallDialog()
LLUI::removePopup(this);
}
-void LLCallDialog::getAllowedRect(LLRect& rect)
+BOOL LLCallDialog::postBuild()
{
- rect = gViewerWindow->getWorldViewRectScaled();
+ if (!LLDockableFloater::postBuild() || !gToolBarView)
+ return FALSE;
+
+ dockToToolbarButton("speak");
+
+ return TRUE;
}
-BOOL LLCallDialog::postBuild()
+void LLCallDialog::dockToToolbarButton(const std::string& toolbarButtonName)
{
- if (!LLDockableFloater::postBuild())
- return FALSE;
+ LLDockControl::DocAt dock_pos = getDockControlPos(toolbarButtonName);
+ LLView *anchor_panel = gToolBarView->findChildView(toolbarButtonName);
- // dock the dialog to the Speak Button, where other sys messages appear
- LLView *anchor_panel = LLBottomTray::getInstance()->getChild<LLView>("speak_panel");
+ setUseTongue(anchor_panel);
- setDockControl(new LLDockControl(
- anchor_panel, this,
- getDockTongue(), LLDockControl::TOP,
- boost::bind(&LLCallDialog::getAllowedRect, this, _1)));
+ setDockControl(new LLDockControl(anchor_panel, this, getDockTongue(dock_pos), dock_pos));
+}
- return TRUE;
+LLDockControl::DocAt LLCallDialog::getDockControlPos(const std::string& toolbarButtonName)
+{
+ LLCommandId command_id(toolbarButtonName);
+ S32 toolbar_loc = gToolBarView->hasCommand(command_id);
+
+ LLDockControl::DocAt doc_at = LLDockControl::TOP;
+
+ switch (toolbar_loc)
+ {
+ case LLToolBarView::TOOLBAR_LEFT:
+ doc_at = LLDockControl::RIGHT;
+ break;
+
+ case LLToolBarView::TOOLBAR_RIGHT:
+ doc_at = LLDockControl::LEFT;
+ break;
+ }
+
+ return doc_at;
}
+
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLOutgoingCallDialog
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2382,15 +2403,6 @@ void LLIMMgr::addMessage(
bool link_name) // If this is true, then we insert the name and link it to a profile
{
LLUUID other_participant_id = target_id;
-
- // don't process muted IMs
- if (LLMuteList::getInstance()->isMuted(
- other_participant_id,
- LLMute::flagTextChat) && !LLMuteList::getInstance()->isLinden(from))
- {
- return;
- }
-
LLUUID new_session_id = session_id;
if (new_session_id.isNull())
{
@@ -2431,10 +2443,25 @@ void LLIMMgr::addMessage(
LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, bonus_info.str());
}
+ // Logically it would make more sense to reject the session sooner, in another area of the
+ // code, but the session has to be established inside the server before it can be left.
+ if (LLMuteList::getInstance()->isMuted(other_participant_id) && !LLMuteList::getInstance()->isLinden(from))
+ {
+ llwarns << "Leaving IM session from initiating muted resident " << from << llendl;
+ if(!gIMMgr->leaveSession(new_session_id))
+ {
+ llinfos << "Session " << new_session_id << " does not exist." << llendl;
+ }
+ return;
+ }
+
make_ui_sound("UISndNewIncomingIMSession");
}
- LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, msg);
+ if (!LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat))
+ {
+ LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, msg);
+ }
}
void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& message_name, const LLSD& args)
@@ -2449,8 +2476,10 @@ void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& mess
LLChat chat(message);
chat.mSourceType = CHAT_SOURCE_SYSTEM;
+
+ LLFloater* chat_bar = LLFloaterReg::getInstance("chat_bar");
+ LLNearbyChat* nearby_chat = chat_bar->findChild<LLNearbyChat>("nearby_chat");
- LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD());
if(nearby_chat)
{
nearby_chat->addMessage(chat);
@@ -2638,18 +2667,15 @@ void LLIMMgr::inviteToSession(
const std::string& session_handle,
const std::string& session_uri)
{
- //ignore invites from muted residents
- if (LLMuteList::getInstance()->isMuted(caller_id))
- {
- return;
- }
-
std::string notify_box_type;
// voice invite question is different from default only for group call (EXT-7118)
std::string question_type = "VoiceInviteQuestionDefault";
BOOL ad_hoc_invite = FALSE;
BOOL voice_invite = FALSE;
+ bool is_linden = LLMuteList::getInstance()->isLinden(caller_name);
+
+
if(type == IM_SESSION_P2P_INVITE)
{
//P2P is different...they only have voice invitations
@@ -2688,7 +2714,18 @@ void LLIMMgr::inviteToSession(
payload["session_uri"] = session_uri;
payload["notify_box_type"] = notify_box_type;
payload["question_type"] = question_type;
-
+
+ //ignore invites from muted residents
+ if (LLMuteList::getInstance()->isMuted(caller_id) && !is_linden)
+ {
+ if (voice_invite && "VoiceInviteQuestionDefault" == question_type)
+ {
+ llinfos << "Rejecting voice call from initiating muted resident " << caller_name << llendl;
+ LLIncomingCallDialog::processCallResponse(1, payload);
+ }
+ return;
+ }
+
LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(session_id);
if (channelp && channelp->callStarted())
{
@@ -3211,7 +3248,7 @@ public:
chat.mFromID = from_id;
chat.mFromName = name;
- if (!is_linden && (is_busy || is_muted))
+ if (!is_linden && is_busy)
{
return;
}
@@ -3243,6 +3280,11 @@ public:
ll_vector3_from_sd(message_params["position"]),
true);
+ if (LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat))
+ {
+ return;
+ }
+
//K now we want to accept the invitation
std::string url = gAgent.getRegion()->getCapability(
"ChatSessionRequest");