Abu Hurayrah said: I heard Allah’s Messenger saying. “All the sins of my followers will be forgiven except those of the Mujahirin (those who commit a sin openly or disclose their sins to the people). An example of such disclosure is that a person commits a sin at night and though Allah screens it from the public, then he comes in the morning, and says, ‘O so-and-so, I did such-and-such (evil) deed yesterday,’ though he spent his night screened by his Lord (none knowing about his sin) and in the morning he removes Allah’s screen from himself.”

The hadith was said in a certain context; which is to warn those who publicly boast about their sins in which they did in private. Islam warns Muslims who commit sins in private not to publicly boast about their sins in public.

In addition, the view we have adopted is the one you have seen in many of our published answers. A Muslim cannot be labeled a disbeliever or kafir, and hence residing in hell forever unless he totally denies the obligation of prayer or any of the Islamic obligations.

According to one of IslamOnline’s published fatwas, “No one will abide in the Hell-Fire forever except for the unbelievers who deny the Existence of Allah and associate other partners with Him in His Divinity.
to ascribe other partners to Allah is one of the major sins. Allah Almighty says: “Lo! Allah pardoneth not that partners should be ascribed unto him. He pardoneth all save that to whom He will. Whoso ascribeth partners unto Allah hath wandered far astray.” (An-Nisa’: 116)
On the other hand, those Muslims who commit sins openly without any sense of shame will be condemned to the Hell-Fire, but they will not abide forever. Such ruling may be derived from the previous verse, and all Muslim Jurists, including Ibn `Abbas (may Allah be pleased with him) agree on this point.
the Qur’an also refers to the fact that if anyone shuns major sins, Allah Almighty forgives his minor ones. Allah says: “Those who avoid enormities of sin and abominations, save the unwilled offences (for them) lo! thy Lord is of vast mercy.” (An-Najm: 32)
however, it is better for those who commit sins in public to fear Allah, and know that He is Ever-Watchful of their wrong actions. They should know that evil deeds incur the severest punishment on the Day of Judgement. Instead of boasting of committing sins in public, they should repent and turn penitent to Allah, so that He may forgive them and shower His Mercy upon them.”