Rights groups have condemned the sentence, made under a controversial online hate-speech law.