Attempt to satisfy Issue 82: Idle status in nametags doesn't always update properly

This commit is contained in:
Lirusaito
2013-07-18 23:19:34 -04:00
parent 85e667bb35
commit 663d0a29f2
2 changed files with 20 additions and 9 deletions

View File

@@ -61,6 +61,7 @@
#include "llviewermenu.h" #include "llviewermenu.h"
#include "llviewermessage.h" #include "llviewermessage.h"
#include "llviewerwindow.h" #include "llviewerwindow.h"
#include "llvoavatar.h" // For mIdleTimer reset
#include "llnotify.h" #include "llnotify.h"
#include "llviewerregion.h" #include "llviewerregion.h"
@@ -79,6 +80,8 @@ LLIMMgr* gIMMgr = NULL;
// //
// Helper Functions // Helper Functions
// //
LLVOAvatar* find_avatar_from_object(const LLUUID& id);
LLColor4 agent_chat_color(const LLUUID& id, const std::string& name, bool local_chat) LLColor4 agent_chat_color(const LLUUID& id, const std::string& name, bool local_chat)
{ {
if (id.isNull() || (name == SYSTEM_FROM)) 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 // create IM window as necessary
if(!floater) if(!floater)
{ {

View File

@@ -5419,16 +5419,20 @@ BOOL LLVOAvatar::processSingleAnimationStateChange( const LLUUID& anim_id, BOOL
{ {
sitDown(TRUE); sitDown(TRUE);
} }
else if(anim_id == ANIM_AGENT_SNAPSHOT && announce_snapshots) else if(anim_id == ANIM_AGENT_SNAPSHOT)
{ {
std::string name; mIdleTimer.reset(); // Snapshot, not idle
LLAvatarNameCache::getPNSName(mID, name); if (announce_snapshots)
LLChat chat; {
chat.mFromName = name; std::string name;
chat.mText = name + " " + LLTrans::getString("took_a_snapshot") + "."; LLAvatarNameCache::getPNSName(mID, name);
chat.mURL = llformat("secondlife:///app/agent/%s/about",mID.asString().c_str()); LLChat chat;
chat.mSourceType = CHAT_SOURCE_SYSTEM; chat.mFromName = name;
LLFloaterChat::addChat(chat); 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) void LLVOAvatar::sitDown(BOOL bSitting)
{ {
if (mIsSitting != bSitting) mIdleTimer.reset(); // Sitting changed, not idle
mIsSitting = bSitting; mIsSitting = bSitting;
if (isSelf()) if (isSelf())
{ {
@@ -7333,6 +7338,7 @@ void LLVOAvatar::addChat(const LLChat& chat)
} }
mChatTimer.reset(); mChatTimer.reset();
mIdleTimer.reset(); // Also reset idle timer
} }
void LLVOAvatar::clearChat() void LLVOAvatar::clearChat()