From f22f829b8642d59cb5953eb33f5297a1da90fadd Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Mon, 26 Oct 2009 17:14:32 +0200 Subject: Fixed normal bugs EXT-1628 ([BSI] - New IM system isn't sending typing notifications anymore) and EXT-1629 ([BSI] - add hint in IM window when Resident is typing) --HG-- branch : product-engine --- indra/newview/llimfloater.cpp | 135 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 129 insertions(+), 6 deletions(-) (limited to 'indra/newview/llimfloater.cpp') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index a20b5ea66c..97af96847c 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -61,7 +61,14 @@ LLIMFloater::LLIMFloater(const LLUUID& session_id) mLastMessageIndex(-1), mDialog(IM_NOTHING_SPECIAL), mChatHistory(NULL), - mInputEditor(NULL), + mInputEditor(NULL), + mSavedTitle(), + mTypingStart(), + mShouldSendTypingState(false), + mMeTyping(false), + mOtherTyping(false), + mTypingTimer(), + mTypingTimeoutTimer(), mPositioned(false), mSessionInitialized(false) { @@ -95,6 +102,7 @@ void LLIMFloater::onFocusReceived() // virtual void LLIMFloater::onClose(bool app_quitting) { + setTyping(false); gIMMgr->leaveSession(mSessionID); } @@ -141,6 +149,7 @@ void LLIMFloater::onSendMsg( LLUICtrl* ctrl, void* userdata ) { LLIMFloater* self = (LLIMFloater*) userdata; self->sendMsg(); + self->setTyping(false); } void LLIMFloater::sendMsg() @@ -228,12 +237,27 @@ BOOL LLIMFloater::postBuild() LLLogChat::loadHistory(getTitle(), &chatFromLogFile, (void *)this); } + mTypingStart = LLTrans::getString("IM_typing_start_string"); + //*TODO if session is not initialized yet, add some sort of a warning message like "starting session...blablabla" //see LLFloaterIMPanel for how it is done (IB) return LLDockableFloater::postBuild(); } +// virtual +void LLIMFloater::draw() +{ + if ( mMeTyping ) + { + // Time out if user hasn't typed for a while. + if ( mTypingTimeoutTimer.getElapsedTimeF32() > LLAgent::TYPING_TIMEOUT_SECS ) + { + setTyping(false); + } + } + LLFloater::draw(); +} // static @@ -450,7 +474,7 @@ void LLIMFloater::onInputEditorFocusReceived( LLFocusableElement* caller, void* void LLIMFloater::onInputEditorFocusLost(LLFocusableElement* caller, void* userdata) { LLIMFloater* self = (LLIMFloater*) userdata; - self->setTyping(FALSE); + self->setTyping(false); } // static @@ -460,19 +484,118 @@ void LLIMFloater::onInputEditorKeystroke(LLLineEditor* caller, void* userdata) std::string text = self->mInputEditor->getText(); if (!text.empty()) { - self->setTyping(TRUE); + self->setTyping(true); } else { // Deleting all text counts as stopping typing. - self->setTyping(FALSE); + self->setTyping(false); + } +} + +void LLIMFloater::setTyping(bool typing) +{ + if ( typing ) + { + // Started or proceeded typing, reset the typing timeout timer + mTypingTimeoutTimer.reset(); + } + + if ( mMeTyping != typing ) + { + // Typing state is changed + mMeTyping = typing; + // So, should send current state + mShouldSendTypingState = true; + // In case typing is started, send state after some delay + mTypingTimer.reset(); + } + + // Don't want to send typing indicators to multiple people, potentially too + // much network traffic. Only send in person-to-person IMs. + if ( mShouldSendTypingState && mDialog == IM_NOTHING_SPECIAL ) + { + if ( mMeTyping ) + { + if ( mTypingTimer.getElapsedTimeF32() > 1.f ) + { + // Still typing, send 'start typing' notification + LLIMModel::instance().sendTypingState(mSessionID, mOtherParticipantUUID, TRUE); + mShouldSendTypingState = false; + } + } + else + { + // Send 'stop typing' notification immediately + LLIMModel::instance().sendTypingState(mSessionID, mOtherParticipantUUID, FALSE); + mShouldSendTypingState = false; + } + } + + LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionID); + if (speaker_mgr) + speaker_mgr->setSpeakerTyping(gAgent.getID(), FALSE); + +} + +void LLIMFloater::processIMTyping(const LLIMInfo* im_info, BOOL typing) +{ + if ( typing ) + { + // other user started typing + addTypingIndicator(im_info); + } + else + { + // other user stopped typing + removeTypingIndicator(im_info); } } +void LLIMFloater::addTypingIndicator(const LLIMInfo* im_info) +{ + // We may have lost a "stop-typing" packet, don't add it twice + if ( im_info && !mOtherTyping ) + { + mOtherTyping = true; -//just a stub for now -void LLIMFloater::setTyping(BOOL typing) + // Create typing is started title string + LLUIString typing_start(mTypingStart); + typing_start.setArg("[NAME]", im_info->mName); + + // Save and set new title + mSavedTitle = getTitle(); + setTitle (typing_start); + + // Update speaker + LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionID); + if ( speaker_mgr ) + { + speaker_mgr->setSpeakerTyping(im_info->mFromID, TRUE); + } + } +} + +void LLIMFloater::removeTypingIndicator(const LLIMInfo* im_info) { + if ( mOtherTyping ) + { + mOtherTyping = false; + + // Revert the title to saved one + setTitle(mSavedTitle); + + if ( im_info ) + { + // Update speaker + LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionID); + if ( speaker_mgr ) + { + speaker_mgr->setSpeakerTyping(im_info->mFromID, FALSE); + } + } + + } } void LLIMFloater::chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata) -- cgit v1.2.3 From e931d2d6f1a7d981bebf07b1d089fa4751096830 Mon Sep 17 00:00:00 2001 From: Igor Borovkov 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/llimfloater.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llimfloater.cpp') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index a20b5ea66c..57e3fba3f5 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -402,7 +402,8 @@ void LLIMFloater::sessionInitReplyReceived(const LLUUID& im_session_id) void LLIMFloater::updateMessages() { - std::list messages = LLIMModel::instance().getMessages(mSessionID, mLastMessageIndex+1); + std::list messages; + LLIMModel::instance().getMessages(mSessionID, messages, mLastMessageIndex+1); std::string agent_name; gCacheName->getFullName(gAgentID, agent_name); -- cgit v1.2.3 From 62c8f55e3e49f55bc76dbcaba797ca02b3072c3f Mon Sep 17 00:00:00 2001 From: "Yuri Chebotarev ychebotarev@productengine.com" Date: Tue, 27 Oct 2009 11:28:46 +0200 Subject: working on EXT-1713,EXT-1712,EXT-1711,EXT-1709 EXT-1713 Nearby Chat: Objects have tooltips (???)(???) EXT-1712 Nearby Chat: change context menu for objects EXT-1711 Nearby Chat: context menu isn't applicable for system messages EXT-1709 Nearby Chat: Avatar context menu can be triggered on avatar's icon only initial commit - panel for message headers --HG-- branch : product-engine --- indra/newview/llimfloater.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llimfloater.cpp') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index a20b5ea66c..d0d176766d 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -428,7 +428,11 @@ void LLIMFloater::updateMessages() if (from == agent_name) from = LLTrans::getString("You"); - mChatHistory->appendWidgetMessage(from_id, from, time, message, style_params); + LLChat chat(message); + chat.mFromID = from_id; + chat.mFromName = from; + + mChatHistory->appendWidgetMessage(chat, style_params); mLastMessageIndex = msg["index"].asInteger(); } -- cgit v1.2.3 From 6222149487d7e241ad7b009dae1f2fa6f69adc5d Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Tue, 27 Oct 2009 13:16:44 +0200 Subject: IM refactoring: moved voice channel related classes to its own llvoicechannel.* files from dying llimpanel.* files --HG-- branch : product-engine --- indra/newview/llimfloater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llimfloater.cpp') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 91e383eb14..0e9d7b070a 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -42,7 +42,6 @@ #include "llchiclet.h" #include "llfloaterchat.h" #include "llfloaterreg.h" -#include "llimview.h" #include "lllineeditor.h" #include "lllogchat.h" #include "llpanelimcontrolpanel.h" @@ -50,6 +49,7 @@ #include "lltrans.h" #include "llchathistory.h" #include "llviewerwindow.h" +#include "llvoicechannel.h" #include "lltransientfloatermgr.h" -- cgit v1.2.3 From 3eb7f84b10832d77d8765ea9550108c67c462bcb Mon Sep 17 00:00:00 2001 From: Igor Borovkov 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/llimfloater.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview/llimfloater.cpp') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 0e9d7b070a..9e92e2f490 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -202,9 +202,10 @@ BOOL LLIMFloater::postBuild() if (other_party_id.notNull()) { mOtherParticipantUUID = other_party_id; - mControlPanel->setID(mOtherParticipantUUID); } + mControlPanel->setSessionId(mSessionID); + LLButton* slide_left = getChild("slide_left_btn"); slide_left->setVisible(mControlPanel->getVisible()); slide_left->setClickedCallback(boost::bind(&LLIMFloater::onSlide, this)); @@ -248,6 +249,8 @@ BOOL LLIMFloater::postBuild() // virtual void LLIMFloater::draw() { + + if ( mMeTyping ) { // Time out if user hasn't typed for a while. @@ -403,10 +406,12 @@ void LLIMFloater::sessionInitReplyReceived(const LLUUID& im_session_id) { mSessionInitialized = true; + //will be different only for an ad-hoc im session if (mSessionID != im_session_id) { mSessionID = im_session_id; setKey(im_session_id); + mControlPanel->setSessionId(im_session_id); } //*TODO here we should remove "starting session..." warning message if we added it in postBuild() (IB) -- cgit v1.2.3 From 33af464c441717db855651b70acc4b3636c649a0 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Wed, 28 Oct 2009 14:21:36 +0200 Subject: Implemented major sub-task EXT-1904 (New IM floater should handle Session Update) --HG-- branch : product-engine --- indra/newview/llimfloater.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'indra/newview/llimfloater.cpp') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 9e92e2f490..b8b0290b18 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -562,6 +562,30 @@ void LLIMFloater::processIMTyping(const LLIMInfo* im_info, BOOL typing) } } +void LLIMFloater::processSessionUpdate(const LLSD& session_update) +{ + // *TODO : verify following code when moderated mode will be implemented + if ( false && session_update.has("moderated_mode") && + session_update["moderated_mode"].has("voice") ) + { + BOOL voice_moderated = session_update["moderated_mode"]["voice"]; + const std::string session_label = LLIMModel::instance().getName(mSessionID); + + if (voice_moderated) + { + setTitle(session_label + std::string(" ") + LLTrans::getString("IM_moderated_chat_label")); + } + else + { + setTitle(session_label); + } + + // *TODO : uncomment this when/if LLPanelActiveSpeakers panel will be added + //update the speakers dropdown too + //mSpeakerPanel->setVoiceModerationCtrlMode(voice_moderated); + } +} + void LLIMFloater::addTypingIndicator(const LLIMInfo* im_info) { // We may have lost a "stop-typing" packet, don't add it twice -- cgit v1.2.3 From a999e50a8ebb3ab641490294d67dbbd6eb0c8898 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi 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/llimfloater.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'indra/newview/llimfloater.cpp') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index b8b0290b18..2f060acb50 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -240,6 +240,15 @@ BOOL LLIMFloater::postBuild() mTypingStart = LLTrans::getString("IM_typing_start_string"); + // Disable input editor if session cannot accept text + LLIMModel::LLIMSession* im_session = + LLIMModel::instance().findIMSession(mSessionID); + if( im_session && !im_session->mTextIMPossible ) + { + mInputEditor->setEnabled(FALSE); + mInputEditor->setLabel(LLTrans::getString("IM_unavailable_text_label")); + } + //*TODO if session is not initialized yet, add some sort of a warning message like "starting session...blablabla" //see LLFloaterIMPanel for how it is done (IB) @@ -249,8 +258,6 @@ BOOL LLIMFloater::postBuild() // virtual void LLIMFloater::draw() { - - if ( mMeTyping ) { // Time out if user hasn't typed for a while. @@ -259,6 +266,7 @@ void LLIMFloater::draw() setTyping(false); } } + LLFloater::draw(); } @@ -474,9 +482,14 @@ void LLIMFloater::onInputEditorFocusReceived( LLFocusableElement* caller, void* { LLIMFloater* self= (LLIMFloater*) userdata; - //in disconnected state IM input editor should be disabled - self->mInputEditor->setEnabled(!gDisconnected); - + // Allow enabling the LLIMFloater input editor only if session can accept text + LLIMModel::LLIMSession* im_session = + LLIMModel::instance().findIMSession(self->mSessionID); + if( im_session && im_session->mTextIMPossible ) + { + //in disconnected state IM input editor should be disabled + self->mInputEditor->setEnabled(!gDisconnected); + } self->mChatHistory->setCursorAndScrollToEnd(); } -- cgit v1.2.3 From 79738b2a65ef609f49db9bd2ff57fe5ae8e7e830 Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Wed, 28 Oct 2009 20:59:33 +0200 Subject: Fixed normal bug EXT-1857-'Group Info' btn is unnecessary in Friends Conference floater --HG-- branch : product-engine --- indra/newview/llimfloater.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'indra/newview/llimfloater.cpp') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 2f060acb50..b86795f696 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -78,12 +78,15 @@ LLIMFloater::LLIMFloater(const LLUUID& session_id) mSessionInitialized = im_session->mSessionInitialized; mDialog = im_session->mType; - if (IM_NOTHING_SPECIAL == mDialog || IM_SESSION_P2P_INVITE == mDialog) - { + switch(mDialog){ + case IM_NOTHING_SPECIAL: + case IM_SESSION_P2P_INVITE: mFactoryMap["panel_im_control_panel"] = LLCallbackMap(createPanelIMControl, this); - } - else - { + break; + case IM_SESSION_CONFERENCE_START: + mFactoryMap["panel_im_control_panel"] = LLCallbackMap(createPanelAdHocControl, this); + break; + default: mFactoryMap["panel_im_control_panel"] = LLCallbackMap(createPanelGroupControl, this); } } @@ -290,6 +293,15 @@ void* LLIMFloater::createPanelGroupControl(void* userdata) return self->mControlPanel; } +// static +void* LLIMFloater::createPanelAdHocControl(void* userdata) +{ + LLIMFloater *self = (LLIMFloater*)userdata; + self->mControlPanel = new LLPanelAdHocControlPanel(self->mSessionID); + self->mControlPanel->setXMLFilename("panel_adhoc_control_panel.xml"); + return self->mControlPanel; +} + void LLIMFloater::onSlide() { LLPanel* im_control_panel = getChild("panel_im_control_panel"); -- cgit v1.2.3 From e724fa0ab4c4675b94546f67bd4323704201f4a6 Mon Sep 17 00:00:00 2001 From: Sergey Borushevsky 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/llimfloater.cpp | 50 ++----------------------------------------- 1 file changed, 2 insertions(+), 48 deletions(-) (limited to 'indra/newview/llimfloater.cpp') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index b86795f696..f3fec70ac9 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -235,11 +235,6 @@ BOOL LLIMFloater::postBuild() setTitle(LLIMModel::instance().getName(mSessionID)); setDocked(true); - - if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) - { - LLLogChat::loadHistory(getTitle(), &chatFromLogFile, (void *)this); - } mTypingStart = LLTrans::getString("IM_typing_start_string"); @@ -453,9 +448,6 @@ void LLIMFloater::updateMessages() { std::list messages; LLIMModel::instance().getMessages(mSessionID, messages, mLastMessageIndex+1); - std::string agent_name; - - gCacheName->getFullName(gAgentID, agent_name); if (messages.size()) { @@ -464,20 +456,17 @@ void LLIMFloater::updateMessages() std::ostringstream message; std::list::const_reverse_iterator iter = messages.rbegin(); std::list::const_reverse_iterator iter_end = messages.rend(); - for (; iter != iter_end; ++iter) + for (; iter != iter_end; ++iter) { LLSD msg = *iter; - std::string from = msg["from"].asString(); std::string time = msg["time"].asString(); LLUUID from_id = msg["from_id"].asUUID(); + std::string from = from_id != gAgentID ? msg["from"].asString() : LLTrans::getString("You"); std::string message = msg["message"].asString(); LLStyle::Params style_params; style_params.color(chat_color); - if (from == agent_name) - from = LLTrans::getString("You"); - LLChat chat(message); chat.mFromID = from_id; chat.mFromName = from; @@ -657,38 +646,3 @@ void LLIMFloater::removeTypingIndicator(const LLIMInfo* im_info) } } -void LLIMFloater::chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata) -{ - if (!userdata) return; - - LLIMFloater* self = (LLIMFloater*) userdata; - std::string message = line; - S32 im_log_option = gSavedPerAccountSettings.getS32("IMLogOptions"); - switch (type) - { - case LLLogChat::LOG_EMPTY: - // add warning log enabled message - if (im_log_option!=LOG_CHAT) - { - message = LLTrans::getString("IM_logging_string"); - } - break; - case LLLogChat::LOG_END: - // add log end message - if (im_log_option!=LOG_CHAT) - { - message = LLTrans::getString("IM_logging_string"); - } - break; - case LLLogChat::LOG_LINE: - // just add normal lines from file - break; - default: - // nothing - break; - } - - self->mChatHistory->appendText(message, true, LLStyle::Params().color(LLUIColorTable::instance().getColor("ChatHistoryTextColor"))); - self->mChatHistory->blockUndo(); -} - -- cgit v1.2.3 From 12427e963ed7312c33e2dfd756573517b03f0475 Mon Sep 17 00:00:00 2001 From: Sergey Borushevsky Date: Thu, 29 Oct 2009 22:32:35 +0200 Subject: Implemented major task EXT-1695 (IM window should save profile image show/hide state). --HG-- branch : product-engine --- indra/newview/llimfloater.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llimfloater.cpp') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index f3fec70ac9..b9c068b583 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -302,6 +302,8 @@ void LLIMFloater::onSlide() LLPanel* im_control_panel = getChild("panel_im_control_panel"); im_control_panel->setVisible(!im_control_panel->getVisible()); + gSavedSettings.setBOOL("IMShowControlPanel", im_control_panel->getVisible()); + getChild("slide_left_btn")->setVisible(im_control_panel->getVisible()); getChild("slide_right_btn")->setVisible(!im_control_panel->getVisible()); } @@ -344,6 +346,8 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) LLDockControl::TOP, boost::bind(&LLIMFloater::getAllowedRect, floater, _1))); } + floater->childSetVisible("panel_im_control_panel", gSavedSettings.getBOOL("IMShowControlPanel")); + return floater; } -- cgit v1.2.3 From 7dd9fb280663dfd0842b69e8c5f706fd96b8cf75 Mon Sep 17 00:00:00 2001 From: Dmitry Oleshko Date: Fri, 30 Oct 2009 14:18:07 +0200 Subject: fixed normal bug (EXT-1934) [BSI] Revert EXT-543 - Notification chiclet should not count IM/Group messages --HG-- branch : product-engine --- indra/newview/llimfloater.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llimfloater.cpp') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index b9c068b583..b21df87093 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -409,8 +409,6 @@ bool LLIMFloater::toggle(const LLUUID& session_id) { // ensure the list of messages is updated when floater is made visible show(session_id); - // update number of unread notifications in the SysWell - LLBottomTray::getInstance()->getSysWell()->updateUreadIMNotifications(); return true; } } -- cgit v1.2.3