We used to greet the Prophet ﷺ while he was praying and he used to answer our greetings. When we returned from An-Najashi (the ruler of Ethiopia), we greeted him, but he did not answer us (during the prayer) and (after finishing the prayer) he said, "In the prayer one is occupied (with a more serious matter)."
كُنَّا نُسَلِّمُ عَلَى النَّبِيِّ ﷺ وَهُوَ فِي الصَّلاَةِ فَيَرُدُّ عَلَيْنَا فَلَمَّا رَجَعْنَا مِنْ عِنْدِ النَّجَاشِيِّ سَلَّمْنَا عَلَيْهِ فَلَمْ يَرُدَّ عَلَيْنَا وَقَالَ إِنَّ فِي الصَّلاَةِ شُغْلاً