summaryrefslogtreecommitdiff
path: root/indra/newview/llconversationlog.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llconversationlog.h')
-rw-r--r--indra/newview/llconversationlog.h44
1 files changed, 28 insertions, 16 deletions
diff --git a/indra/newview/llconversationlog.h b/indra/newview/llconversationlog.h
index 16be37d67a..ffd27f7e20 100644
--- a/indra/newview/llconversationlog.h
+++ b/indra/newview/llconversationlog.h
@@ -57,16 +57,19 @@ public:
const std::string& getTimestamp() const { return mTimestamp; }
const time_t& getTime() const { return mTime; }
bool isVoice() const { return mIsVoice; }
- bool isConversationPast() const { return mIsConversationPast; }
bool hasOfflineMessages() const { return mHasOfflineIMs; }
void setIsVoice(bool is_voice);
- void setIsPast (bool is_past) { mIsConversationPast = is_past; }
void setConverstionName(std::string conv_name) { mConversationName = conv_name; }
bool isOlderThan(U32 days) const;
/*
+ * updates last interaction time
+ */
+ void updateTimestamp();
+
+ /*
* Resets flag of unread offline message to false when im floater with this conversation is opened.
*/
void onIMFloaterShown(const LLUUID& session_id);
@@ -86,7 +89,7 @@ private:
boost::signals2::connection mIMFloaterShowedConnection;
- time_t mTime; // start time of conversation
+ time_t mTime; // last interaction time
SessionType mConversationType;
std::string mConversationName;
std::string mHistoryFileName;
@@ -94,8 +97,7 @@ private:
LLUUID mParticipantID;
bool mIsVoice;
bool mHasOfflineIMs;
- bool mIsConversationPast; // once session is finished conversation became past forever
- std::string mTimestamp; // conversation start time in form of: mm/dd/yyyy hh:mm
+ std::string mTimestamp; // last interaction time in form of: mm/dd/yyyy hh:mm
};
/**
@@ -112,32 +114,26 @@ class LLConversationLog : public LLSingleton<LLConversationLog>, LLIMSessionObse
friend class LLSingleton<LLConversationLog>;
public:
- /**
- * adds conversation to the conversation list and notifies observers
- */
- void logConversation(const LLConversation& conversation);
void removeConversation(const LLConversation& conversation);
/**
* Returns first conversation with matched session_id
*/
- const LLConversation* getConversation(const LLUUID& session_id);
+ const LLConversation* getConversation(const LLUUID& session_id);
+ const std::vector<LLConversation>& getConversations() { return mConversations; }
void addObserver(LLConversationLogObserver* observer);
void removeObserver(LLConversationLogObserver* observer);
- const std::vector<LLConversation>& getConversations() { return mConversations; }
-
// LLIMSessionObserver triggers
virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
- virtual void sessionRemoved(const LLUUID& session_id);
+ virtual void sessionRemoved(const LLUUID& session_id){} // Stub
virtual void sessionVoiceOrIMStarted(const LLUUID& session_id){}; // Stub
virtual void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id){}; // Stub
void notifyObservers();
- void notifyPrticularConversationObservers(const LLUUID& session_id, U32 mask);
- void onVoiceChannelConnected(const LLUUID& session_id, const LLVoiceChannel::EState& state);
+ void onNewMessageReceived(const LLSD& data);
/**
* public method which is called on viewer exit to save conversation log
@@ -148,6 +144,13 @@ private:
LLConversationLog();
+ /**
+ * adds conversation to the conversation list and notifies observers
+ */
+ void logConversation(const LLUUID& session_id);
+
+ void notifyPrticularConversationObservers(const LLUUID& session_id, U32 mask);
+
void observeIMSession();
/**
@@ -161,11 +164,19 @@ private:
void onAvatarNameCache(const LLUUID& participant_id, const LLAvatarName& av_name, LLIMModel::LLIMSession* session);
+ void createConversation(const LLUUID& session_id);
+ void updateConversationTimestamp(LLConversation* conversation);
+ void updateConversationName(const LLUUID& session_id, const std::string& name);
+
+ LLConversation* findConversation(const LLUUID& session_id);
+
typedef std::vector<LLConversation> conversations_vec_t;
std::vector<LLConversation> mConversations;
std::set<LLConversationLogObserver*> mObservers;
LLFriendObserver* mFriendObserver; // Observer of the LLAvatarTracker instance
+
+ boost::signals2::connection newMessageSignalConnection;
};
class LLConversationLogObserver
@@ -174,7 +185,8 @@ public:
enum EConversationChange
{
- VOICE_STATE = 1
+ CHANGED_TIME = 1, // last interaction time changed
+ CHANGED_NAME = 2 // conversation name changed
};
virtual ~LLConversationLogObserver(){}