summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-04-19 16:17:50 +0300
committerVadim Savchuk <vsavchuk@productengine.com>2010-04-19 16:17:50 +0300
commitd78984145e96ac89012a84e92c88c8c67af900b8 (patch)
treec8ad39205c55c0df332fe708c2dcfb6d6c49d069
parent0756770e79f69496153d74e72e41a46206889ea5 (diff)
parenta94ec45cb18f262e9cb9277960c450d84479757b (diff)
merge
--HG-- branch : product-engine
-rw-r--r--indra/newview/llparticipantlist.cpp57
-rw-r--r--indra/newview/llparticipantlist.h1
-rw-r--r--indra/newview/skins/default/xui/en/menu_participant_list.xml11
-rw-r--r--indra/newview/skins/default/xui/en/panel_people.xml8
4 files changed, 51 insertions, 26 deletions
diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index 53f92f7ad1..c3748ca81d 100644
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -643,6 +643,7 @@ LLContextMenu* LLParticipantList::LLParticipantListMenu::createMenu()
registrar.add("ParticipantList.ModerateVoice", boost::bind(&LLParticipantList::LLParticipantListMenu::moderateVoice, this, _2));
enable_registrar.add("ParticipantList.EnableItem", boost::bind(&LLParticipantList::LLParticipantListMenu::enableContextMenuItem, this, _2));
+ enable_registrar.add("ParticipantList.EnableItem.Moderate", boost::bind(&LLParticipantList::LLParticipantListMenu::enableModerateContextMenuItem, this, _2));
enable_registrar.add("ParticipantList.CheckItem", boost::bind(&LLParticipantList::LLParticipantListMenu::checkContextMenuItem, this, _2));
// create the context menu from the XUI
@@ -667,7 +668,7 @@ void LLParticipantList::LLParticipantListMenu::show(LLView* spawning_view, const
if (uuids.size() == 0) return;
- const LLUUID speaker_id = mUUIDs.front();
+ const LLUUID& speaker_id = mUUIDs.front();
BOOL is_muted = isMuted(speaker_id);
if (is_muted)
@@ -801,28 +802,18 @@ void LLParticipantList::LLParticipantListMenu::moderateVoiceOtherParticipants(co
bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD& userdata)
{
std::string item = userdata.asString();
+ const LLUUID& participant_id = mUUIDs.front();
+
+ // For now non of "can_view_profile" action and menu actions listed below except "can_block"
+ // can be performed for Avaline callers.
+ bool is_participant_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(participant_id);
+ if (!is_participant_avatar && "can_block" != item) return false;
+
if (item == "can_mute_text" || "can_block" == item || "can_share" == item || "can_im" == item
|| "can_pay" == item)
{
return mUUIDs.front() != gAgentID;
}
- else if (item == "can_allow_text_chat")
- {
- return isGroupModerator();
- }
- else if ("can_moderate_voice" == item)
- {
- if (isGroupModerator())
- {
- LLPointer<LLSpeaker> speakerp = mParent.mSpeakerMgr->findSpeaker(mUUIDs.front());
- if (speakerp.notNull())
- {
- // not in voice participants can not be moderated
- return speakerp->isInVoiceChannel();
- }
- }
- return false;
- }
else if (item == std::string("can_add"))
{
// We can add friends if:
@@ -855,6 +846,36 @@ bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD&
return true;
}
+/*
+Processed menu items with such parameters:
+ can_allow_text_chat
+ can_moderate_voice
+*/
+bool LLParticipantList::LLParticipantListMenu::enableModerateContextMenuItem(const LLSD& userdata)
+{
+ // only group moderators can perform actions related to this "enable callback"
+ if (!isGroupModerator()) return false;
+
+ const LLUUID& participant_id = mUUIDs.front();
+ LLPointer<LLSpeaker> speakerp = mParent.mSpeakerMgr->findSpeaker(participant_id);
+
+ // not in voice participants can not be moderated
+ bool speaker_in_voice = speakerp.notNull() && speakerp->isInVoiceChannel();
+
+ const std::string& item = userdata.asString();
+
+ if ("can_moderate_voice" == item)
+ {
+ return speaker_in_voice;
+ }
+
+ // For now non of menu actions except "can_moderate_voice" can be performed for Avaline callers.
+ bool is_participant_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(participant_id);
+ if (!is_participant_avatar) return false;
+
+ return true;
+}
+
bool LLParticipantList::LLParticipantListMenu::checkContextMenuItem(const LLSD& userdata)
{
std::string item = userdata.asString();
diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h
index 9e5a2cbc1f..bbef8baaac 100644
--- a/indra/newview/llparticipantlist.h
+++ b/indra/newview/llparticipantlist.h
@@ -158,6 +158,7 @@ class LLParticipantList
LLParticipantList& mParent;
private:
bool enableContextMenuItem(const LLSD& userdata);
+ bool enableModerateContextMenuItem(const LLSD& userdata);
bool checkContextMenuItem(const LLSD& userdata);
void sortParticipantList(const LLSD& userdata);
diff --git a/indra/newview/skins/default/xui/en/menu_participant_list.xml b/indra/newview/skins/default/xui/en/menu_participant_list.xml
index 59c7f4ed85..2515b60868 100644
--- a/indra/newview/skins/default/xui/en/menu_participant_list.xml
+++ b/indra/newview/skins/default/xui/en/menu_participant_list.xml
@@ -30,6 +30,9 @@
name="View Profile">
<menu_item_call.on_click
function="Avatar.Profile" />
+ <menu_item_call.on_enable
+ function="ParticipantList.EnableItem"
+ parameter="can_view_profile" />
</menu_item_call>
<menu_item_call
label="Add Friend"
@@ -153,7 +156,7 @@
function="ParticipantList.ModerateVoice"
parameter="selected" />
<on_enable
- function="ParticipantList.EnableItem"
+ function="ParticipantList.EnableItem.Moderate"
parameter="can_moderate_voice" />
</menu_item_call>
<menu_item_call
@@ -164,7 +167,7 @@
function="ParticipantList.ModerateVoice"
parameter="others" />
<on_enable
- function="ParticipantList.EnableItem"
+ function="ParticipantList.EnableItem.Moderate"
parameter="can_moderate_voice" />
</menu_item_call>
<menu_item_call
@@ -175,7 +178,7 @@
function="ParticipantList.ModerateVoice"
parameter="selected" />
<on_enable
- function="ParticipantList.EnableItem"
+ function="ParticipantList.EnableItem.Moderate"
parameter="can_moderate_voice" />
</menu_item_call>
<menu_item_call
@@ -186,7 +189,7 @@
function="ParticipantList.ModerateVoice"
parameter="others" />
<on_enable
- function="ParticipantList.EnableItem"
+ function="ParticipantList.EnableItem.Moderate"
parameter="can_moderate_voice" />
</menu_item_call>
</context_menu>
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index 8131b75b70..43175c8509 100644
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -13,10 +13,10 @@
width="333">
<string
name="no_people"
- value="No people" />
+ value="No recent people. Looking for people to hang out with? Try [secondlife:///app/search/people Search] or the [secondlife:///app/worldmap World Map]." />
<string
name="no_one_near"
- value="No one near" />
+ value="No one nearby. Looking for people to hang out with? Try [secondlife:///app/search/people Search] or the [secondlife:///app/worldmap World Map]." />
<string
name="no_friends_online"
value="No friends online" />
@@ -264,8 +264,8 @@
top="10"
width="293"
wrap="true">
- To add friends try [secondlife:///app/search/people global search] or use right-click on a Resident to add them as a friend.
-If you're looking for people to hang out with, [secondlife:///app/worldmap try the Map].
+ Find friends using [secondlife:///app/search/people Search] or right-click on a Resident to add them as a friend.
+Looking for people to hang out with? Try the [secondlife:///app/worldmap World Map].
</text>
</panel>
<panel