summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llimview.h')
-rw-r--r--indra/newview/llimview.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index 37dcd1593f..b3b821f2ac 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -38,6 +38,7 @@
#include "llinstantmessage.h"
#include "lluuid.h"
#include "llmultifloater.h"
+#include "llrecentpeople.h"
class LLFloaterChatterBox;
class LLUUID;
@@ -45,6 +46,47 @@ class LLFloaterIMPanel;
class LLFriendObserver;
class LLFloaterIM;
+class LLIMModel : public LLSingleton<LLIMModel>
+{
+public:
+
+ struct LLIMSession
+ {
+ LLIMSession(std::string name, EInstantMessage type, LLUUID other_participant_id)
+ :mName(name), mType(type), mNumUnread(0), mOtherParticipantID(other_participant_id) {}
+
+ std::string mName;
+ EInstantMessage mType;
+ LLUUID mOtherParticipantID;
+ S32 mNumUnread;
+ std::list<LLSD> mMsgs;
+ };
+
+
+ LLIMModel();
+
+ static std::map<LLUUID, LLIMSession*> sSessionsMap; //mapping session_id to session
+ boost::signals2::signal<void(const LLSD&)> mChangedSignal;
+ 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);
+ std::list<LLSD> getMessages(LLUUID session_id, int start_index = 0);
+ bool addMessage(LLUUID session_id, std::string from, 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);
+
+ 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);
+ static void sendTypingState(LLUUID session_id, LLUUID other_participant_id, BOOL typing);
+ static void sendMessage(const std::string& utf8_text, const LLUUID& im_session_id,
+ const LLUUID& other_participant_id, EInstantMessage dialog);
+
+ void testMessages();
+};
+
class LLIMSessionObserver
{
public:
@@ -53,8 +95,11 @@ public:
virtual void sessionRemoved(const LLUUID& session_id) = 0;
};
+
class LLIMMgr : public LLSingleton<LLIMMgr>
{
+ friend class LLIMModel;
+
public:
enum EInvitationType
{