additional commit to major task EXT-3509 User's own name should appear in the Group chat participant list

1. agent will be appear in ad-hoc conference too.
2. Disabling block/unblock yourself.

--HG--
branch : product-engine
meow-7.2.2
Denis Serdjuk 2009-12-21 14:43:09 +02:00
parent 1c3d7eec89
commit 40e9c253fc
6 changed files with 11 additions and 12 deletions

View File

@ -33,7 +33,7 @@
#include "llviewerprecompiledheaders.h"
#include "llavatarlist.h"
#include "llagent.h" // for comparator
#include "llagentdata.h" // for comparator
// newview
#include "llcallingcard.h" // for LLAvatarTracker
@ -425,11 +425,11 @@ bool LLAvatarItemAgentOnTopComparator::doCompare(const LLAvatarListItem* avatar_
{
//keep agent on top, if first is agent,
//then we need to return true to elevate this id, otherwise false.
if(avatar_item1->getAvatarId() == gAgent.getID())
if(avatar_item1->getAvatarId() == gAgentID)
{
return true;
}
else if (avatar_item2->getAvatarId() == gAgent.getID())
else if (avatar_item2->getAvatarId() == gAgentID)
{
return false;
}

View File

@ -280,7 +280,7 @@ void LLCallFloater::refreshPartisipantList()
if (!non_avatar_caller)
{
mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList);
mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList, true, mVoiceType != VC_GROUP_CHAT && mVoiceType != VC_AD_HOC_CHAT);
if (LLLocalSpeakerMgr::getInstance() == mSpeakerManager)
{

View File

@ -282,8 +282,9 @@ void LLPanelGroupControlPanel::setSessionId(const LLUUID& session_id)
mGroupID = LLIMModel::getInstance()->getOtherParticipantID(session_id);
// for group and Ad-hoc chat we need to include agent into list
if(!mParticipantList)
mParticipantList = new LLParticipantList(mSpeakerManager, getChild<LLAvatarList>("speakers_list"));
mParticipantList = new LLParticipantList(mSpeakerManager, getChild<LLAvatarList>("speakers_list"), true,false);
}

View File

@ -51,12 +51,13 @@
static const LLAvatarItemAgentOnTopComparator AGENT_ON_TOP_NAME_COMPARATOR;
LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list, bool use_context_menu/* = true*/):
LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list, bool use_context_menu/* = true*/,
bool exclude_agent /*= true*/):
mSpeakerMgr(data_source),
mAvatarList(avatar_list),
mSortOrder(E_SORT_BY_NAME)
, mParticipantListMenu(NULL)
, mExcludeAgent(true)
, mExcludeAgent(exclude_agent)
{
mSpeakerAddListener = new SpeakerAddListener(*this);
mSpeakerRemoveListener = new SpeakerRemoveListener(*this);
@ -101,7 +102,6 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av
}
}
// we need to exclude agent id for non group chat
mExcludeAgent = !gAgent.isInGroup(mSpeakerMgr->getSessionID());
mAvatarList->setDirty(true);
sort();
}
@ -555,7 +555,7 @@ void LLParticipantList::LLParticipantListMenu::moderateVoiceOtherParticipants(co
bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD& userdata)
{
std::string item = userdata.asString();
if (item == "can_mute_text")
if (item == "can_mute_text" || "can_block" == item)
{
return mUUIDs.front() != gAgentID;
}

View File

@ -43,7 +43,7 @@ class LLParticipantList
{
LOG_CLASS(LLParticipantList);
public:
LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list, bool use_context_menu = true);
LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list, bool use_context_menu = true, bool exclude_agent = true);
~LLParticipantList();
void setSpeakingIndicatorsVisible(BOOL visible);

View File

@ -630,8 +630,6 @@ void LLIMSpeakerMgr::toggleAllowTextChat(const LLUUID& speaker_id)
void LLIMSpeakerMgr::moderateVoiceParticipant(const LLUUID& avatar_id, bool unmute)
{
if (gAgentID == avatar_id) return; // do not process myself
LLPointer<LLSpeaker> speakerp = findSpeaker(avatar_id);
if (!speakerp) return;