From 28032582f22b543199c1e7db7f75a82eec2f0c8b Mon Sep 17 00:00:00 2001
From: Roxie Linden <roxie@lindenlab.com>
Date: Wed, 6 Mar 2024 11:17:54 -0800
Subject: Shutting down a p2p via adhoc call resets the channel info.  We
 shouldn't throw up a blank dialogue when that happens

---
 indra/newview/llimview.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'indra')

diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index fa8075673c..956c3a0276 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -2368,6 +2368,11 @@ void LLCallDialogManager::onVoiceChannelStateChangedInt(const LLVoiceChannel::ES
 			return;
 		}
 		break;
+    case LLVoiceChannel::STATE_NO_CHANNEL_INFO :
+		// This will happen in p2p calls using the adhoc
+		// infrastructure, which marks the channel as no channel info
+		// after the call is closed, which forces a dialogue.
+        return;
 
 	case LLVoiceChannel::STATE_HUNG_UP:
 		// this state is coming before session is changed
@@ -3394,6 +3399,13 @@ void LLIMMgr::inviteToSession(
 	EInvitationType inv_type,
     const LLSD& voice_channel_info)
 {
+
+	if (caller_id == gAgentID)
+	{
+		// ignore invites from ourself.
+        return;
+	}
+
 	std::string notify_box_type;
 	// voice invite question is different from default only for group call (EXT-7118)
 	std::string question_type = "VoiceInviteQuestionDefault";
-- 
cgit v1.2.3