Al-Adab Al-Mufrad, Book 47, Hadith 1171 (In-Book)

'Abdullah reported that the Prophet, may Allah bless him and grant him peace, said, "Two should not converse to the exclusion of another until they are mixing with people since that would distress him."

حَدَّثَنَا عُثْمَانُ، قَالَ‏:‏ حَدَّثَنَا جَرِيرٌ، عَنْ مَنْصُورٍ، عَنْ أَبِي وَائِلٍ، عَنْ عَبْدِ اللهِ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ‏:‏ لاَ يَتَنَاجَى اثْنَانِ دُونَ الْآخَرِ حَتَّى يَخْتَلِطُوا بِالنَّاسِ، مِنْ أَجْلِ أَنَّ ذَلِكَ يُحْزِنُهُ‏.‏

sunnah.com