The "injured and upset" party would have to report it to the police though.
I have both intentionally and unintentionally (pesky auto-correct!) swore online, on text messages and emails. You just need to chose your audience wisely.
It is obviously better to try to clean up one's language while living in a country where swearing can land you in prison.
I don't think it matters if you're in a group chat or not. If someone decides to report you it is because of swearing in whatever setting. However, I cannot imagine a friend reporting me when I swear and I don't chat with people on Whatsapp who are not my friends...