The European Court of Human Rights has ruled that an employee should not have been fired by his employer for sending unrelated instant messages at work.

According to the BBC, Bogdan Mihai Barbulescu was fired from his job for sending messages “via the Yahoo messaging system in 2007.”

“His employer had used surveillance software to monitor his computer activity,” they reported, adding that “a Romanian court ruled in 2016 that the firm was within its rights but this has now been overturned” by the European Court of Human Rights.

“Some of the communications he had sent were ‘intimate in nature’ and were sent to his brother and his fiancee, the court heard. However, his right to privacy had not been ‘adequately protected’, the apex body of the European Court of Human Rights (ECHR) has now ruled,” the BBC explained. “The ECHR also said it was not clear whether Mr Barbulescu had been warned that his communications would be monitored, and that the original court had not established specifically why the monitoring had taken place. As it is the highest court there can be no further appeal.”

According to a document on the ECHR’s website, the court’s decision “does not mean that employers cannot, under any circumstances, monitor employees’ communications or that they cannot dismiss employees for using the internet at work for private purposes.”

“However, the Court considers that States should ensure that, when an employer takes measures to monitor employees’ communications, these measures are accompanied by adequate and sufficient safeguards against abuse,” they declared.

Charlie Nash is a reporter for Breitbart Tech. You can follow him on Twitter @MrNashington and Gab @Nash, or like his page at Facebook.