Image caption Just a joke? Laws written in the 1800s may be enough to handle 21st-century pranksters

The internet is full of attention-seeking trolls and snarky teenagers. Is the law current enough to deal with their offensive comments and threats?

In February, Justin Carter, then 18, was engaged in a Facebook dispute with someone from his online gaming community. The gamer called Carter mentally disturbed on a public wall, and Carter, with withering sarcasm and a teenager's poor judgment, wrote back:

I think Ima shoot up a kindergarten

And watch the blood of the innocent rain down

And eat the beating heart of one of them.

Carter and his lawyer insist the statement was a joke - albeit one in poor taste. But it's hard to read sarcasm over the internet.

Soon a Texas law enforcement agency received an anonymous tip from Canada. Carter's home was searched and he was arrested. Now, he's been sitting in jail for almost five months, unable to pay the $500,000 (£334,470) bond required for his release.

"His comment was facetious. It was also rude and inappropriate. But they were trash talking," says Don Flanary, a lawyer who has taken on the case pro bono.

"It's no different than what goes on in playgrounds and basketball courts and streets and neighbourhoods all the time."

Image caption A photo of Justin Carter tops an online petition, started by his mother, to free him from jail before his trial

But local police say threats like Carter's must be taken seriously after incidents like the Sandy Hook school shooting in December, in which 26 people, including 20 school children, were killed.

Carter was charged with making terroristic threats. He is scheduled to appear before a judge on 16 July, when his lawyer hopes to get the bond reduced. If the case goes to trial and he is convicted, Carter faces up to 10 years in prison.

In the meantime, British citizen Reece Elliot has been jailed for two years and four months after making an online "joke". Elliot filled a Facebook page created to memorialise a Tennessee student who died in a car crash with abusive language and threatened to open fire at a local elementary school.

His words prompted school lockdowns and forced thousands of children to miss class.

Surely the laws when drafted didn't consider the type of speech we now see on the internet, and the effect of technology Robert Weisberg, Stanford University

In Newcastle Crown Court, he admitted one count of making threats to kill and eight counts of sending grossly offensive messages.

Speaking to the Daily Mail before his sentencing, Elliot's girlfriend said his actions weren't malicious.

"He does things for a laugh on Facebook - that's what he does," she said.

In neither case was the joke particularly funny.

But the jokes bring up a debate about the limits of free speech - and whether old laws need to adapt to a new online culture.

Elliot was charged, for instance, under a law more than 150 years old. It states: "A person who without lawful excuse makes to another a threat, intending that that other would fear it would be carried out, to kill that other or a third person shall be guilty of an offence and liable on conviction on indictment to imprisonment for a term not exceeding ten years."

The law is similar in Carter's case - a threat is legitimate if the accused shows intent to do harm and the accuser has reasonable grounds to fear harm.

Elliot's specificity and the absence of any reason for people to believe he was jesting left good reason to fear he might carry out his threat. For instance, he singled out one girl for abuse after she asked him to stop commenting.

In Carter's case, his lawyer says once the facts are heard in court, his true intent will be clear.

"He didn't threaten anyone," Flanary says. "He didn't call this in to a school, a police station or a newspaper. He's saying it privately to a person online."

Still, his "private" statement was visible to others. As with much online communication, his words were on display to a much larger group of people than that which might hear similar threats on the playgrounds and basketball courts.

The medium, a 21st Century technology, also makes intent harder to discern. Does speech on social networks require new laws?

"Surely the laws, when drafted, didn't consider the type of speech we now see on the internet, and the effect of technology," says Robert Weisberg, a professor of criminal law at Stanford University.

Image caption Elliot, posting under a false name, made threats online

"But I don't think we could write a better law."

The laws as written clearly define what is a threat and what is not - and making exceptions for online behaviour would only muddy those definitions, he says.

"There's no such thing as technological exceptionalism," says Gabe Rottman, legislative council with the American Civil Liberties Union in Washington DC.

"The same principles that have always applied to speech over the phone and in one-on-one emails should also apply to social media."

Instead, it should fall on police officers and prosecutors to be more judicious about how the current laws are applied, he says.

"When you are talking about social media, where people tend to be - and should be - loose in what they say, it's important for law enforcement to look at whether this is a viable threat," says Rottman.

At the same time, a combination of high-profile prosecutions and general public frustration with crude, unfunny "jokes" could lead to an overall cooling of such speech online, without new restrictions.

"People are more careful about what they say in airports now than they used to be," says Weisberg. "Consciously or subconsciously, they have absorbed the idea that you don't joke around."