Shunning a Muslim is not permissible, because the Prophet (peace and blessings of Allaah be upon him) said: “It is not permissible for a Muslim to forsake his brother for more than three days, each of them turning away from the other when they meet. The better of them is the first to greet the other with salaam.”
Narrated by al-Bukhaari (5727) and Muslim (2560).
An exception is made allowing shunning, as the scholars said, if it serves an interest, such as shunning the one who commits sin if it is known that shunning him is in his interests or in the interests of someone else, such as if he will give up his sin or others will not be tempted because of his example.
Shunning is ended if the greeting is given, so if one person greets another with salaam, then he is no longer shunning him, because of the hadeeth quoted above: “The better of them is the first to greet the other with salaam.”
See also question no. 93888.
If a person repents from his sin, Allaah accepts his repentance, as He says (interpretation of the meaning):
“And He it is Who accepts repentance from His slaves, and forgives sins, and He knows what you do”
“Know they not that Allaah accepts repentance from His slaves and takes the Sadaqaat (alms, charity), and that Allaah Alone is the One Who forgives and accepts repentance, Most Merciful?”
Repentance is valid at all times, except when the death rattle reaches the throat and when the sun rises from its place of setting, because of the report narrated by al-Tirmidhi (3537) and Ibn Majaah (4253) from Ibn ‘Umar, that the Prophet (peace and blessings of Allaah be upon him) said: “Allaah accepts the repentance of His slave so long as the death rattle has not yet reached his throat.”
Al-Nawawi (may Allaah have mercy on him) said in Sharh Muslim: The scholars (may Allaah be pleased with them) are unanimously agreed that repentance is accepted so long as the death rattle has not yet reached the throat, as it says in the hadeeth. There are three pillars or essential parts of repentance: giving up the sin, regretting what one has done and resolving not to go back to it. If he repents from a sin then goes back to it, his repentance is not invalidated. If he repents from one sin when he is committing another, his repentance is still valid. This is the view of the people of truth, whereas the Mu’tazilah differed concerning these two issues.
Muslim (2703) narrated that Abu Hurayrah said: the Messenger of Allaah (peace and blessings of Allaah be upon him) said: “Whoever repents before the sun rises from its place of setting, Allaah will accept his repentance.”
With regard to what it says in the hadeeth of Abu Hurayrah, that the Messenger of Allaah (peace and blessings of Allaah be upon him) said: “The gates of Paradise are opened on Mondays and Thursdays, and every slave who does not associate anything with Allaah is forgiven, except a man between whom and his brother is some grudge. It is said: Wait for these two until they reconcile, wait for these two until they reconcile, wait for these two until they reconcile”, it seems that this is speaking of Allaah’s forgiveness that He bestows on His slaves by His grace, without any repentance on their part.
It does not mean that the repentance of disputing parties from other sins is not accepted. If a person has a dispute with his brother, but he repents to Allaah from some other sin, such as lying for example, then Allaah will accept his repentance, as is indicated by the texts.
From the words of al-Nawawi (may Allaah have mercy on him) quoted above, it is clear that if a person repents from one sin when committing another, his repentance is valid according to Ahl al-Sunnah.
And Allaah knows best.