From 8b6b55e07998e33b624f5f4c6a148017ae87774f Mon Sep 17 00:00:00 2001 From: Dmitry Oleshko Date: Tue, 8 Dec 2009 17:19:09 +0200 Subject: work on normal tasks: (EXT-2803) Create notifications and dialogs to negotiate P2P voice chat (shown over the Speak button) (EXT-2806) Create notification windows and dialogs to negotiate Group Voice Chat (docked to Speak button's chevron) (EXT-2802) Create notifications and dialogs to negotiate AvaLine calls (shown over Speak button) (EXT-2805) Create notifications and dialogs to negotiate Ad-Hoc calls (shown over Speak button) - "NO ANSWER" notification gets closed after specified timeout - added possibility to check direction of call (but it doesn't work for group and ad-hoc calls yet) - adjusted layout for the incoming call dialog --HG-- branch : product-engine --- indra/newview/llimview.cpp | 47 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 6 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 6c4af0522f..b710c41650 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -154,7 +154,6 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& mInitialTargetIDs(ids), mVoiceChannel(NULL), mSpeakers(NULL), - mCallDialogManager(NULL), mSessionInitialized(false), mCallBackEnabled(true), mTextIMPossible(true), @@ -287,9 +286,6 @@ void LLIMModel::LLIMSession::onVoiceChannelStateChanged(const LLVoiceChannel::ES LLIMModel::LLIMSession::~LLIMSession() { - delete mCallDialogManager; - mCallDialogManager = NULL; - delete mSpeakers; mSpeakers = NULL; @@ -1268,6 +1264,7 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat { LLSD mCallDialogPayload; LLOutgoingCallDialog* ocd; + bool is_incoming; mCallDialogPayload["session_id"] = sSession->mSessionID; mCallDialogPayload["session_name"] = sSession->mName; @@ -1277,8 +1274,10 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat switch(new_state) { case LLVoiceChannel::STATE_CALL_STARTED : - // do not show "Calling to..." if it is incoming P2P call - if(sSession->mSessionType == LLIMModel::LLIMSession::P2P_SESSION && static_cast(sSession->mVoiceChannel)->isIncomingCall()) + // do not show "Calling to..." if it is incoming call + is_incoming = LLVoiceClient::getInstance()->isSessionIncoming(sSession->mSessionID); + // *TODO: implement for AdHoc and Group voice chats + if(is_incoming) { return; } @@ -1290,6 +1289,7 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat ocd->getChild("leaving")->setVisible(true); ocd->getChild("connecting")->setVisible(false); ocd->getChild("noanswer")->setVisible(false); + ocd->getChild("Cancel")->setVisible(true); } return; @@ -1301,10 +1301,12 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat ocd->getChild("leaving")->setVisible(true); ocd->getChild("connecting")->setVisible(true); ocd->getChild("noanswer")->setVisible(false); + ocd->getChild("Cancel")->setVisible(true); } return; case LLVoiceChannel::STATE_ERROR : + mCallDialogPayload["start_timer"] = true; ocd = dynamic_cast(LLFloaterReg::showInstance("outgoing_call", mCallDialogPayload, TRUE)); if (ocd) { @@ -1312,6 +1314,7 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat ocd->getChild("leaving")->setVisible(false); ocd->getChild("connecting")->setVisible(false); ocd->getChild("noanswer")->setVisible(true); + ocd->getChild("Cancel")->setVisible(false); } return; @@ -1363,6 +1366,33 @@ LLCallDialog(payload) instance->onCancel(instance); } } +void LLOutgoingCallDialog::draw() +{ + if (lifetimeHasExpired()) + { + onLifetimeExpired(); + } + LLDockableFloater::draw(); +} + +bool LLOutgoingCallDialog::lifetimeHasExpired() +{ + if (mLifetimeTimer.getStarted()) + { + F32 elapsed_time = mLifetimeTimer.getElapsedTimeF32(); + if (elapsed_time > LIFETIME) + { + return true; + } + } + return false; +} + +void LLOutgoingCallDialog::onLifetimeExpired() +{ + mLifetimeTimer.stop(); + closeFloater(); +} void LLOutgoingCallDialog::onOpen(const LLSD& key) { @@ -1391,6 +1421,11 @@ void LLOutgoingCallDialog::onOpen(const LLSD& key) childSetTextArg("connecting", "[CALLEE_NAME]", callee_name); LLAvatarIconCtrl* icon = getChild("avatar_icon"); icon->setValue(callee_id); + + if(mPayload.has("start_timer")) + { + mLifetimeTimer.reset(); + } } -- cgit v1.2.3 From 09f0b98e14a167902ffea75467e8c528cab8dad8 Mon Sep 17 00:00:00 2001 From: Dmitry Oleshko Date: Tue, 8 Dec 2009 18:55:36 +0200 Subject: additional fix for outgoing voice notification now only "NO ANSWER" notification closed after specified timeout --HG-- branch : product-engine --- indra/newview/llimview.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index b710c41650..9790bdf9c0 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1422,6 +1422,8 @@ void LLOutgoingCallDialog::onOpen(const LLSD& key) LLAvatarIconCtrl* icon = getChild("avatar_icon"); icon->setValue(callee_id); + // stop timer by default + mLifetimeTimer.stop(); if(mPayload.has("start_timer")) { mLifetimeTimer.reset(); -- cgit v1.2.3 From 4db25f9e02f79afaaaffdf205fe7dfe8785029d8 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Tue, 8 Dec 2009 21:15:28 +0200 Subject: Fixed normal bug EXT-2776 (Notification toasts of group chat pop up when group chat is open but not in focus). --HG-- branch : product-engine --- indra/newview/llimview.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 9790bdf9c0..d5d3b3b5ae 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -116,6 +116,13 @@ void toast_callback(const LLSD& msg){ return; } + // Skip toasting if we have open window of IM with this session id + LLIMFloater* open_im_floater = LLIMFloater::findInstance(msg["session_id"]); + if (open_im_floater && open_im_floater->getVisible()) + { + return; + } + LLSD args; args["MESSAGE"] = msg["message"]; args["TIME"] = msg["time"]; -- cgit v1.2.3 From a85812d93fa8e574391ad3e1d21cf0758324e2f1 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Tue, 8 Dec 2009 22:15:27 +0200 Subject: Partial fix of normal bug EXT-2788 (Confusing message after accepting outdated voice chat) --HG-- branch : product-engine --- indra/newview/llimview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index d5d3b3b5ae..6a9853913a 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1082,7 +1082,7 @@ public: if ( 404 == statusNum ) { std::string error_string; - error_string = "does not exist"; + error_string = "session_does_not_exist_error"; gIMMgr->showSessionStartError(error_string, mSessionID); } } -- cgit v1.2.3 From 9b4d09471cca6922257a27ba9cb70498ab81fd94 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Thu, 10 Dec 2009 14:05:17 +0000 Subject: DEV-41317 DEV-42311: Improved auto-call implementation. Improved the implementation for auto-connecting an adhoc call. This involved having the controller (LLIMMgr) set a flag in the model (LLIMModel) to autoconnect on initialize. Now all of the view code (LLPanelChatControlPanel) and the signal/callback infrastructure that I added earlier can be removed as it violated MVP separation. Ah! Much nicer. Thanks to PE folk for the suggestion. --- indra/newview/llimview.cpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 6c4af0522f..4780b51c55 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -158,7 +158,8 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& mSessionInitialized(false), mCallBackEnabled(true), mTextIMPossible(true), - mOtherParticipantIsAvatar(true) + mOtherParticipantIsAvatar(true), + mStartCallOnInitialize(false) { if (IM_NOTHING_SPECIAL == type || IM_SESSION_P2P_INVITE == type) { @@ -413,6 +414,12 @@ void LLIMModel::processSessionInitializedReply(const LLUUID& old_session_id, con { im_floater->sessionInitReplyReceived(new_session_id); } + + // auto-start the call on session initialization? + if (session->mStartCallOnInitialize) + { + gIMMgr->startCall(new_session_id); + } } //*TODO remove this "floater" stuff when Communicate Floater is gone @@ -995,18 +1002,6 @@ bool LLIMModel::sendStartSession( return false; } -// static -void LLIMModel::sendSessionInitialized(const LLUUID &session_id) -{ - LLIMSession* session = getInstance()->findIMSession(session_id); - if (session) - { - LLSD arg; - arg["session_id"] = session_id; - getInstance()->mSessionInitializedSignal(arg); - } -} - // // Helper Functions // @@ -1929,6 +1924,15 @@ BOOL LLIMMgr::getIMReceived() const return mIMReceived; } +void LLIMMgr::autoStartCallOnStartup(const LLUUID& session_id) +{ + LLIMModel::LLIMSession *session = LLIMModel::getInstance()->findIMSession(session_id); + if (session) + { + session->mStartCallOnInitialize = true; + } +} + LLUUID LLIMMgr::addP2PSession(const std::string& name, const LLUUID& other_participant_id, const std::string& voice_session_handle, -- cgit v1.2.3 From f11c6044562571d42c76abede6fa90db2b08493f Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Thu, 10 Dec 2009 18:45:36 +0200 Subject: fixed EXT-3247 (There is no title in Ad-hoc IM window, and only "To" is shown if user accepts Ad-hoc conference) sometimes a session name received from a server is empty, added generating a correct session name in such a case --HG-- branch : product-engine --- indra/newview/llimview.cpp | 61 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 53 insertions(+), 8 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 6a9853913a..fd1fb38914 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -88,6 +88,9 @@ const static std::string IM_TEXT("message"); const static std::string IM_FROM("from"); const static std::string IM_FROM_ID("from_id"); +const static std::string NO_SESSION("(IM Session Doesn't Exist)"); +const static std::string ADHOC_NAME_SUFFIX(" Conference"); + std::string LLCallDialogManager::sPreviousSessionlName = ""; std::string LLCallDialogManager::sCurrentSessionlName = ""; LLIMModel::LLIMSession* LLCallDialogManager::sSession = NULL; @@ -451,10 +454,16 @@ void LLIMModel::testMessages() addMessage(bot2_session_id, from, bot2_id, "Test Message: OMGWTFBBQ."); } - +//session name should not be empty bool LLIMModel::newSession(const LLUUID& session_id, const std::string& name, const EInstantMessage& type, const LLUUID& other_participant_id, const std::vector& ids) { + if (name.empty()) + { + llwarns << "Attempt to create a new session with empty name; id = " << session_id << llendl; + return false; + } + if (findIMSession(session_id)) { llwarns << "IM Session " << session_id << " already exists" << llendl; @@ -611,7 +620,7 @@ const std::string& LLIMModel::getName(const LLUUID& session_id) const if (!session) { llwarns << "session " << session_id << "does not exist " << llendl; - return LLStringUtil::null; + return NO_SESSION; } return session->mName; @@ -1558,6 +1567,8 @@ void LLIncomingCallDialog::processCallResponse(S32 response) return; LLUUID session_id = mPayload["session_id"].asUUID(); + LLUUID caller_id = mPayload["caller_id"].asUUID(); + std::string session_name = mPayload["session_name"].asString(); EInstantMessage type = (EInstantMessage)mPayload["type"].asInteger(); LLIMMgr::EInvitationType inv_type = (LLIMMgr::EInvitationType)mPayload["inv_type"].asInteger(); bool voice = true; @@ -1574,8 +1585,8 @@ void LLIncomingCallDialog::processCallResponse(S32 response) { // create a normal IM session session_id = gIMMgr->addP2PSession( - mPayload["session_name"].asString(), - mPayload["caller_id"].asUUID(), + session_name, + caller_id, mPayload["session_handle"].asString(), mPayload["session_uri"].asString()); @@ -1593,10 +1604,38 @@ void LLIncomingCallDialog::processCallResponse(S32 response) } else { - LLUUID new_session_id = gIMMgr->addSession( - mPayload["session_name"].asString(), - type, - session_id); + //session name should not be empty, but it can contain spaces so we don't trim + std::string correct_session_name = session_name; + if (session_name.empty()) + { + llwarns << "Received an empty session name from a server" << llendl; + + switch(type){ + case IM_SESSION_CONFERENCE_START: + case IM_SESSION_GROUP_START: + case IM_SESSION_INVITE: + if (gAgent.isInGroup(session_id)) + { + LLGroupData data; + if (!gAgent.getGroupData(session_id, data)) break; + correct_session_name = data.mName; + } + else + { + if (gCacheName->getFullName(caller_id, correct_session_name)) + { + correct_session_name.append(ADHOC_NAME_SUFFIX); + } + } + llinfos << "Corrected session name is " << correct_session_name << llendl; + break; + default: + llwarning("Received an empty session name from a server and failed to generate a new proper session name", 0); + break; + } + } + + LLUUID new_session_id = gIMMgr->addSession(correct_session_name, type, session_id); if (new_session_id != LLUUID::null) { LLIMFloater::show(new_session_id); @@ -2023,6 +2062,12 @@ LLUUID LLIMMgr::addSession( return LLUUID::null; } + if (name.empty()) + { + llwarning("Session name cannot be null!", 0); + return LLUUID::null; + } + LLUUID session_id = computeSessionID(dialog,other_participant_id); bool new_session = !LLIMModel::getInstance()->findIMSession(session_id); -- cgit v1.2.3