No charges are being brought against a footballer arrested after an abusive message was sent about Olympic diver Tom Daley.
Port Talbot Town FC suspended midfielder Daniel Thomas, 28, last month after a homophobic message was posted on Twitter.
The director of public prosecutions said while it may be offensive it was not considered a criminal offence.
Keir Starmer QC said the message was not meant for Daley.
Mr Thomas was arrested and released on bail after a homophobic message referring to Daley and fellow Olympic diver Peter Waterfield was posted on Twitter.
Port Talbot Town FC officials claimed the player had been the victim of a "misguided prank" after leaving his phone unattended.
In a statement confirming no charges would be brought, Mr Starmer warned people using social media websites to be careful, saying messages "intended for a few may reach millions".
He said said the time had come for "an informed debate about the boundaries of free speech in an age of social media", adding that social media is an "emerging phenomenon raising difficult issues of principle".
Mr Starmer said he was issuing new guidelines as a result of the case.
He said the message was posted on 30 July relating to the divers before being widely distributed and prompting Mr Thomas's arrest and interview.
The matter was referred to CPS (Crown Prosecution Service) Wales to consider whether Mr Thomas should be charged with a criminal offence.
The Communications Act 2003 makes it an offence to send a communication using a public electronic communications network if that communication is "grossly offensive".
Mr Starmer said: "There is no doubt that the message posted by Mr Thomas was offensive and would be regarded as such by reasonable members of society.
"But the question for the CPS is not whether it was offensive, but whether it was so grossly offensive that criminal charges should be brought."
Mr Starmer said the context and circumstances in this case showed that, however misguided, Mr Thomas intended the message to be humorous and it was not meant to go beyond his friends and family who followed him on Twitter.
He said Mr Thomas took reasonably swift action to remove the message and expressed remorse and was, for a period, suspended by his football club.
And he said that neither of the Olympians knew of the message until it was brought to their attention following reports in the media.
"This case is one of a growing number involving the use of social media that the CPS has had to consider," said Mr Starmer.
"There are likely to be many more.
"The recent increase in the use of social media has been profound."
Mr Starmer said before reaching a final decision, Mr Daley and Mr Waterfield were consulted and both said they did not think the case needed further action.
Tom Daley's agent told BBC Sport that he would not be issuing any statement on the matter.