summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorCho <cho@lindenlab.com>2013-01-25 22:57:02 +0000
committerCho <cho@lindenlab.com>2013-01-25 22:57:02 +0000
commit5e8e27838d26b02a76134e03f81c8e4f294e4443 (patch)
treea19e0c1452db9723b46901d305697dddf6cc873a /indra/newview
parent163f3de73d93be8f5e482be03a1952244cadee68 (diff)
parent427725c2a6d5c50468e7579a4d3b92795425723f (diff)
merging latest changes
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llconversationview.cpp32
-rwxr-xr-xindra/newview/llconversationview.h4
-rw-r--r--indra/newview/lldonotdisturbnotificationstorage.cpp22
-rw-r--r--indra/newview/lldonotdisturbnotificationstorage.h6
-rw-r--r--indra/newview/llfloaterimcontainer.cpp6
-rw-r--r--indra/newview/llimview.cpp2
-rw-r--r--indra/newview/llinventoryfunctions.cpp27
-rw-r--r--indra/newview/llinventoryfunctions.h1
-rw-r--r--indra/newview/llspeakers.cpp67
-rw-r--r--indra/newview/llspeakers.h1
-rw-r--r--indra/newview/llspeakingindicatormanager.cpp13
-rw-r--r--indra/newview/lltoastnotifypanel.cpp6
-rw-r--r--indra/newview/lltoastpanel.cpp4
-rwxr-xr-xindra/newview/llviewermessage.cpp6
14 files changed, 147 insertions, 50 deletions
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index 16dd0e4565..5ff013ccc4 100755
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -82,6 +82,7 @@ LLConversationViewSession::LLConversationViewSession(const LLConversationViewSes
mVoiceClientObserver(NULL),
mCollapsedMode(false),
mHasArrow(true),
+ mIsInActiveVoiceChannel(false),
mFlashStateOn(false),
mFlashStarted(false)
{
@@ -178,6 +179,7 @@ BOOL LLConversationViewSession::postBuild()
LLIconCtrl* icon = mItemPanel->getChild<LLIconCtrl>("nearby_chat_icon");
icon->setVisible(true);
mSpeakingIndicator->setSpeakerId(gAgentID, LLUUID::null, true);
+ mIsInActiveVoiceChannel = true;
if(LLVoiceClient::instanceExists())
{
LLNearbyVoiceClientStatusObserver* mVoiceClientObserver = new LLNearbyVoiceClientStatusObserver(this);
@@ -232,6 +234,8 @@ void LLConversationViewSession::draw()
drawOpenFolderArrow(default_params, sFgColor);
}
+ refresh();
+
LLView::draw();
}
@@ -351,6 +355,25 @@ void LLConversationViewSession::refresh()
// Update all speaking indicators
LLSpeakingIndicatorManager::updateSpeakingIndicators();
+
+ // we should show indicator for specified voice session only if this is current channel. EXT-5562.
+ if (!mIsInActiveVoiceChannel)
+ {
+ if (mSpeakingIndicator)
+ {
+ mSpeakingIndicator->setVisible(false);
+ }
+ LLConversationViewParticipant* participant = NULL;
+ items_t::const_iterator iter;
+ for (iter = getItemsBegin(); iter != getItemsEnd(); iter++)
+ {
+ participant = dynamic_cast<LLConversationViewParticipant*>(*iter);
+ if (participant)
+ {
+ participant->hideSpeakingIndicator();
+ }
+ }
+ }
// Do the regular upstream refresh
LLFolderViewFolder::refresh();
@@ -362,8 +385,8 @@ void LLConversationViewSession::onCurrentVoiceSessionChanged(const LLUUID& sessi
if (vmi)
{
- bool is_active = vmi->getUUID() == session_id;
- mCallIconLayoutPanel->setVisible(is_active);
+ mIsInActiveVoiceChannel = vmi->getUUID() == session_id;
+ mCallIconLayoutPanel->setVisible(mIsInActiveVoiceChannel);
}
}
@@ -623,5 +646,10 @@ LLView* LLConversationViewParticipant::getItemChildView(EAvatarListItemChildInde
return child_view;
}
+void LLConversationViewParticipant::hideSpeakingIndicator()
+{
+ mSpeakingIndicator->setVisible(false);
+}
+
// EOF
diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h
index 5f6acfb9ab..f2fa2fb042 100755
--- a/indra/newview/llconversationview.h
+++ b/indra/newview/llconversationview.h
@@ -102,6 +102,8 @@ private:
bool mCollapsedMode;
bool mHasArrow;
+ bool mIsInActiveVoiceChannel;
+
LLVoiceClientStatusObserver* mVoiceClientObserver;
boost::signals2::connection mActiveVoiceChannelConnection;
@@ -137,6 +139,8 @@ public:
/*virtual*/ S32 getLabelXPos();
+ void hideSpeakingIndicator();
+
protected:
friend class LLUICtrlFactory;
LLConversationViewParticipant( const Params& p );
diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp
index 824ff67972..15c42e8285 100644
--- a/indra/newview/lldonotdisturbnotificationstorage.cpp
+++ b/indra/newview/lldonotdisturbnotificationstorage.cpp
@@ -43,7 +43,8 @@
#include "lluuid.h"
static const F32 DND_TIMER = 3.0;
-const std::string toastName = "IMToast";
+const char * LLDoNotDisturbNotificationStorage::toastName = "IMToast";
+const char * LLDoNotDisturbNotificationStorage::offerName = "UserGiveItem";
LLDoNotDisturbNotificationStorageTimer::LLDoNotDisturbNotificationStorageTimer() : LLEventTimer(DND_TIMER)
{
@@ -72,6 +73,8 @@ LLDoNotDisturbNotificationStorage::LLDoNotDisturbNotificationStorage()
, LLNotificationStorage(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "dnd_notifications.xml"))
, mDirty(false)
{
+ nameToPayloadParameterMap[toastName] = "SESSION_ID";
+ nameToPayloadParameterMap[offerName] = "object_id";
}
LLDoNotDisturbNotificationStorage::~LLDoNotDisturbNotificationStorage()
@@ -234,15 +237,16 @@ LLNotificationChannelPtr LLDoNotDisturbNotificationStorage::getCommunicationChan
return channelPtr;
}
-void LLDoNotDisturbNotificationStorage::removeIMNotification(const LLUUID& session_id)
+void LLDoNotDisturbNotificationStorage::removeNotification(const char * name, const LLUUID& id)
{
LLNotifications& instance = LLNotifications::instance();
LLNotificationChannelPtr channelPtr = getCommunicationChannel();
LLCommunicationChannel *commChannel = dynamic_cast<LLCommunicationChannel*>(channelPtr.get());
LLNotificationPtr notification;
- LLSD substitutions;
- LLUUID notificationSessionID;
+ LLSD payload;
+ LLUUID notificationObjectID;
std::string notificationName;
+ std::string payloadVariable = nameToPayloadParameterMap[name];
LLCommunicationChannel::history_list_t::iterator it;
std::vector<LLCommunicationChannel::history_list_t::iterator> itemsToRemove;
@@ -252,18 +256,18 @@ void LLDoNotDisturbNotificationStorage::removeIMNotification(const LLUUID& sessi
++it)
{
notification = it->second;
- substitutions = notification->getSubstitutions();
- notificationSessionID = substitutions["SESSION_ID"].asUUID();
+ payload = notification->getPayload();
+ notificationObjectID = payload[payloadVariable].asUUID();
notificationName = notification->getName();
- if(notificationName == toastName
- && session_id == notificationSessionID)
+ if((notificationName == name)
+ && id == notificationObjectID)
{
itemsToRemove.push_back(it);
}
}
-
+
//Remove the notifications
if(itemsToRemove.size())
{
diff --git a/indra/newview/lldonotdisturbnotificationstorage.h b/indra/newview/lldonotdisturbnotificationstorage.h
index fd7cc7ee82..6e68b0d1be 100644
--- a/indra/newview/lldonotdisturbnotificationstorage.h
+++ b/indra/newview/lldonotdisturbnotificationstorage.h
@@ -49,6 +49,9 @@ class LLDoNotDisturbNotificationStorage : public LLSingleton<LLDoNotDisturbNotif
{
LOG_CLASS(LLDoNotDisturbNotificationStorage);
public:
+ static const char * toastName;
+ static const char * offerName;
+
LLDoNotDisturbNotificationStorage();
~LLDoNotDisturbNotificationStorage();
@@ -58,7 +61,7 @@ public:
void saveNotifications();
void loadNotifications();
void updateNotifications();
- void removeIMNotification(const LLUUID& session_id);
+ void removeNotification(const char * name, const LLUUID& id);
protected:
@@ -68,6 +71,7 @@ private:
LLNotificationChannelPtr getCommunicationChannel() const;
bool onChannelChanged(const LLSD& pPayload);
+ std::map<std::string, std::string> nameToPayloadParameterMap;
};
#endif // LL_LLDONOTDISTURBNOTIFICATIONSTORAGE_H
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 565063a0ea..ff6234fa27 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -1304,9 +1304,9 @@ BOOL LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool
{
BOOL handled = TRUE;
LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::findConversation(session_id);
-
+
/* widget processing */
- if (select_widget)
+ if (select_widget && mConversationsRoot->getSelectedCount() <= 1)
{
LLFolderViewItem* widget = get_ptr_in_map(mConversationsWidgets,session_id);
if (widget && widget->getParentFolder())
@@ -1318,7 +1318,7 @@ BOOL LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool
//Nearby chat (Null) IMs are not stored while in DND mode, so can ignore removal
if(gAgent.isDoNotDisturb() && session_id.notNull())
{
- LLDoNotDisturbNotificationStorage::getInstance()->removeIMNotification(session_id);
+ LLDoNotDisturbNotificationStorage::getInstance()->removeNotification(LLDoNotDisturbNotificationStorage::toastName, session_id);
}
}
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index d0a8dfc0c8..cb03c1d234 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -144,7 +144,7 @@ static void on_avatar_name_cache_toast(const LLUUID& agent_id,
args["FROM"] = av_name.getCompleteName();
args["FROM_ID"] = msg["from_id"];
args["SESSION_ID"] = msg["session_id"];
- LLNotificationsUtil::add("IMToast", args, LLSD(), boost::bind(&LLFloaterIMContainer::showConversation, LLFloaterIMContainer::getInstance(), msg["session_id"].asUUID()));
+ LLNotificationsUtil::add("IMToast", args, args, boost::bind(&LLFloaterIMContainer::showConversation, LLFloaterIMContainer::getInstance(), msg["session_id"].asUUID()));
}
void on_new_message(const LLSD& msg)
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 6474d56414..ad0a730dd1 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -46,6 +46,7 @@
#include "llappearancemgr.h"
#include "llappviewer.h"
#include "llclipboard.h"
+#include "lldonotdisturbnotificationstorage.h"
#include "llfloaterinventory.h"
#include "llfloatersidepanelcontainer.h"
#include "llfocusmgr.h"
@@ -1132,11 +1133,37 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
}
}
+void LLInventoryAction::removeItemFromDND(LLFolderView* root)
+{
+ if(gAgent.isDoNotDisturb())
+ {
+ //Get selected items
+ LLFolderView::selected_items_t selectedItems = root->getSelectedItems();
+ LLFolderViewModelItemInventory * viewModel = NULL;
+
+ //If user is in DND and deletes item, make sure the notification is not displayed by removing the notification
+ //from DND history and .xml file. Once this is done, upon exit of DND mode the item deleted will not show a notification.
+ for(LLFolderView::selected_items_t::iterator it = selectedItems.begin(); it != selectedItems.end(); ++it)
+ {
+ viewModel = dynamic_cast<LLFolderViewModelItemInventory *>((*it)->getViewModelItem());
+
+ if(viewModel && viewModel->getUUID().notNull())
+ {
+ //Will remove the item offer notification
+ LLDoNotDisturbNotificationStorage::instance().removeNotification(LLDoNotDisturbNotificationStorage::offerName, viewModel->getUUID());
+ }
+ }
+ }
+}
+
void LLInventoryAction::onItemsRemovalConfirmation( const LLSD& notification, const LLSD& response, LLFolderView* root )
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option == 0)
{
+ //Need to remove item from DND before item is removed from root folder view
+ //because once removed from root folder view the item is no longer a selected item
+ removeItemFromDND(root);
root->removeSelectedItems();
}
}
diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h
index 11fc17ce9b..f1066a4dc9 100644
--- a/indra/newview/llinventoryfunctions.h
+++ b/indra/newview/llinventoryfunctions.h
@@ -433,6 +433,7 @@ struct LLInventoryAction
static void doToSelected(class LLInventoryModel* model, class LLFolderView* root, const std::string& action);
static void onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response, LLFolderView* root);
+ static void removeItemFromDND(LLFolderView* root);
};
diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp
index 88f29d7587..a2d8874cea 100644
--- a/indra/newview/llspeakers.cpp
+++ b/indra/newview/llspeakers.cpp
@@ -31,6 +31,7 @@
#include "llagent.h"
#include "llappviewer.h"
#include "llimview.h"
+#include "llgroupmgr.h"
#include "llsdutil.h"
#include "lluicolortable.h"
#include "llviewerobjectlist.h"
@@ -305,9 +306,10 @@ private:
//
LLSpeakerMgr::LLSpeakerMgr(LLVoiceChannel* channelp) :
- mVoiceChannel(channelp)
-, mVoiceModerated(false)
-, mModerateModeHandledFirstTime(false)
+ mVoiceChannel(channelp),
+ mVoiceModerated(false),
+ mModerateModeHandledFirstTime(false),
+ mSpeakerListUpdated(false)
{
static LLUICachedControl<F32> remove_delay ("SpeakerParticipantRemoveDelay", 10.0);
@@ -321,7 +323,11 @@ LLSpeakerMgr::~LLSpeakerMgr()
LLPointer<LLSpeaker> LLSpeakerMgr::setSpeaker(const LLUUID& id, const std::string& name, LLSpeaker::ESpeakerStatus status, LLSpeaker::ESpeakerType type)
{
- if (id.isNull()) return NULL;
+ LLUUID session_id = getSessionID();
+ if (id.isNull() || (id == session_id))
+ {
+ return NULL;
+ }
LLPointer<LLSpeaker> speakerp;
if (mSpeakers.find(id) == mSpeakers.end())
@@ -525,23 +531,60 @@ void LLSpeakerMgr::updateSpeakerList()
{
// If not, check if the list is empty, except if it's Nearby Chat (session_id NULL).
LLUUID session_id = getSessionID();
- if ((mSpeakers.size() == 0) && (!session_id.isNull()))
+ if (!session_id.isNull() && !mSpeakerListUpdated)
{
- // If the list is empty, we update it with whatever was used to initiate the call so that it doesn't stay empty too long.
- // *TODO: Fix the server side code that sometimes forgets to send back the list of agents after a chat started
+ // If the list is empty, we update it with whatever we have locally so that it doesn't stay empty too long.
+ // *TODO: Fix the server side code that sometimes forgets to send back the list of participants after a chat started.
// (IOW, fix why we get no ChatterBoxSessionAgentListUpdates message after the initial ChatterBoxSessionStartReply)
LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(session_id);
- for (uuid_vec_t::iterator it = session->mInitialTargetIDs.begin();it!=session->mInitialTargetIDs.end();++it)
+ if (session->isGroupSessionType() && (mSpeakers.size() <= 1))
+ {
+ // For groups, we need to hit the group manager.
+ // Note: The session uuid and the group uuid are actually one and the same. If that was to change, this will fail.
+ LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(session_id);
+ if (!gdatap)
+ {
+ // Request the data the first time around
+ LLGroupMgr::getInstance()->sendCapGroupMembersRequest(session_id);
+ }
+ else if (gdatap->isMemberDataComplete() && !gdatap->mMembers.empty())
+ {
+ // Add group members when we get the complete list (note: can take a while before we get that list)
+ LLGroupMgrGroupData::member_list_t::iterator member_it = gdatap->mMembers.begin();
+ while (member_it != gdatap->mMembers.end())
+ {
+ LLGroupMemberData* member = member_it->second;
+ // Add only the members who are online
+ if (member->getOnlineStatus() == "Online")
+ {
+ setSpeaker(member_it->first, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT);
+ }
+ ++member_it;
+ }
+ mSpeakerListUpdated = true;
+ }
+ }
+ else if (mSpeakers.size() == 0)
{
- // Add buddies if they are on line, add any other avatar.
- if (!LLAvatarTracker::instance().isBuddy(*it) || LLAvatarTracker::instance().isBuddyOnline(*it))
+ // For all other session type (ad-hoc, P2P, avaline), we use the initial participants targets list
+ for (uuid_vec_t::iterator it = session->mInitialTargetIDs.begin();it!=session->mInitialTargetIDs.end();++it)
{
- setSpeaker(*it, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT);
+ // Add buddies if they are on line, add any other avatar.
+ if (!LLAvatarTracker::instance().isBuddy(*it) || LLAvatarTracker::instance().isBuddyOnline(*it))
+ {
+ setSpeaker(*it, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT);
+ }
}
+ mSpeakerListUpdated = true;
+ }
+ else
+ {
+ // The list has been updated the normal way (i.e. by a ChatterBoxSessionAgentListUpdates received from the server)
+ mSpeakerListUpdated = true;
}
}
}
- // Finally, always add the current agent (it has to be there no matter what...)
+ // Always add the current agent (it has to be there...). Will do nothing if already there.
setSpeaker(gAgentID, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT);
}
diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h
index 7d518fe07b..5f5095097e 100644
--- a/indra/newview/llspeakers.h
+++ b/indra/newview/llspeakers.h
@@ -263,6 +263,7 @@ protected:
typedef std::map<LLUUID, LLPointer<LLSpeaker> > speaker_map_t;
speaker_map_t mSpeakers;
+ bool mSpeakerListUpdated;
speaker_list_t mSpeakersSorted;
LLFrameTimer mSpeechTimer;
diff --git a/indra/newview/llspeakingindicatormanager.cpp b/indra/newview/llspeakingindicatormanager.cpp
index 76da7d1aee..07e9371124 100644
--- a/indra/newview/llspeakingindicatormanager.cpp
+++ b/indra/newview/llspeakingindicatormanager.cpp
@@ -237,18 +237,9 @@ void SpeakingIndicatorManager::switchSpeakerIndicators(const speaker_ids_t& spea
{
was_found = true;
LLSpeakingIndicator* indicator = (*it_indicator).second;
+ was_switched_on = was_switched_on || switch_on;
- BOOL switch_current_on = switch_on;
-
- // we should show indicator for specified voice session only if this is current channel. EXT-5562.
- if (switch_current_on)
- {
- switch_current_on = indicator->getTargetSessionID() == session_id;
- LL_DEBUGS("SpeakingIndicator") << "Session: " << session_id << ", target: " << indicator->getTargetSessionID() << ", the same? = " << switch_current_on << LL_ENDL;
- }
- was_switched_on = was_switched_on || switch_current_on;
-
- indicator->switchIndicator(switch_current_on);
+ indicator->switchIndicator(switch_on);
}
if (was_found)
diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp
index 268b68b539..0aab514531 100644
--- a/indra/newview/lltoastnotifypanel.cpp
+++ b/indra/newview/lltoastnotifypanel.cpp
@@ -537,11 +537,9 @@ LLIMToastNotifyPanel::~LLIMToastNotifyPanel()
}
void LLIMToastNotifyPanel::reshape(S32 width, S32 height, BOOL called_from_parent /* = TRUE */)
- {
- LLToastPanel::reshape(width, height, called_from_parent);
-
+{
snapToMessageHeight(mTextBox, MAX_LENGTH);
- }
+}
void LLIMToastNotifyPanel::compactButtons()
{
diff --git a/indra/newview/lltoastpanel.cpp b/indra/newview/lltoastpanel.cpp
index 187aee207c..54d3912136 100644
--- a/indra/newview/lltoastpanel.cpp
+++ b/indra/newview/lltoastpanel.cpp
@@ -81,7 +81,9 @@ void LLToastPanel::snapToMessageHeight(LLTextBase* message, S32 maxLineCount)
S32 newTextHeight = llmin(requiredTextHeight, maxTextHeight);
heightDelta = newTextHeight - oldTextHeight;
- S32 new_panel_height = llmax(getRect().getHeight() + heightDelta, MIN_PANEL_HEIGHT);
+ S32 new_panel_height = llmin(
+ llmax(getRect().getHeight() + heightDelta, MIN_PANEL_HEIGHT),
+ maxTextHeight);
//reshape the panel with new height
if (new_panel_height != getRect().getHeight())
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index d235ba5f96..8489e92d15 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -1649,12 +1649,6 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
delete this;
}
- if (notification_ptr != NULL)
- {
- notification_ptr->updateForm(modified_form);
- notification_ptr->repost();
- }
-
return false;
}