summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.h
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@geenzo.com>2023-03-31 10:54:22 -0700
committerJonathan "Geenz" Goodman <geenz@geenzo.com>2023-03-31 10:54:22 -0700
commit4e306c90666094a7450f4d6f3ed7c8b71527e393 (patch)
tree4e52cfe3cfc7df8060ec5336f53d91636986b43c /indra/newview/llimview.h
parentb44ad50f75724a5d9e53bd52d2724111568caf24 (diff)
parent7d144fcb2a1b0aff1b59e378c652649c3d03e94f (diff)
Merge branch 'DRTVWR-559' of https://github.com/secondlife/viewer into DRTVWR-559
Diffstat (limited to 'indra/newview/llimview.h')
-rw-r--r--indra/newview/llimview.h67
1 files changed, 49 insertions, 18 deletions
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index 326e8f22e3..946eb02f26 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -42,6 +42,7 @@ class LLAvatarName;
class LLFriendObserver;
class LLCallDialogManager;
class LLIMSpeakerMgr;
+
/**
* Timeout Timer for outgoing Ad-Hoc/Group IM sessions which being initialized by the server
*/
@@ -63,11 +64,14 @@ private:
class LLIMModel : public LLSingleton<LLIMModel>
{
LLSINGLETON(LLIMModel);
+
public:
- struct LLIMSession : public boost::signals2::trackable
+ typedef std::list<LLSD> chat_message_list_t;
+
+ struct LLIMSession : public boost::signals2::trackable
{
- typedef enum e_session_type
+ typedef enum e_session_type
{ // for now we have 4 predefined types for a session
P2P_SESSION,
GROUP_SESSION,
@@ -75,15 +79,23 @@ public:
NONE_SESSION,
} SType;
- LLIMSession(const LLUUID& session_id, const std::string& name,
+ LLIMSession(const LLUUID& session_id, const std::string& name,
const EInstantMessage& type, const LLUUID& other_participant_id, const uuid_vec_t& ids, bool voice, bool has_offline_msg);
virtual ~LLIMSession();
void sessionInitReplyReceived(const LLUUID& new_session_id);
- void addMessagesFromHistory(const std::list<LLSD>& history);
- void addMessage(const std::string& from, const LLUUID& from_id, const std::string& utf8_text, const std::string& time, const bool is_history = false, bool is_region_msg = false);
- void onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state, const LLVoiceChannel::EDirection& direction);
-
+ void addMessagesFromHistoryCache(const std::list<LLSD>& history); // From local file
+ void addMessagesFromServerHistory(const LLSD& history, const std::string& target_from, const std::string& target_message, U32 timestamp); // From chat server
+ void addMessage(const std::string& from,
+ const LLUUID& from_id,
+ const std::string& utf8_text,
+ const std::string& time,
+ const bool is_history,
+ const bool is_region_msg,
+ U32 timestamp);
+
+ void onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state, const LLVoiceChannel::EDirection& direction);
+
/** @deprecated */
static void chatFromLogFile(LLLogChat::ELogLineType type, const LLSD& msg, void* userdata);
@@ -112,6 +124,10 @@ public:
uuid_vec_t mInitialTargetIDs;
std::string mHistoryFileName;
+ // Saved messages from the last minute of history read from the local group chat cache file
+ std::string mLastHistoryCacheDateTime;
+ chat_message_list_t mLastHistoryCacheMsgs;
+
// connection to voice channel state change signal
boost::signals2::connection mVoiceChannelStateChangeConnection;
@@ -121,7 +137,7 @@ public:
// does include all incoming messages
S32 mNumUnread;
- std::list<LLSD> mMsgs;
+ chat_message_list_t mMsgs;
LLVoiceChannel* mVoiceChannel;
LLIMSpeakerMgr* mSpeakers;
@@ -208,29 +224,43 @@ public:
* and also saved into a file if log2file is specified.
* It sends new message signal for each added message.
*/
- bool addMessage(const LLUUID& session_id, const std::string& from, const LLUUID& other_participant_id, const std::string& utf8_text, bool log2file = true, bool is_region_msg = false);
+ void addMessage(const LLUUID& session_id,
+ const std::string& from,
+ const LLUUID& other_participant_id,
+ const std::string& utf8_text,
+ bool log2file = true,
+ bool is_region_msg = false,
+ U32 time_stamp = 0);
+
+ void processAddingMessage(const LLUUID& session_id,
+ const std::string& from,
+ const LLUUID& from_id,
+ const std::string& utf8_text,
+ bool log2file,
+ bool is_region_msg,
+ U32 time_stamp);
/**
* Similar to addMessage(...) above but won't send a signal about a new message added
*/
- LLIMModel::LLIMSession* addMessageSilently(const LLUUID& session_id, const std::string& from, const LLUUID& from_id,
- const std::string& utf8_text, bool log2file = true, bool is_region_msg = false);
+ LLIMModel::LLIMSession* addMessageSilently(const LLUUID& session_id, const std::string& from, const LLUUID& from_id,
+ const std::string& utf8_text, bool log2file = true, bool is_region_msg = false, U32 timestamp = 0);
/**
* Add a system message to an IM Model
*/
- bool proccessOnlineOfflineNotification(const LLUUID& session_id, const std::string& utf8_text);
+ void proccessOnlineOfflineNotification(const LLUUID& session_id, const std::string& utf8_text);
/**
- * Get a session's name.
- * For a P2P chat - it's an avatar's name,
+ * Get a session's name.
+ * For a P2P chat - it's an avatar's name,
* For a group chat - it's a group's name
* For an incoming ad-hoc chat - is received from the server and is in a from of "<Avatar's name> Conference"
* It is updated in LLIMModel::LLIMSession's constructor to localize the "Conference".
*/
const std::string getName(const LLUUID& session_id) const;
- /**
+ /**
* Get number of unread messages in a session with session_id
* Returns -1 if the session with session_id doesn't exist
*/
@@ -282,7 +312,7 @@ public:
bool logToFile(const std::string& file_name, const std::string& from, const LLUUID& from_id, const std::string& utf8_text);
private:
-
+
/**
* Populate supplied std::list with messages starting from index specified by start_index without
* emitting no unread messages signal.
@@ -292,7 +322,7 @@ private:
/**
* Add message to a list of message associated with session specified by session_id
*/
- bool addToHistory(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text, bool is_region_msg = false);
+ bool addToHistory(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text, bool is_region_msg, U32 timestamp);
};
@@ -334,7 +364,8 @@ public:
U32 parent_estate_id = 0,
const LLUUID& region_id = LLUUID::null,
const LLVector3& position = LLVector3::zero,
- bool is_region_msg = false);
+ bool is_region_msg = false,
+ U32 timestamp = 0);
void addSystemMessage(const LLUUID& session_id, const std::string& message_name, const LLSD& args);