حَدَّثَنَا الْقَعْنَبِيُّ، عَنْ مَالِكٍ، عَنْ هِشَامِ بْنِ عُرْوَةَ، عَنْ أَبِيهِ، عَنْ عَائِشَةَ، زَوْجِ النَّبِيِّ صلى الله عليه وسلم أَنَّ النَّبِيَّ صلى الله عليه وسلم قَالَ ‏"‏ إِذَا نَعَسَ أَحَدُكُمْ فِي الصَّلاَةِ فَلْيَرْقُدْ حَتَّى يَذْهَبَ عَنْهُ النَّوْمُ فَإِنَّ أَحَدَكُمْ إِذَا صَلَّى وَهُوَ نَاعِسٌ لَعَلَّهُ يَذْهَبُ يَسْتَغْفِرُ فَيَسُبَّ نَفْسَهُ ‏"‏ ‏.‏
Translation
Narrated Anas

The Messenger of Allah (ﷺ) entered the mosque (and saw that) a rope tied between two pillars. He asked: What is this rope (for) ? The people told him: This is (for) Hamnah b. Jahsh who prays (here). When she is tired, she reclines on it. The Messenger of Allah (ﷺ) said: She should pray as much as she has strength. When she is tired, she should sit down.

This version of Ziyad has: He said: What is this ? The people told him: This is for Zainab who prays. When she becomes lazy, or is tired, she holds it. He said: Undo it. One of you should pray in good spirits. When he is lazy or tired, he should sit down.