diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-05-15 09:07:21 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-05-15 09:07:21 -0400 |
commit | 5d43bc166d011e911e0492579b2f4f8bf015b48f (patch) | |
tree | ccc4cda5c2c2c3a5689f4a33dcfda2a896f21b8c /indra/newview/llconversationlog.h | |
parent | a3f2cacf542e1d770698ef6c7e6ea1c0a5cd3368 (diff) | |
parent | e7eced3c87310b15ac20cc3cd470d67686104a14 (diff) |
Merge commit 'e7eced3' into release/luau-scripting: whitespace fix.
Diffstat (limited to 'indra/newview/llconversationlog.h')
-rw-r--r-- | indra/newview/llconversationlog.h | 256 |
1 files changed, 128 insertions, 128 deletions
diff --git a/indra/newview/llconversationlog.h b/indra/newview/llconversationlog.h index 54aeedcf9a..5d6b57233f 100644 --- a/indra/newview/llconversationlog.h +++ b/indra/newview/llconversationlog.h @@ -43,61 +43,61 @@ class LLConversation { public: - LLConversation(const ConversationParams& params); - LLConversation(const LLIMModel::LLIMSession& session); - LLConversation(const LLConversation& conversation); - - ~LLConversation(); - - const SessionType& getConversationType() const { return mConversationType; } - const std::string& getConversationName() const { return mConversationName; } - const std::string& getHistoryFileName() const { return mHistoryFileName; } - const LLUUID& getSessionID() const { return mSessionID; } - const LLUUID& getParticipantID() const { return mParticipantID; } - const std::string& getTimestamp() const { return mTimestamp; } - const U64Seconds& - getTime() const { return mTime; } - bool hasOfflineMessages() const { return mHasOfflineIMs; } - - void setConversationName(const std::string &conv_name) { mConversationName = conv_name; } - void setOfflineMessages(bool new_messages) { mHasOfflineIMs = new_messages; } - bool isOlderThan(U32Days days) const; - - /* - * updates last interaction time - */ - void updateTimestamp(); + LLConversation(const ConversationParams& params); + LLConversation(const LLIMModel::LLIMSession& session); + LLConversation(const LLConversation& conversation); + + ~LLConversation(); + + const SessionType& getConversationType() const { return mConversationType; } + const std::string& getConversationName() const { return mConversationName; } + const std::string& getHistoryFileName() const { return mHistoryFileName; } + const LLUUID& getSessionID() const { return mSessionID; } + const LLUUID& getParticipantID() const { return mParticipantID; } + const std::string& getTimestamp() const { return mTimestamp; } + const U64Seconds& + getTime() const { return mTime; } + bool hasOfflineMessages() const { return mHasOfflineIMs; } + + void setConversationName(const std::string &conv_name) { mConversationName = conv_name; } + void setOfflineMessages(bool new_messages) { mHasOfflineIMs = new_messages; } + bool isOlderThan(U32Days days) const; + + /* + * updates last interaction time + */ + void updateTimestamp(); void updateHistoryFileName(const std::string &new_name) { mHistoryFileName = new_name; } - /* - * Resets flag of unread offline message to false when im floater with this conversation is opened. - */ - void onIMFloaterShown(const LLUUID& session_id); + /* + * Resets flag of unread offline message to false when im floater with this conversation is opened. + */ + void onIMFloaterShown(const LLUUID& session_id); - /* - * returns string representation(in form of: mm/dd/yyyy hh:mm) of time when conversation was started - */ - static const std::string createTimestamp(const U64Seconds& utc_time); + /* + * returns string representation(in form of: mm/dd/yyyy hh:mm) of time when conversation was started + */ + static const std::string createTimestamp(const U64Seconds& utc_time); private: - /* - * If conversation has unread offline messages sets callback for opening LLFloaterIMSession - * with this conversation. - */ - void setListenIMFloaterOpened(); - - boost::signals2::connection mIMFloaterShowedConnection; - - U64Seconds mTime; // last interaction time - SessionType mConversationType; - std::string mConversationName; - std::string mHistoryFileName; - LLUUID mSessionID; - LLUUID mParticipantID; - bool mHasOfflineIMs; - std::string mTimestamp; // last interaction time in form of: mm/dd/yyyy hh:mm + /* + * If conversation has unread offline messages sets callback for opening LLFloaterIMSession + * with this conversation. + */ + void setListenIMFloaterOpened(); + + boost::signals2::connection mIMFloaterShowedConnection; + + U64Seconds mTime; // last interaction time + SessionType mConversationType; + std::string mConversationName; + std::string mHistoryFileName; + LLUUID mSessionID; + LLUUID mParticipantID; + bool mHasOfflineIMs; + std::string mTimestamp; // last interaction time in form of: mm/dd/yyyy hh:mm }; /** @@ -111,116 +111,116 @@ private: class LLConversationLog : public LLSingleton<LLConversationLog>, LLIMSessionObserver { - LLSINGLETON(LLConversationLog); + LLSINGLETON(LLConversationLog); public: - void removeConversation(const LLConversation& conversation); + void removeConversation(const LLConversation& conversation); - /** - * Returns first conversation with matched session_id - */ - const LLConversation* getConversation(const LLUUID& session_id); - const std::vector<LLConversation>& getConversations() { return mConversations; } + /** + * Returns first conversation with matched session_id + */ + const LLConversation* getConversation(const LLUUID& session_id); + const std::vector<LLConversation>& getConversations() { return mConversations; } - void addObserver(LLConversationLogObserver* observer); - void removeObserver(LLConversationLogObserver* observer); + void addObserver(LLConversationLogObserver* observer); + void removeObserver(LLConversationLogObserver* observer); - // LLIMSessionObserver triggers - virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id, BOOL has_offline_msg) override; + // LLIMSessionObserver triggers + virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id, BOOL has_offline_msg) override; virtual void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) override {}; // Stub - virtual void sessionRemoved(const LLUUID& session_id) override{} // Stub - virtual void sessionVoiceOrIMStarted(const LLUUID& session_id) override{}; // Stub - virtual void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) override{}; // Stub + virtual void sessionRemoved(const LLUUID& session_id) override{} // Stub + virtual void sessionVoiceOrIMStarted(const LLUUID& session_id) override{}; // Stub + virtual void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) override{}; // Stub - void notifyObservers(); + void notifyObservers(); - void onNewMessageReceived(const LLSD& data); + void onNewMessageReceived(const LLSD& data); - /** - * public method which is called on viewer exit to save conversation log - */ - void cache(); + /** + * public method which is called on viewer exit to save conversation log + */ + void cache(); // will check if current name is edentical with the one on disk and will rename the one on disk if it isn't - void verifyFilename(const LLUUID& session_id, const std::string &expected_filename, const std::string &new_session_name); - bool moveLog(const std::string &originDirectory, const std::string &targetDirectory); - void getListOfBackupLogs(std::vector<std::string>& list_of_backup_logs); - void deleteBackupLogs(); - - void onClearLog(); - void onClearLogResponse(const LLSD& notification, const LLSD& response); - - bool getIsLoggingEnabled() { return mLoggingEnabled; } - bool isLogEmpty() { return mConversations.empty(); } - - /** - * inits connection to per account settings, - * loads saved file and inits enabled state - */ - void initLoggingState(); - - /** - * constructs file name in which conversations log will be saved - * file name is conversation.log - */ - std::string getFileName(); - LLConversation* findConversation(const LLIMModel::LLIMSession* session); + void verifyFilename(const LLUUID& session_id, const std::string &expected_filename, const std::string &new_session_name); + bool moveLog(const std::string &originDirectory, const std::string &targetDirectory); + void getListOfBackupLogs(std::vector<std::string>& list_of_backup_logs); + void deleteBackupLogs(); + + void onClearLog(); + void onClearLogResponse(const LLSD& notification, const LLSD& response); + + bool getIsLoggingEnabled() { return mLoggingEnabled; } + bool isLogEmpty() { return mConversations.empty(); } + + /** + * inits connection to per account settings, + * loads saved file and inits enabled state + */ + void initLoggingState(); + + /** + * constructs file name in which conversations log will be saved + * file name is conversation.log + */ + std::string getFileName(); + LLConversation* findConversation(const LLIMModel::LLIMSession* session); private: - virtual ~LLConversationLog() - { - if (mAvatarNameCacheConnection.connected()) - { - mAvatarNameCacheConnection.disconnect(); - } - } - - void enableLogging(S32 log_mode); + virtual ~LLConversationLog() + { + if (mAvatarNameCacheConnection.connected()) + { + mAvatarNameCacheConnection.disconnect(); + } + } - /** - * adds conversation to the conversation list and notifies observers - */ - void logConversation(const LLUUID& session_id, BOOL has_offline_msg); + void enableLogging(S32 log_mode); - void notifyParticularConversationObservers(const LLUUID& session_id, U32 mask); + /** + * adds conversation to the conversation list and notifies observers + */ + void logConversation(const LLUUID& session_id, BOOL has_offline_msg); - bool saveToFile(const std::string& filename); - bool loadFromFile(const std::string& filename); + void notifyParticularConversationObservers(const LLUUID& session_id, U32 mask); - void onAvatarNameCache(const LLUUID& participant_id, const LLAvatarName& av_name, const LLIMModel::LLIMSession* session); + bool saveToFile(const std::string& filename); + bool loadFromFile(const std::string& filename); - void createConversation(const LLIMModel::LLIMSession* session); - void updateConversationTimestamp(LLConversation* conversation); - void updateConversationName(const LLIMModel::LLIMSession* session, const std::string& name); - void updateOfflineIMs(const LLIMModel::LLIMSession* session, BOOL new_messages); + void onAvatarNameCache(const LLUUID& participant_id, const LLAvatarName& av_name, const LLIMModel::LLIMSession* session); + void createConversation(const LLIMModel::LLIMSession* session); + void updateConversationTimestamp(LLConversation* conversation); + void updateConversationName(const LLIMModel::LLIMSession* session, const std::string& name); + void updateOfflineIMs(const LLIMModel::LLIMSession* session, BOOL new_messages); - typedef std::vector<LLConversation> conversations_vec_t; - std::vector<LLConversation> mConversations; - std::set<LLConversationLogObserver*> mObservers; - LLFriendObserver* mFriendObserver; // Observer of the LLAvatarTracker instance + typedef std::vector<LLConversation> conversations_vec_t; + std::vector<LLConversation> mConversations; + std::set<LLConversationLogObserver*> mObservers; - boost::signals2::connection mNewMessageSignalConnection; - boost::signals2::connection mAvatarNameCacheConnection; + LLFriendObserver* mFriendObserver; // Observer of the LLAvatarTracker instance - bool mLoggingEnabled; + boost::signals2::connection mNewMessageSignalConnection; + boost::signals2::connection mAvatarNameCacheConnection; + + bool mLoggingEnabled; }; class LLConversationLogObserver { public: - enum EConversationChange - { - CHANGED_TIME = 1, // last interaction time changed - CHANGED_NAME = 2, // conversation name changed - CHANGED_OfflineIMs = 3 - }; + enum EConversationChange + { + CHANGED_TIME = 1, // last interaction time changed + CHANGED_NAME = 2, // conversation name changed + CHANGED_OfflineIMs = 3 + }; - virtual ~LLConversationLogObserver(){} - virtual void changed() = 0; - virtual void changed(const LLUUID& session_id, U32 mask){}; + virtual ~LLConversationLogObserver(){} + virtual void changed() = 0; + virtual void changed(const LLUUID& session_id, U32 mask){}; }; #endif /* LLCONVERSATIONLOG_H_ */ |