summaryrefslogtreecommitdiff
path: root/indra/newview/llavatarpropertiesprocessor.h
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@lindenlab.com>2009-09-09 17:10:06 -0700
committerBryan O'Sullivan <bos@lindenlab.com>2009-09-09 17:10:06 -0700
commita997e131d4262f0a18a6f4f8c305c73edbfea6b6 (patch)
tree5b7f8595e7911f4fd7ba6f2824c6b92f8478a9ef /indra/newview/llavatarpropertiesprocessor.h
parentcab31b572d1a3b717b7f8b9fdf2a49f0b2eb6995 (diff)
parentbbf497469c4d71d5308421f1ef06d0a2098772c8 (diff)
Merge with SVN viewer-2.0.0-3 branch
Diffstat (limited to 'indra/newview/llavatarpropertiesprocessor.h')
-rw-r--r--indra/newview/llavatarpropertiesprocessor.h61
1 files changed, 46 insertions, 15 deletions
diff --git a/indra/newview/llavatarpropertiesprocessor.h b/indra/newview/llavatarpropertiesprocessor.h
index 2e10dea834..24675c44c0 100644
--- a/indra/newview/llavatarpropertiesprocessor.h
+++ b/indra/newview/llavatarpropertiesprocessor.h
@@ -43,10 +43,6 @@
- Remove EAvatarProcessorType in favor of separate observers, derived from a common parent (to get rid of void*).
*/
-/*
-*TODO: mantipov: get rid of sendDataRequest and sendDataUpdate methods. Use exact methods instead of.
-*/
-
class LLMessageSystem;
enum EAvatarProcessorType
@@ -157,10 +153,20 @@ public:
void addObserver(const LLUUID& avatar_id, LLAvatarPropertiesObserver* observer);
void removeObserver(const LLUUID& avatar_id, LLAvatarPropertiesObserver* observer);
-
- void sendDataRequest(const LLUUID& avatar_id, EAvatarProcessorType type, const void * data = NULL);
- void sendDataUpdate(const void* data, EAvatarProcessorType type);
+ // Request various types of avatar data. Duplicate requests will be
+ // suppressed while waiting for a response from the network.
+ void sendAvatarPropertiesRequest(const LLUUID& avatar_id);
+ void sendAvatarPicksRequest(const LLUUID& avatar_id);
+ void sendAvatarNotesRequest(const LLUUID& avatar_id);
+ void sendAvatarGroupsRequest(const LLUUID& avatar_id);
+
+ // Duplicate pick info requests are not suppressed.
+ void sendPickInfoRequest(const LLUUID& creator_id, const LLUUID& pick_id);
+
+ void sendAvatarPropertiesUpdate(const LLAvatarData* avatar_props);
+
+ void sendPickInfoUpdate(const LLPickData* new_pick);
void sendFriendRights(const LLUUID& avatar_id, S32 rights);
@@ -168,6 +174,20 @@ public:
void sendPickDelete(const LLUUID& pick_id);
+ // Convert a date provided by the server (MM/DD/YYYY) into a localized,
+ // human-readable age (1 year, 2 months) using translation strings from
+ // the XML file.
+ static std::string ageFromDate(const std::string& date_string);
+
+ // Returns translated, human readable string for account type, such
+ // as "Resident" or "Linden Employee". Used for profiles, inspectors.
+ static std::string accountType(const LLAvatarData* avatar_data);
+
+ // Returns translated, human readable string for payment info, such
+ // as "Payment Info on File" or "Payment Info Used".
+ // Used for profiles, inspectors.
+ static std::string paymentInfo(const LLAvatarData* avatar_data);
+
static void processAvatarPropertiesReply(LLMessageSystem* msg, void**);
static void processAvatarInterestsReply(LLMessageSystem* msg, void**);
@@ -181,19 +201,23 @@ public:
static void processAvatarPicksReply(LLMessageSystem* msg, void**);
static void processPickInfoReply(LLMessageSystem* msg, void**);
+
protected:
- void sendAvatarPropertiesRequest(const LLUUID& avatar_id);
+ void sendGenericRequest(const LLUUID& avatar_id, EAvatarProcessorType type, const std::string method);
- void sendGenericRequest(const LLUUID& avatar_id, const std::string method);
-
- void sendAvatarPropertiesUpdate(const void* data);
+ void notifyObservers(const LLUUID& id,void* data, EAvatarProcessorType type);
- void sendPickInfoRequest(const LLUUID& creator_id, const LLUUID& pick_id);
-
- void sendPicInfoUpdate(const void * pick_data);
+ // Is there a pending, not timed out, request for this avatar's data?
+ // Use this to suppress duplicate requests for data when a request is
+ // pending.
+ bool isPendingRequest(const LLUUID& avatar_id, EAvatarProcessorType type);
- static void notifyObservers(const LLUUID& id,void* data, EAvatarProcessorType type);
+ // Call this when a request has been sent
+ void addPendingRequest(const LLUUID& avatar_id, EAvatarProcessorType type);
+
+ // Call this when the reply to the request is received
+ void removePendingRequest(const LLUUID& avatar_id, EAvatarProcessorType type);
typedef void* (*processor_method_t)(LLMessageSystem*);
static processor_method_t getProcessor(EAvatarProcessorType type);
@@ -203,6 +227,13 @@ protected:
typedef std::multimap<LLUUID, LLAvatarPropertiesObserver*> observer_multimap_t;
observer_multimap_t mObservers;
+
+ // Keep track of pending requests for data by avatar id and type.
+ // Maintain a timestamp for each request so a request that receives no reply
+ // does not block future requests forever.
+ // Map avatar_id+request_type -> U32 timestamp in seconds
+ typedef std::map< std::pair<LLUUID, EAvatarProcessorType>, U32> timestamp_map_t;
+ timestamp_map_t mRequestTimestamps;
};
#endif // LL_LLAVATARPROPERTIESPROCESSOR_H