Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) said, in the narration that has reached us from him concerning the prohibition of speaking in prayer: "So when we returned from the land of Abyssinia."
His return from Abyssinia took place before the emigration of the Prophet (peace and blessings be upon him) to Madinah; then he emigrated to Madinah and took part in the Battle of Badr with the Prophet (peace and blessings be upon him). So this incident of the salam took place before the emigration.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / Q3919