summaryrefslogtreecommitdiff
path: root/indra/newview/llparticipantlist.cpp
diff options
context:
space:
mode:
authorPaul Guslisty <pguslisty@productengine.com>2009-12-11 21:44:48 +0200
committerPaul Guslisty <pguslisty@productengine.com>2009-12-11 21:44:48 +0200
commitfd99f8701cfe4cbcd95f847b77e985703937a581 (patch)
treef776f19628845c48697986ecf7a8071a5f01dcaf /indra/newview/llparticipantlist.cpp
parent2acb204c4b1bdc4cc11c7af51ebfd09c47c3e231 (diff)
Fixed normal bug EXT - 2863 (Group Chat List Names right click do not contain view profile or send private message)
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llparticipantlist.cpp')
-rw-r--r--indra/newview/llparticipantlist.cpp61
1 files changed, 52 insertions, 9 deletions
diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index 6b3f468ff1..47b9f29b48 100644
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -42,6 +42,7 @@
#include "llavatarlist.h"
#include "llspeakers.h"
#include "llviewermenu.h"
+#include "llvoiceclient.h"
//LLParticipantList retrieves add, clear and remove events and updates view accordingly
#if LL_MSVC
@@ -416,6 +417,14 @@ LLContextMenu* LLParticipantList::LLParticipantListMenu::createMenu()
registrar.add("ParticipantList.ToggleAllowTextChat", boost::bind(&LLParticipantList::LLParticipantListMenu::toggleAllowTextChat, this, _2));
registrar.add("ParticipantList.ToggleMuteText", boost::bind(&LLParticipantList::LLParticipantListMenu::toggleMuteText, this, _2));
+ registrar.add("Avatar.Profile", boost::bind(&LLAvatarActions::showProfile, mUUIDs.front()));
+ registrar.add("Avatar.IM", boost::bind(&LLAvatarActions::startIM, mUUIDs.front()));
+ registrar.add("Avatar.AddFriend", boost::bind(&LLAvatarActions::requestFriendshipDialog, mUUIDs.front()));
+ registrar.add("Avatar.BlockUnblock", boost::bind(&LLParticipantList::LLParticipantListMenu::toggleMuteVoice, this, _2));
+ registrar.add("Avatar.Share", boost::bind(&LLAvatarActions::share, mUUIDs.front()));
+ registrar.add("Avatar.Pay", boost::bind(&LLAvatarActions::pay, mUUIDs.front()));
+ registrar.add("Avatar.Call", boost::bind(&LLAvatarActions::startCall, mUUIDs.front()));
+
registrar.add("ParticipantList.ModerateVoice", boost::bind(&LLParticipantList::LLParticipantListMenu::moderateVoice, this, _2));
enable_registrar.add("ParticipantList.EnableItem", boost::bind(&LLParticipantList::LLParticipantListMenu::enableContextMenuItem, this, _2));
@@ -604,6 +613,33 @@ bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD&
{
return isGroupModerator();
}
+ else if (item == std::string("can_add"))
+ {
+ // We can add friends if:
+ // - there are selected people
+ // - and there are no friends among selection yet.
+
+ bool result = (mUUIDs.size() > 0);
+
+ std::vector<LLUUID>::const_iterator
+ id = mUUIDs.begin(),
+ uuids_end = mUUIDs.end();
+
+ for (;id != uuids_end; ++id)
+ {
+ if ( LLAvatarActions::isFriend(*id) )
+ {
+ result = false;
+ break;
+ }
+ }
+ return result;
+ }
+ else if (item == "can_call")
+ {
+ return LLVoiceClient::voiceEnabled();
+ }
+
return true;
}
@@ -611,18 +647,25 @@ bool LLParticipantList::LLParticipantListMenu::checkContextMenuItem(const LLSD&
{
std::string item = userdata.asString();
const LLUUID& id = mUUIDs.front();
+
if (item == "is_muted")
- return LLMuteList::getInstance()->isMuted(id, LLMute::flagTextChat);
- else
- if (item == "is_allowed_text_chat")
- {
- LLPointer<LLSpeaker> selected_speakerp = mParent.mSpeakerMgr->findSpeaker(id);
+ {
+ return LLMuteList::getInstance()->isMuted(id, LLMute::flagTextChat);
+ }
+ else if (item == "is_allowed_text_chat")
+ {
+ LLPointer<LLSpeaker> selected_speakerp = mParent.mSpeakerMgr->findSpeaker(id);
- if (selected_speakerp.notNull())
- {
- return !selected_speakerp->mModeratorMutedText;
- }
+ if (selected_speakerp.notNull())
+ {
+ return !selected_speakerp->mModeratorMutedText;
}
+ }
+ else if(item == "is_blocked")
+ {
+ return LLMuteList::getInstance()->isMuted(id, LLMute::flagVoiceChat);
+ }
+
return false;
}