Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:16351al-Ḥakam > Miqsam > Ibn ʿAbbās

[Machine] And the Messenger of Allah ﷺ loved two men from the polytheists who were involved with him during the Treaty of Hudaybiyyah. Abu Abdullah Al-Hafiz informed us, narrating from Ali ibn Hamshath, narrating from Muhammad ibn Al-Mughirah, narrating from Al-Qasim ibn Al-Hakam Al-Urani, narrating from Al-Hasan ibn Umarah, who mentioned it. And Al-Hasan ibn Umarah is considered unreliable and cannot be used as evidence.  

البيهقي:١٦٣٥١وَرَوَاهُ الْحَسَنُ بْنُ عُمَارَةَ عَنِ الْحَكَمِ عَنْ مِقْسَمٍ عَنِ ابْنِ عَبَّاسٍ قَالَ

وَدَى رَسُولُ اللهِ ﷺ رَجُلَيْنِ مِنَ الْمُشْرِكِينَ وَكَانَا مِنْهُ فِي عَهْدٍ دِيَةَ الْحُرَّيْنِ الْمُسْلِمَيْنِ أَخْبَرْنَاهُ أَبُو عَبْدِ اللهِ الْحَافِظُ ثنا عَلِيُّ بْنُ حَمْشَاذٍ ثنا مُحَمَّدُ بْنُ الْمُغِيرَةِ ثنا الْقَاسِمُ بْنُ الْحَكَمِ الْعُرَنِيُّ ثنا الْحَسَنُ بْنُ عُمَارَةَ فَذَكَرَهُ وَالْحَسَنُ بْنُ عُمَارَةَ مَتْرُوكٌ لَا يُحْتَجُّ بِهِ