summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r--indra/newview/llimview.cpp34
1 files changed, 21 insertions, 13 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 2405c3a1a3..ff8b8b0403 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -646,6 +646,7 @@ void LLIMModel::LLIMSession::onVoiceChannelStateChanged(const LLVoiceChannel::ES
std::string you_joined_call = LLTrans::getString("you_joined_call");
std::string you_started_call = LLTrans::getString("you_started_call");
std::string other_avatar_name = "";
+ LLAvatarName av_name;
std::string message;
@@ -655,7 +656,8 @@ void LLIMModel::LLIMSession::onVoiceChannelStateChanged(const LLVoiceChannel::ES
// no text notifications
break;
case P2P_SESSION:
- gCacheName->getFullName(mOtherParticipantID, other_avatar_name); // voice
+ LLAvatarNameCache::get(mOtherParticipantID, &av_name);
+ other_avatar_name = av_name.getUserName();
if(direction == LLVoiceChannel::INCOMING_CALL)
{
@@ -806,7 +808,7 @@ void LLIMModel::LLIMSession::addMessagesFromHistory(const std::list<LLSD>& histo
{
// convert it to a legacy name if we have a complete name
std::string legacy_name = gCacheName->buildLegacyName(from);
- gCacheName->getUUID(legacy_name, from_id);
+ from_id = LLAvatarNameCache::findIdByName(legacy_name);
}
std::string timestamp = msg[LL_IM_TIME];
@@ -2703,7 +2705,7 @@ void LLIMMgr::addMessage(
// 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) && !from_linden)
+ if (LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat) && !from_linden)
{
LL_WARNS() << "Leaving IM session from initiating muted resident " << from << LL_ENDL;
if(!gIMMgr->leaveSession(new_session_id))
@@ -2765,10 +2767,10 @@ void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& mess
else
{
- std::string session_name;
+ LLAvatarName av_name;
// since we select user to share item with - his name is already in cache
- gCacheName->getFullName(args["user_id"], session_name);
- session_name = LLCacheName::buildUsername(session_name);
+ LLAvatarNameCache::get(args["user_id"], &av_name);
+ std::string session_name = LLCacheName::buildUsername(av_name.getUserName());
LLIMModel::instance().logToFile(session_name, SYSTEM_FROM, LLUUID::null, message.getString());
}
}
@@ -3011,14 +3013,20 @@ void LLIMMgr::inviteToSession(
payload["question_type"] = question_type;
//ignore invites from muted residents
- if (LLMuteList::getInstance()->isMuted(caller_id) && !is_linden)
+ if (!is_linden)
{
- if (voice_invite && "VoiceInviteQuestionDefault" == question_type)
+ if (LLMuteList::getInstance()->isMuted(caller_id, LLMute::flagVoiceChat)
+ && voice_invite && "VoiceInviteQuestionDefault" == question_type)
{
LL_INFOS() << "Rejecting voice call from initiating muted resident " << caller_name << LL_ENDL;
LLIncomingCallDialog::processCallResponse(1, payload);
+ return;
+ }
+ else if (LLMuteList::getInstance()->isMuted(caller_id, LLMute::flagAll & ~LLMute::flagVoiceChat))
+ {
+ LL_INFOS() << "Rejecting session invite from initiating muted resident " << caller_name << LL_ENDL;
+ return;
}
- return;
}
LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(session_id);
@@ -3069,8 +3077,8 @@ void LLIMMgr::inviteToSession(
{
if (caller_name.empty())
{
- gCacheName->get(caller_id, false, // voice
- boost::bind(&LLIMMgr::onInviteNameLookup, payload, _1, _2, _3));
+ LLAvatarNameCache::get(caller_id,
+ boost::bind(&LLIMMgr::onInviteNameLookup, payload, _1, _2));
}
else
{
@@ -3089,9 +3097,9 @@ void LLIMMgr::inviteToSession(
}
}
-void LLIMMgr::onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& name, bool is_group)
+void LLIMMgr::onInviteNameLookup(LLSD payload, const LLUUID& id, const LLAvatarName& av_name)
{
- payload["caller_name"] = name;
+ payload["caller_name"] = av_name.getUserName();
payload["session_name"] = payload["caller_name"].asString();
std::string notify_box_type = payload["notify_box_type"].asString();