Praise be to Allaah.
The Muslim should be far removed from obscenity and obscene actions. One of the most evil of things is that Muslims should openly manifest their immoral actions and their being far from Allaah. An example of this is when a Muslim commits a sin which angers Allaah, His Creator, Master and Lord, and Allaah, the Concealer, the Most Generous, the Forgiver, who could, if He willed, cause the earth to swallow him when he is committing that promiscuous act and neglecting the sacred limits set by Allaah, conceals his action. Even worse than that, he becomes proud of angering Allaah and spreads news of that among people, uncovering that which Allaah has concealed from the people. How could Allaah forgive something like this?
Hence Allaah may deprive a person like this of repentance.
It was narrated that Saalim ibn ‘Abd-Allaah said: I heard Abu Hurayrah say: I heard the Messenger of Allaah (peace and blessings of Allaah be upon him) said:
“All of my ummah will be fine except for those who commit sin openly. Part of committing sin openly is when a man does something at night and Allaah conceals it, but in the morning he says, ‘O So-and-so, last night I did such and such.’ His Lord had covered his sin all night, but in the morning he removed the cover of Allaah.” (Narrated by al-Bukhaari, 5721; Muslim, 2990)
Al-Haafiz Ibn Hajar said:
Concerning the command to cover or conceal, a hadeeth was narrated which does not meet the conditions of al-Bukhaari. This is the hadeeth of Ibn ‘Umar which is attributed to the Prophet (peace and blessings of Allaah be upon him): “Avoid these obscenities which Allaah has forbidden. Whoever commits any of them, let him be concealed with the concealment of Allaah.” The hadeeth was narrated by al-Haakim and is also included in al-Muwatta’ as one of the mursal reports of Zayd ibn Aslam.
Ibn Battaal said: Openly flaunting one’s sins implies disrespect towards Allaah and His Messenger, and the righteous believers, and is a type of stubborn provocation. Concealing sin protects one against being disrespectful in this manner, because sin brings humiliation upon the people who commit it, such as the hadd punishment if it is a sin that carries such a penalty, or the ta’zeer penalty if no hadd is enjoined. If it is something which violates the rights of Allaah, then He is the Most Generous and His Mercy precedes His Wrath. Hence if He conceals it in this world, He will not expose it in the Hereafter, but the one who flaunts it openly loses all of that.
The hadeeth clearly condemns those who openly flaunt their sin, which implies praise of those who conceal their sin. The fact that Allaah conceals it implies that the believer must also cover himself. Whoever deliberately flaunts his sin angers his Lord, Who will not then cover him. Whoever deliberately conceals his sin out of shame before his Lord and before people, Allaah will bless him by concealing it. (Fath al-Baari, 10/487-488)
What is meant is those who talk openly to one another about their sins. Ibn Jamaa’ah included in this disclosure of what happens between husband and wife of permissible things. This is supported by the famous report which warns against that: “It is part of flaunting one’s sins” – i.e., speaking openly about them and broadcasting them – “that a man should do an evil deed at night, then the following morning, when Allaah had covered him, he says, ‘Last night I did such and such’ – when all night his Lord had concealed his sin, but in the morning he uncovers what Allaah had concealed.” – by telling people about his sin. This is a betrayal on his part of the covering of Allaah which had been lowered upon him, and a provocation of the desire for evil in the people who hear him or see him. So these are two offences which are added to his original offence and make it worse. If in addition to that he encourages others to do likewise, this is a fourth offence that makes the matter even worse… The implication is that they have no sins unless they flaunt them, then he explained that the one who flaunts his sin is the one who does something at night and his Lord conceals it, then in the morning he says, ‘O So-and-so, last night I did such and such,’ so he removes the covering of Allaah. He is to be condemned in this world by carrying out the hadd punishment, for it is among the attributes and blessings of Allaah that He brings forth what is beautiful and conceals what is ugly. So openly flaunting sin is a rejection of that blessing and disrespect towards the concealment of Allaah. Al-Nawawi said: It is makrooh for the person who is tested with sin to tell anyone else about it. Rather he should give it up, regret it and resolve not to do it again. If he tells his shaykh or a similar person who he hopes can teach him a way out from it or show him how to keep himself from falling into similar sins, or can tell him the reason why he fell into it, or make du’aa’ for him, etc., this is fine. But is it makrooh (to tell someone else) if there is no benefit in doing so. Al-Ghazaali said: The kind of disclosure which is blameworthy is when it is in done by way of openly flaunting sin and mocking, not when it is done to ask questions and seek fatwas. The evidence for saying this is the report of the man who had intercourse with his wife in Ramadaan, and he came and told the Prophet (peace and blessings of Allaah be upon him), who did not rebuke him for telling him. (Fayd al-Qadeer, 5/11-12)
This has to do with open flaunting of sins. But what you have said about showing off and boasting is not simply the matter of not being forgiven for sin. There is the fear that it may imply riddah (apostasy) and going out of Islam, because showing off and boasting about sin may imply that one is permitting something that Allaah has forbidden.
Shaykh Ibn ‘Uthaymeen said:
There is a third kind of immoral, promiscuous evildoer, who speaks of zinaa in order to show off – we seek refuge with Allaah – and tells people that he went to such and such a country and committed immoral actions and zinaa with a number of women, and other things of which he boasts.
Such a person must be asked to repent; if he repents, all well and good, otherwise he should be executed, because if a person boasts of zinaa, this implies that he views it as permissible – Allaah forbid – and whoever regards zinaa as permissible is a kaafir.
There are some evil people who do this, because of whom and their deeds the Muslims are suffering calamities.
There are people who boast about such actions. They travel to countries which are well known for immorality and promiscuity, such as Bangkok and other places which are full of zinaa, homosexuality, alcohol, etc., then they come back to their friends and boast about what they have done.
Such a person must – as I have said –be asked to repent. If he repents, all well and good, otherwise he should be executed, because whoever regards zinaa or other actions which by scholarly consensus are haraam, as being permissible, is a kaafir.
(Sharh Riyaadh al-Saaliheen, 1/116).
The way out from your situation, is sincere repentance to Allaah, and not going to extremes in committing sins. If you do happen to commit a sin, do not tear away the covering with which Allaah conceals your sin. And Allaah knows best.