From b544e125a4015550faf274904ac6d049e5fe5760 Mon Sep 17 00:00:00 2001 From: Igor Borovkov <iborovkov@productengine.com> Date: Mon, 26 Oct 2009 08:16:20 +0200 Subject: IM minor refactoring: removed unused LLIMMgr::isIMSessionOpen(...) - duplicate of LLIMMgr::hasSession(...) --HG-- branch : product-engine --- indra/newview/llimview.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/newview/llimview.h') diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 68beb29034..79513fb7d5 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -200,11 +200,6 @@ public: void addSystemMessage(const LLUUID& session_id, const std::string& message_name, const LLSD& args); - // This method returns TRUE if the local viewer has a session - // currently open keyed to the uuid. The uuid can be keyed by - // either session id or agent id. - BOOL isIMSessionOpen(const LLUUID& uuid); - // This adds a session to the talk view. The name is the local // name of the session, dialog specifies the type of // session. Since sessions can be keyed off of first recipient or -- cgit v1.2.3 From e018754f7e94be57dec9f7f8c341caa39643c277 Mon Sep 17 00:00:00 2001 From: Igor Borovkov <iborovkov@productengine.com> Date: Mon, 26 Oct 2009 13:05:08 +0200 Subject: IM: removed unused & empty methods and classes, added TODO marks --HG-- branch : product-engine --- indra/newview/llimview.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'indra/newview/llimview.h') diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 79513fb7d5..6991017e8f 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -183,7 +183,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 +245,6 @@ public: void processIMTypingStart(const LLIMInfo* im_info); void processIMTypingStop(const LLIMInfo* im_info); - // Rebuild stuff - void refresh(); - void notifyNewIM(); void clearNewIMNotification(); @@ -263,10 +260,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 +278,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 *); @@ -335,8 +329,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; -- cgit v1.2.3 From d81b8884109cbeacf211282b0a08aa3aea425294 Mon Sep 17 00:00:00 2001 From: Igor Borovkov <iborovkov@productengine.com> Date: Mon, 26 Oct 2009 16:41:47 +0200 Subject: IM: fixed remove session logic, got rid of "being session removed" field --HG-- branch : product-engine --- indra/newview/llimview.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'indra/newview/llimview.h') diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 6991017e8f..5ba54d30c3 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -297,10 +297,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 @@ -341,9 +342,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 -- cgit v1.2.3 From e931d2d6f1a7d981bebf07b1d089fa4751096830 Mon Sep 17 00:00:00 2001 From: Igor Borovkov <iborovkov@productengine.com> Date: Mon, 26 Oct 2009 17:33:28 +0200 Subject: IM refac.: replaced passing copies by passing references, moved some IMModel private, added documentation --HG-- branch : product-engine --- indra/newview/llimview.h | 48 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 9 deletions(-) (limited to 'indra/newview/llimview.h') diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 5ba54d30c3..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 -- cgit v1.2.3 From bfc9445563c5ad200ed609bc8ff3edecb2398d28 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi <emutavchi@productengine.com> Date: Tue, 27 Oct 2009 14:29:18 +0200 Subject: Implemented major task EXT-1717 (IM related server responses processing stuff should use new IM floater along with the old one) sub-task of EXT-96 (Viewer 2009: Group IM detail). --HG-- branch : product-engine --- indra/newview/llimview.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/llimview.h') diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index e3d0a50557..87ec429195 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -314,6 +314,12 @@ public: void addSessionObserver(LLIMSessionObserver *); void removeSessionObserver(LLIMSessionObserver *); + //show error statuses to the user + void showSessionStartError(const std::string& error_string, const LLUUID session_id); + void showSessionEventError(const std::string& event_string, const std::string& error_string, const LLUUID session_id); + void showSessionForceClose(const std::string& reason, const LLUUID session_id); + static bool onConfirmForceCloseError(const LLSD& notification, const LLSD& response); + /** * Start call in a session * @return false if voice channel doesn't exist -- cgit v1.2.3 From 3eb7f84b10832d77d8765ea9550108c67c462bcb Mon Sep 17 00:00:00 2001 From: Igor Borovkov <iborovkov@productengine.com> Date: Tue, 27 Oct 2009 18:01:41 +0200 Subject: IM: implemented task EXT-1905 (Add "Call" and "End Call" functionality to new IIM Floater) --HG-- branch : product-engine --- indra/newview/llimview.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llimview.h') diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index e3d0a50557..f83520af82 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -70,6 +70,10 @@ public: LLIMSpeakerMgr* mSpeakers; bool mSessionInitialized; + + //true if calling back the session URI after the session has closed is possible. + //Currently this will be false only for PSTN P2P calls. + bool mCallBackEnabled; }; -- cgit v1.2.3 From a999e50a8ebb3ab641490294d67dbbd6eb0c8898 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi <emutavchi@productengine.com> Date: Wed, 28 Oct 2009 16:14:52 +0200 Subject: Implemented major sub-task EXT-1912 ( Add handling restrictions of PSTN P2P calls in new IM Floaters ) --HG-- branch : product-engine --- indra/newview/llimview.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llimview.h') diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index f09c5a9521..80b54d7ef0 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -74,6 +74,9 @@ public: //true if calling back the session URI after the session has closed is possible. //Currently this will be false only for PSTN P2P calls. bool mCallBackEnabled; + + bool mTextIMPossible; + bool mProfileButtonEnabled; }; -- cgit v1.2.3 From 86921724c438e31957bc803695054bba80645df4 Mon Sep 17 00:00:00 2001 From: Igor Borovkov <iborovkov@productengine.com> Date: Wed, 28 Oct 2009 18:31:43 +0200 Subject: IM refactoring: moved speakers management stuff in its own files llspeakers.* from dying llfloateractivespeakers. * Decresed number of llfloateractivespeakers.h includes to a minimum. --HG-- branch : product-engine --- indra/newview/llimview.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llimview.h') diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 80b54d7ef0..8c2ca149a6 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -34,7 +34,7 @@ #define LL_LLIMVIEW_H #include "lldarray.h" -#include "llfloateractivespeakers.h" //for LLIMSpeakerMgr +#include "llspeakers.h" //for LLIMSpeakerMgr #include "llimpanel.h" //for voice channels #include "llmodaldialog.h" #include "llinstantmessage.h" -- cgit v1.2.3 From 4ca9e28f91446c2da413cc1089105278b60c8453 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi <emutavchi@productengine.com> Date: Wed, 28 Oct 2009 18:44:31 +0200 Subject: No ticket, just renamed mProfileButtonEnabled to mOtherParticipantIsAvatar --HG-- branch : product-engine --- indra/newview/llimview.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llimview.h') diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 8c2ca149a6..ae8fd355ea 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -76,7 +76,7 @@ public: bool mCallBackEnabled; bool mTextIMPossible; - bool mProfileButtonEnabled; + bool mOtherParticipantIsAvatar; }; -- cgit v1.2.3 From e724fa0ab4c4675b94546f67bd4323704201f4a6 Mon Sep 17 00:00:00 2001 From: Sergey Borushevsky <sborushevsky@productengine.com> Date: Thu, 29 Oct 2009 20:26:56 +0200 Subject: Implemented major task EXT-1487 (Reimplement chat history persistence using LLSD serialization). Moved loading of IM history from LLIMFloater and LLFloaterIMPanel to LLModel::LLIMSession. Implemented disabling of saving logs if it's disabled in Preferences. --HG-- branch : product-engine --- indra/newview/llimview.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llimview.h') diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index ae8fd355ea..d0bd594df1 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -40,6 +40,7 @@ #include "llinstantmessage.h" #include "lluuid.h" #include "llmultifloater.h" +#include "lllogchat.h" class LLFloaterChatterBox; class LLUUID; @@ -57,6 +58,8 @@ public: virtual ~LLIMSession(); void sessionInitReplyReceived(const LLUUID& new_session_id); + void addMessage(const std::string& from, const LLUUID& from_id, const std::string& utf8_text, const std::string& time); + static void chatFromLogFile(LLLogChat::ELogLineType type, const LLSD& msg, void* userdata); LLUUID mSessionID; std::string mName; @@ -193,8 +196,7 @@ private: /** * 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); + bool logToFile(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text); }; class LLIMSessionObserver -- cgit v1.2.3