A court jailed a prominent former lawyer for three years over Facebook posts, a ruling condemned by rights groups as a fresh attack on freedom of expression in the country.