summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.h
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-10-01 17:44:44 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-10-01 17:44:44 +0000
commitf05df68656d2abdc38d86cd6746398fa90eb8614 (patch)
tree95f389551a7132b86dd96ff7c55b92674ee16756 /indra/newview/llimview.h
parent090977608d3d4e1d6d26689064910221c66f6084 (diff)
merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1868 https://svn.aws.productengine.com/secondlife/pe/stable-2@1876 -> viewer-2.0.0-3
* Bugs: EXT-1111 EXT-915 EXT-1131 EXT-1200 EXT-1202 EXT-1201 EXT-1205 EXT-1212 EXT-1173 EXT-1229 EXT-1218 EXT-1164 EXT-996 EXT-821 EXT-1030 EXT-1031 EXT-816 * Major Bugs: EXT-1142 (timeout during login due to processing group IMs) * Changes: EXT-1216 (minimize message well)
Diffstat (limited to 'indra/newview/llimview.h')
-rw-r--r--indra/newview/llimview.h67
1 files changed, 60 insertions, 7 deletions
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index 219af0705d..9a94d01bb2 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -34,6 +34,8 @@
#define LL_LLIMVIEW_H
#include "lldarray.h"
+#include "llfloateractivespeakers.h" //for LLIMSpeakerMgr
+#include "llimpanel.h" //for voice channels
#include "llmodaldialog.h"
#include "llinstantmessage.h"
#include "lluuid.h"
@@ -50,21 +52,40 @@ public:
struct LLIMSession
{
- LLIMSession(std::string name, EInstantMessage type, LLUUID other_participant_id)
- :mName(name), mType(type), mNumUnread(0), mOtherParticipantID(other_participant_id) {}
-
+ LLIMSession(const LLUUID& session_id, const std::string& name,
+ const EInstantMessage& type, const LLUUID& other_participant_id);
+ virtual ~LLIMSession();
+
+ LLUUID mSessionID;
std::string mName;
EInstantMessage mType;
LLUUID mOtherParticipantID;
S32 mNumUnread;
std::list<LLSD> mMsgs;
+
+ LLVoiceChannel* mVoiceChannel;
+ LLIMSpeakerMgr* mSpeakers;
};
LLIMModel();
+ //*TODO make it non-static as LLIMMOdel is a singleton (IB)
static std::map<LLUUID, LLIMSession*> sSessionsMap; //mapping session_id to session
+
boost::signals2::signal<void(const LLSD&)> mChangedSignal;
+
+ /**
+ * Find an IM Session corresponding to session_id
+ * Returns NULL if the session does not exist
+ */
+ LLIMSession* findIMSession(const LLUUID& session_id) const;
+
+ /**
+ * Rebind session data to a new session id.
+ */
+ void updateSessionID(const LLUUID& old_session_id, const LLUUID& new_session_id);
+
boost::signals2::connection addChangedCallback( boost::function<void (const LLSD& data)> cb );
bool newSession(LLUUID session_id, std::string name, EInstantMessage type, LLUUID other_participant_id);
@@ -72,10 +93,42 @@ public:
std::list<LLSD> getMessages(LLUUID session_id, int start_index = 0);
bool addMessage(LLUUID session_id, std::string from, LLUUID other_participant_id, std::string utf8_text);
bool addToHistory(LLUUID session_id, std::string from, std::string utf8_text);
- //used to get the name of the session, for use as the title
- //currently just the other avatar name
- const std::string& getName(LLUUID session_id);
-
+ //used to get the name of the session, for use as the title
+ //currently just the other avatar name
+ 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
+ */
+ const S32 getNumUnread(const LLUUID& session_id) const;
+
+ /**
+ * Get uuid of other participant in a session with session_id
+ * Returns LLUUID::null if the session doesn't exist
+ *
+ * *TODO what to do with other participants in ad-hoc and group chats?
+ */
+ const LLUUID& getOtherParticipantID(const LLUUID& session_id) const;
+
+ /**
+ * Get type of a session specified by session_id
+ * Returns EInstantMessage::IM_COUNT if the session does not exist
+ */
+ EInstantMessage getType(const LLUUID& session_id) const;
+
+ /**
+ * Get voice channel for the session specified by session_id
+ * Returns NULL if the session does not exist
+ */
+ LLVoiceChannel* getVoiceChannel(const LLUUID& session_id) const;
+
+ /**
+ * Get im speaker manager for the session specified by session_id
+ * Returns NULL if the session does not exist
+ */
+ LLIMSpeakerMgr* getSpeakerManager(const LLUUID& session_id) const;
+
static void sendLeaveSession(LLUUID session_id, LLUUID other_participant_id);
static bool sendStartSession(const LLUUID& temp_session_id, const LLUUID& other_participant_id,
const std::vector<LLUUID>& ids, EInstantMessage dialog);