diff options
Diffstat (limited to 'indra/newview/llimview.h')
-rw-r--r-- | indra/newview/llimview.h | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index d98b5ca297..f9db6d8ed2 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -75,10 +75,20 @@ public: LLIMModel(); + + //we should control the currently active session + LLUUID mActiveSessionID; + void setActiveSessionID(const LLUUID& session_id); + void resetActiveSessionID() { mActiveSessionID.setNull(); } + LLUUID getActiveSessionID() { return mActiveSessionID; } + //*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; + typedef boost::signals2::signal<void(const LLSD&)> session_signal_t; + typedef boost::function<void(const LLSD&)> session_callback_t; + session_signal_t mNewMsgSignal; + session_signal_t mNoUnreadMsgsSignal; /** * Find an IM Session corresponding to session_id @@ -91,7 +101,8 @@ public: */ void updateSessionID(const LLUUID& old_session_id, const LLUUID& new_session_id); - boost::signals2::connection addChangedCallback( boost::function<void (const LLSD& data)> cb ); + 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, const std::vector<LLUUID>& ids = std::vector<LLUUID>()); @@ -219,10 +230,12 @@ public: const std::string& voice_session_handle, const std::string& caller_uri = LLStringUtil::null); - // This removes the panel referenced by the uuid, and then - // restores internal consistency. The internal pointer is not - // deleted. - void removeSession(LLUUID session_id); + /** + * Leave the session with session id. Send leave session notification + * to the server and removes all associated session data + * @return false if the session with specified id was not exist + */ + bool leaveSession(const LLUUID& session_id); void inviteToSession( const LLUUID& session_id, @@ -295,6 +308,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); + // create a panel and update internal representation for // consistency. Returns the pointer, caller (the class instance // since it is a private method) is not responsible for deleting |