Attempt to satisfy Issue 82: Idle status in nametags doesn't always update properly
This commit is contained in:
@@ -61,6 +61,7 @@
|
||||
#include "llviewermenu.h"
|
||||
#include "llviewermessage.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llvoavatar.h" // For mIdleTimer reset
|
||||
#include "llnotify.h"
|
||||
#include "llviewerregion.h"
|
||||
|
||||
@@ -79,6 +80,8 @@ LLIMMgr* gIMMgr = NULL;
|
||||
//
|
||||
// Helper Functions
|
||||
//
|
||||
LLVOAvatar* find_avatar_from_object(const LLUUID& id);
|
||||
|
||||
LLColor4 agent_chat_color(const LLUUID& id, const std::string& name, bool local_chat)
|
||||
{
|
||||
if (id.isNull() || (name == SYSTEM_FROM))
|
||||
@@ -517,6 +520,8 @@ void LLIMMgr::addMessage(
|
||||
}
|
||||
}
|
||||
|
||||
if (LLVOAvatar* from_avatar = find_avatar_from_object(target_id)) from_avatar->mIdleTimer.reset(); // Not idle, message sent to somewhere
|
||||
|
||||
// create IM window as necessary
|
||||
if(!floater)
|
||||
{
|
||||
|
||||
@@ -5419,16 +5419,20 @@ BOOL LLVOAvatar::processSingleAnimationStateChange( const LLUUID& anim_id, BOOL
|
||||
{
|
||||
sitDown(TRUE);
|
||||
}
|
||||
else if(anim_id == ANIM_AGENT_SNAPSHOT && announce_snapshots)
|
||||
else if(anim_id == ANIM_AGENT_SNAPSHOT)
|
||||
{
|
||||
std::string name;
|
||||
LLAvatarNameCache::getPNSName(mID, name);
|
||||
LLChat chat;
|
||||
chat.mFromName = name;
|
||||
chat.mText = name + " " + LLTrans::getString("took_a_snapshot") + ".";
|
||||
chat.mURL = llformat("secondlife:///app/agent/%s/about",mID.asString().c_str());
|
||||
chat.mSourceType = CHAT_SOURCE_SYSTEM;
|
||||
LLFloaterChat::addChat(chat);
|
||||
mIdleTimer.reset(); // Snapshot, not idle
|
||||
if (announce_snapshots)
|
||||
{
|
||||
std::string name;
|
||||
LLAvatarNameCache::getPNSName(mID, name);
|
||||
LLChat chat;
|
||||
chat.mFromName = name;
|
||||
chat.mText = name + " " + LLTrans::getString("took_a_snapshot") + ".";
|
||||
chat.mURL = llformat("secondlife:///app/agent/%s/about",mID.asString().c_str());
|
||||
chat.mSourceType = CHAT_SOURCE_SYSTEM;
|
||||
LLFloaterChat::addChat(chat);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6417,6 +6421,7 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object)
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLVOAvatar::sitDown(BOOL bSitting)
|
||||
{
|
||||
if (mIsSitting != bSitting) mIdleTimer.reset(); // Sitting changed, not idle
|
||||
mIsSitting = bSitting;
|
||||
if (isSelf())
|
||||
{
|
||||
@@ -7333,6 +7338,7 @@ void LLVOAvatar::addChat(const LLChat& chat)
|
||||
}
|
||||
|
||||
mChatTimer.reset();
|
||||
mIdleTimer.reset(); // Also reset idle timer
|
||||
}
|
||||
|
||||
void LLVOAvatar::clearChat()
|
||||
|
||||
Reference in New Issue
Block a user