Fixing chat logs to use username

master
Leyla Farazha 2010-09-08 16:39:25 -07:00
parent df97ed70de
commit 40a6786af6
2 changed files with 13 additions and 0 deletions

View File

@ -518,6 +518,11 @@ bool LLIMModel::LLIMSession::isOtherParticipantAvaline()
return !mOtherParticipantIsAvatar;
}
void LLIMModel::LLIMSession::onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name)
{
mHistoryFileName = av_name.mUsername;
}
void LLIMModel::LLIMSession::buildHistoryFileName()
{
mHistoryFileName = mName;
@ -536,6 +541,12 @@ void LLIMModel::LLIMSession::buildHistoryFileName()
//in case of incoming ad-hoc sessions
mHistoryFileName = mName + " " + LLLogChat::timestamp(true) + " " + mSessionID.asString().substr(0, 4);
}
// look up username to use as the log name
if (isP2P())
{
LLAvatarNameCache::get(mOtherParticipantID, boost::bind(&LLIMModel::LLIMSession::onAvatarNameCache, this, _1, _2));
}
}
//static

View File

@ -97,6 +97,8 @@ public:
/** ad-hoc sessions involve sophisticated chat history file naming schemes */
void buildHistoryFileName();
void onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name);
//*TODO make private
static std::string generateHash(const std::set<LLUUID>& sorted_uuids);