summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.h
diff options
context:
space:
mode:
authorAndrew Dyukov <adyukov@productengine.com>2009-10-26 19:33:38 +0200
committerAndrew Dyukov <adyukov@productengine.com>2009-10-26 19:33:38 +0200
commit33c1be212afb3cf36a80c1fadb6aa9e55670c8ff (patch)
tree781b568c805c82c152bc4808b747eaaec92419da /indra/newview/llimview.h
parentff37134a405e81899b4d9e7d07be7e3da85c8278 (diff)
parent1d4d4fec00aacb1e1e00a4f60a6af4d8ed3b8bde (diff)
merge
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llimview.h')
-rw-r--r--indra/newview/llimview.h73
1 files changed, 48 insertions, 25 deletions
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index 79513fb7d5..e3d0a50557 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -104,18 +104,35 @@ public:
boost::signals2::connection addNewMsgCallback( session_callback_t cb ) { return mNewMsgSignal.connect(cb); }
boost::signals2::connection addNoUnreadMsgsCallback( session_callback_t cb ) { return mNoUnreadMsgsSignal.connect(cb); }
- bool newSession(LLUUID session_id, std::string name, EInstantMessage type, LLUUID other_participant_id,
+ /**
+ * Create new session object in a model
+ */
+ bool newSession(const LLUUID& session_id, const std::string& name, const EInstantMessage& type, const LLUUID& other_participant_id,
const std::vector<LLUUID>& ids = std::vector<LLUUID>());
- bool clearSession(LLUUID session_id);
- 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 log2file = true);
- bool addToHistory(LLUUID session_id, std::string from, LLUUID from_id, std::string utf8_text);
+ /**
+ * Remove all session data associated with a session specified by session_id
+ */
+ bool clearSession(const LLUUID& session_id);
- bool logToFile(const LLUUID& session_id, const std::string& from, const std::string& utf8_text);
+ /**
+ * Populate supplied std::list with messages starting from index specified by start_index
+ */
+ void getMessages(const LLUUID& session_id, std::list<LLSD>& messages, int start_index = 0);
- //used to get the name of the session, for use as the title
- //currently just the other avatar name
+ /**
+ * Add a message to an IM Model - the message is saved in a message store associated with a session specified by session_id
+ * 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);
+
+ /**
+ * 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 ad-hoc chat - is received from the server and is in a from of "<Avatar's name> conference"
+ */
const std::string& getName(const LLUUID& session_id) const;
/**
@@ -150,7 +167,7 @@ public:
*/
LLIMSpeakerMgr* getSpeakerManager(const LLUUID& session_id) const;
- static void sendLeaveSession(LLUUID session_id, LLUUID other_participant_id);
+ static void sendLeaveSession(const LLUUID& session_id, const 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);
@@ -158,6 +175,19 @@ public:
const LLUUID& other_participant_id, EInstantMessage dialog);
void testMessages();
+
+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);
+
+ /**
+ * Save an IM message into a file
+ */
+ //*TODO should also save uuid of a sender
+ bool logToFile(const LLUUID& session_id, const std::string& from, const std::string& utf8_text);
};
class LLIMSessionObserver
@@ -183,7 +213,7 @@ public:
};
LLIMMgr();
- virtual ~LLIMMgr();
+ virtual ~LLIMMgr() {};
// Add a message to a session. The session can keyed to sesion id
// or agent id.
@@ -245,9 +275,6 @@ public:
void processIMTypingStart(const LLIMInfo* im_info);
void processIMTypingStop(const LLIMInfo* im_info);
- // Rebuild stuff
- void refresh();
-
void notifyNewIM();
void clearNewIMNotification();
@@ -263,10 +290,6 @@ public:
// good connection.
void disconnectAllSessions();
- // This is a helper function to determine what kind of im session
- // should be used for the given agent.
- static EInstantMessage defaultIMTypeForAgent(const LLUUID& agent_id);
-
BOOL hasSession(const LLUUID& session_id);
// This method returns the im panel corresponding to the uuid
@@ -285,6 +308,7 @@ public:
void clearPendingAgentListUpdates(const LLUUID& session_id);
//HACK: need a better way of enumerating existing session, or listening to session create/destroy events
+ //@deprecated, is used only by LLToolBox, which is not used anywhere, right? (IB)
const std::set<LLHandle<LLFloater> >& getIMFloaterHandles() { return mFloaters; }
void addSessionObserver(LLIMSessionObserver *);
@@ -303,10 +327,11 @@ public:
bool endCall(const LLUUID& session_id);
private:
- // This removes the panel referenced by the uuid, and then
- // restores internal consistency. The internal pointer is not
- // deleted.
- void removeSession(LLUUID session_id);
+
+ /**
+ * Remove data associated with a particular session specified by session_id
+ */
+ void removeSession(const LLUUID& session_id);
// create a panel and update internal representation for
// consistency. Returns the pointer, caller (the class instance
@@ -335,8 +360,9 @@ private:
void notifyObserverSessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id);
private:
+
+ //*TODO should be deleted when Communicate Floater is being deleted
std::set<LLHandle<LLFloater> > mFloaters;
- LLFriendObserver* mFriendObserver;
typedef std::list <LLIMSessionObserver *> session_observers_list_t;
session_observers_list_t mSessionObservers;
@@ -346,9 +372,6 @@ private:
LLSD mPendingInvitations;
LLSD mPendingAgentListUpdates;
- // ID of a session that is being removed: observers are already told
- // that this session is being removed, but it is still present in the sessions' map
- LLUUID mBeingRemovedSessionID;
};
class LLIncomingCallDialog : public LLModalDialog