From 562c2bd1ec4fe25f4a686f1b7e59ddd78fd90d41 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 1 Jul 2020 16:55:57 +0300 Subject: SL-13525 FIXED If a blocked user is first to chat in a group IM session, that group IM will not open even if unblocked people chat. --- indra/newview/llimview.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index d5142a4496..ee3cb338e7 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2734,7 +2734,7 @@ void LLIMMgr::addMessage( if (LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat) && !from_linden) { LL_WARNS() << "Leaving IM session from initiating muted resident " << from << LL_ENDL; - if (!gIMMgr->leaveSession(new_session_id)) + if (!gIMMgr->leaveSession(new_session_id, !session->isGroupSessionType())) { LL_INFOS() << "Session " << new_session_id << " does not exist." << LL_ENDL; } @@ -2964,12 +2964,15 @@ LLUUID LLIMMgr::addSession( return session_id; } -bool LLIMMgr::leaveSession(const LLUUID& session_id) +bool LLIMMgr::leaveSession(const LLUUID& session_id, bool send_leave_msg) { LLIMModel::LLIMSession* im_session = LLIMModel::getInstance()->findIMSession(session_id); if (!im_session) return false; - LLIMModel::getInstance()->sendLeaveSession(session_id, im_session->mOtherParticipantID); + if (send_leave_msg) + { + LLIMModel::getInstance()->sendLeaveSession(session_id, im_session->mOtherParticipantID); + } gIMMgr->removeSession(session_id); return true; } -- cgit v1.2.3 From c38199451ba9a309909f5d8df4499358b9d6ad53 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 6 Jul 2020 11:31:02 +0300 Subject: SL-13529 FIXED CHUI floater switches IMs (Local chat to group IM to another group IM) --- indra/newview/llimview.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index ee3cb338e7..d67a6ad93e 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2693,6 +2693,14 @@ void LLIMMgr::addMessage( bool new_session = !hasSession(new_session_id); if (new_session) { + // Group chat session was initiated by muted resident, do not start this session viewerside + // do not send leave msg either, so we are able to get group messages from other participants + if ((IM_SESSION_INVITE == dialog) && gAgent.isInGroup(new_session_id) && + LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat) && !from_linden) + { + return; + } + LLAvatarName av_name; if (LLAvatarNameCache::get(other_participant_id, &av_name) && !name_is_setted) { @@ -2734,7 +2742,7 @@ void LLIMMgr::addMessage( if (LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat) && !from_linden) { LL_WARNS() << "Leaving IM session from initiating muted resident " << from << LL_ENDL; - if (!gIMMgr->leaveSession(new_session_id, !session->isGroupSessionType())) + if (!gIMMgr->leaveSession(new_session_id)) { LL_INFOS() << "Session " << new_session_id << " does not exist." << LL_ENDL; } @@ -2964,15 +2972,12 @@ LLUUID LLIMMgr::addSession( return session_id; } -bool LLIMMgr::leaveSession(const LLUUID& session_id, bool send_leave_msg) +bool LLIMMgr::leaveSession(const LLUUID& session_id) { LLIMModel::LLIMSession* im_session = LLIMModel::getInstance()->findIMSession(session_id); if (!im_session) return false; - if (send_leave_msg) - { - LLIMModel::getInstance()->sendLeaveSession(session_id, im_session->mOtherParticipantID); - } + LLIMModel::getInstance()->sendLeaveSession(session_id, im_session->mOtherParticipantID); gIMMgr->removeSession(session_id); return true; } -- cgit v1.2.3 From 5629062ce73603e725b4e805a24d807920cd3145 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 21 Jan 2021 22:19:48 +0200 Subject: SL-14728 Added data validation into incoming call dialog --- indra/newview/llimview.cpp | 54 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 12 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index c91e705d03..9afb6ca58b 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2254,6 +2254,19 @@ BOOL LLOutgoingCallDialog::postBuild() // Class LLIncomingCallDialog //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +const std::array voice_call_types = +{ + "VoiceInviteP2P", + "VoiceInviteGroup", + "VoiceInviteAdHoc", + "InviteAdHoc" +}; + +bool is_voice_call_type(const std::string &value) +{ + return std::find(voice_call_types.begin(), voice_call_types.end(), value) != voice_call_types.end(); +} + LLIncomingCallDialog::LLIncomingCallDialog(const LLSD& payload) : LLCallDialog(payload), mAvatarNameCacheConnection() @@ -2283,9 +2296,28 @@ BOOL LLIncomingCallDialog::postBuild() { LLCallDialog::postBuild(); + if (!mPayload.isMap() || mPayload.size() == 0) + { + LL_INFOS("IMVIEW") << "IncomingCall: invalid argument" << LL_ENDL; + return TRUE; + } + LLUUID session_id = mPayload["session_id"].asUUID(); LLSD caller_id = mPayload["caller_id"]; std::string caller_name = mPayload["caller_name"].asString(); + + if (session_id.isNull() && caller_id.asUUID().isNull()) + { + LL_INFOS("IMVIEW") << "IncomingCall: invalid ids" << LL_ENDL; + return TRUE; + } + + std::string notify_box_type = mPayload["notify_box_type"].asString(); + if (!is_voice_call_type(notify_box_type)) + { + LL_INFOS("IMVIEW") << "IncomingCall: notify_box_type was not provided" << LL_ENDL; + return TRUE; + } // init notification's lifetime std::istringstream ss( getString("lifetime") ); @@ -2302,15 +2334,14 @@ BOOL LLIncomingCallDialog::postBuild() if (gAgent.getGroupData(session_id, data)) { args["[GROUP]"] = data.mName; - call_type = getString(mPayload["notify_box_type"], args); + call_type = getString(notify_box_type, args); } } else { - call_type = getString(mPayload["notify_box_type"]); + call_type = getString(notify_box_type); } - - + // check to see if this is an Avaline call bool is_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(session_id); if (caller_name == "anonymous") @@ -2340,7 +2371,6 @@ BOOL LLIncomingCallDialog::postBuild() childSetAction("Start IM", onStartIM, this); setDefaultBtn("Accept"); - std::string notify_box_type = mPayload["notify_box_type"].asString(); if(notify_box_type != "VoiceInviteGroup" && notify_box_type != "VoiceInviteAdHoc") { // starting notification's timer for P2P and AVALINE invitations @@ -2491,10 +2521,10 @@ void LLIncomingCallDialog::processCallResponse(S32 response, const LLSD &payload correct_session_name.append(ADHOC_NAME_SUFFIX); } } - LL_INFOS() << "Corrected session name is " << correct_session_name << LL_ENDL; + LL_INFOS("IMVIEW") << "Corrected session name is " << correct_session_name << LL_ENDL; break; default: - LL_WARNS() << "Received an empty session name from a server and failed to generate a new proper session name" << LL_ENDL; + LL_WARNS("IMVIEW") << "Received an empty session name from a server and failed to generate a new proper session name" << LL_ENDL; break; } } @@ -2745,7 +2775,7 @@ void LLIMMgr::addMessage( LL_WARNS() << "Leaving IM session from initiating muted resident " << from << LL_ENDL; if (!gIMMgr->leaveSession(new_session_id)) { - LL_INFOS() << "Session " << new_session_id << " does not exist." << LL_ENDL; + LL_INFOS("IMVIEW") << "Session " << new_session_id << " does not exist." << LL_ENDL; } return; } @@ -2956,7 +2986,7 @@ LLUUID LLIMMgr::addSession( //we don't need to show notes about online/offline, mute/unmute users' statuses for existing sessions if (!new_session) return session_id; - LL_INFOS() << "LLIMMgr::addSession, new session added, name = " << name << ", session id = " << session_id << LL_ENDL; + LL_INFOS("IMVIEW") << "LLIMMgr::addSession, new session added, name = " << name << ", session id = " << session_id << LL_ENDL; //Per Plan's suggestion commented "explicit offline status warning" out to make Dessie happier (see EXT-3609) //*TODO After February 2010 remove this commented out line if no one will be missing that warning @@ -2993,7 +3023,7 @@ void LLIMMgr::removeSession(const LLUUID& session_id) LLIMModel::getInstance()->clearSession(session_id); - LL_INFOS() << "LLIMMgr::removeSession, session removed, session id = " << session_id << LL_ENDL; + LL_INFOS("IMVIEW") << "LLIMMgr::removeSession, session removed, session id = " << session_id << LL_ENDL; notifyObserverSessionRemoved(session_id); } @@ -3059,13 +3089,13 @@ void LLIMMgr::inviteToSession( if (LLMuteList::getInstance()->isMuted(caller_id, LLMute::flagVoiceChat) && voice_invite && "VoiceInviteQuestionDefault" == question_type) { - LL_INFOS() << "Rejecting voice call from initiating muted resident " << caller_name << LL_ENDL; + LL_INFOS("IMVIEW") << "Rejecting voice call from initiating muted resident " << caller_name << LL_ENDL; LLIncomingCallDialog::processCallResponse(1, payload); return; } else if (LLMuteList::getInstance()->isMuted(caller_id, LLMute::flagAll & ~LLMute::flagVoiceChat) && !voice_invite) { - LL_INFOS() << "Rejecting session invite from initiating muted resident " << caller_name << LL_ENDL; + LL_INFOS("IMVIEW") << "Rejecting session invite from initiating muted resident " << caller_name << LL_ENDL; return; } } -- cgit v1.2.3