Sayyiduna Hudhayfah (may Allah be pleased with him) said: If you are being attacked, then talking and fighting in the prayer are lawful.