From b8444e52c1e52aabe86c84442abee90c1e4479f0 Mon Sep 17 00:00:00 2001
From: Andrew Productengine <adyukov@productengine.com>
Date: Tue, 19 Oct 2010 20:23:07 +0300
Subject: STORM-402 FIXED Fixed adding of people whom you sent IM to Recent
 list.

This regression was caused by fix of STORM-126 in changeset 09f13edf6aa8 where adding of people from mInitialTargetIDs was removed.
And it was used to add people whom you P2P im'ed.

- Used mInitialTargetIDs to add people whom you P2P im'ed.
---
 indra/newview/llimview.cpp | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index c865dcf9a3..fe8a46e908 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -1049,17 +1049,27 @@ void LLIMModel::sendMessage(const std::string& utf8_text,
 		if( session == 0)//??? shouldn't really happen
 		{
 			LLRecentPeople::instance().add(other_participant_id);
+			return;
 		}
-		else
+		// IM_SESSION_INVITE means that this is an Ad-hoc incoming chat
+		//		(it can be also Group chat but it is checked above)
+		// In this case mInitialTargetIDs contains Ad-hoc session ID and it should not be added
+		// to Recent People to prevent showing of an item with (???)(???). See EXT-8246.
+		// Concrete participants will be added into this list once they sent message in chat.
+		if (IM_SESSION_INVITE == dialog) return;
+			
+		if (IM_SESSION_CONFERENCE_START == dialog) // outgoing ad-hoc session
 		{
-			// IM_SESSION_INVITE means that this is an Ad-hoc incoming chat
-			//		(it can be also Group chat but it is checked above)
-			// In this case mInitialTargetIDs contains Ad-hoc session ID and it should not be added
-			// to Recent People to prevent showing of an item with (???)(???). See EXT-8246.
-			// Concrete participants will be added into this list once they sent message in chat.
-			if (IM_SESSION_INVITE == dialog) return;
-			// Add only online members to recent (EXT-8658)
-			addSpeakersToRecent(im_session_id);			
+			// Add only online members of conference to recent list (EXT-8658)
+			addSpeakersToRecent(im_session_id);
+		}
+		else // outgoing P2P session
+		{
+			// Add the recepient of the session.
+			if (!session->mInitialTargetIDs.empty())
+			{
+				LLRecentPeople::instance().add(*(session->mInitialTargetIDs.begin()));
+			}
 		}
 	}
 }
-- 
cgit v1.2.3