It was narrated that Ibn ‘Umar said:“The Messenger of Allah (ﷺ) said: ‘Whoever eats anything from this plant, let him not come to the mosque.’”
حَدَّثَنَا مُحَمَّدُ بْنُ الصَّبَّاحِ، حَدَّثَنَا عَبْدُ اللَّهِ بْنُ رَجَاءٍ الْمَكِّيُّ، عَنْ عُبَيْدِ اللَّهِ بْنِ عُمَرَ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، قَالَ قَالَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ " مَنْ أَكَلَ مِنْ هَذِهِ الشَّجَرَةِ شَيْئًا فَلاَ يَأْتِيَنَّ الْمَسْجِدَ " .
IbnMaja
Establishing the Prayer and the Sunnah Regarding Them • Hadith 1016