summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorPaul ProductEngine <pguslisty@productengine.com>2012-09-06 23:16:22 +0300
committerPaul ProductEngine <pguslisty@productengine.com>2012-09-06 23:16:22 +0300
commitfd17cb601465b3433b647b895baede9b0fd822dd (patch)
treebcaea772971c92443b454e24d5584bc4c39d0e6b /indra/newview
parent1a913365b594de81de56896a9fbdfd6d8c4f21e0 (diff)
CHUI-320 FIXED (Inconsistent name formatting in conversation log depending if user started conversation or not)
- On P2P session started, before creating entry of conversation log, requesting avatar name in form of Display Name (user.name)
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llconversationlog.cpp23
-rw-r--r--indra/newview/llconversationlog.h3
2 files changed, 23 insertions, 3 deletions
diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp
index 7db6a93709..e80a709203 100644
--- a/indra/newview/llconversationlog.cpp
+++ b/indra/newview/llconversationlog.cpp
@@ -26,6 +26,7 @@
#include "llviewerprecompiledheaders.h"
#include "llagent.h"
+#include "llavatarnamecache.h"
#include "llconversationlog.h"
#include "lltrans.h"
@@ -152,6 +153,7 @@ void LLConversation::setListenIMFloaterOpened()
mIMFloaterShowedConnection = LLIMFloater::setIMFloaterShowedCallback(boost::bind(&LLConversation::onIMFloaterShown, this, _1));
}
}
+
/************************************************************************/
/* LLConversationLogFriendObserver implementation */
/************************************************************************/
@@ -262,9 +264,16 @@ void LLConversationLog::sessionAdded(const LLUUID& session_id, const std::string
LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(session_id);
if (session)
{
- LLConversation conversation(*session);
- LLConversationLog::instance().logConversation(conversation);
- session->mVoiceChannel->setStateChangedCallback(boost::bind(&LLConversationLog::onVoiceChannelConnected, this, _5, _2));
+ if (LLIMModel::LLIMSession::P2P_SESSION == session->mSessionType)
+ {
+ LLAvatarNameCache::get(session->mOtherParticipantID, boost::bind(&LLConversationLog::onAvatarNameCache, this, _1, _2, session));
+ }
+ else
+ {
+ LLConversation conversation(*session);
+ LLConversationLog::instance().logConversation(conversation);
+ session->mVoiceChannel->setStateChangedCallback(boost::bind(&LLConversationLog::onVoiceChannelConnected, this, _5, _2));
+ }
}
}
@@ -425,3 +434,11 @@ void LLConversationLog::onVoiceChannelConnected(const LLUUID& session_id, const
}
}
}
+
+void LLConversationLog::onAvatarNameCache(const LLUUID& participant_id, const LLAvatarName& av_name, LLIMModel::LLIMSession* session)
+{
+ LLConversation conversation(*session);
+ conversation.setConverstionName(av_name.getCompleteName());
+ LLConversationLog::instance().logConversation(conversation);
+ session->mVoiceChannel->setStateChangedCallback(boost::bind(&LLConversationLog::onVoiceChannelConnected, this, _5, _2));
+}
diff --git a/indra/newview/llconversationlog.h b/indra/newview/llconversationlog.h
index 9fd54c61c9..0d7f0080e5 100644
--- a/indra/newview/llconversationlog.h
+++ b/indra/newview/llconversationlog.h
@@ -62,6 +62,7 @@ public:
void setIsVoice(bool is_voice);
void setIsPast (bool is_past) { mIsConversationPast = is_past; }
+ void setConverstionName(std::string conv_name) { mConversationName = conv_name; }
/*
* Resets flag of unread offline message to false when im floater with this conversation is opened.
@@ -156,6 +157,8 @@ private:
bool saveToFile(const std::string& filename);
bool loadFromFile(const std::string& filename);
+ void onAvatarNameCache(const LLUUID& participant_id, const LLAvatarName& av_name, LLIMModel::LLIMSession* session);
+
typedef std::vector<LLConversation> conversations_vec_t;
std::vector<LLConversation> mConversations;
std::set<LLConversationLogObserver*> mObservers;