A man has attacked a friend at a party over Facebook messages between his partner and the victim.

Colin Peter Smith, 34, pleaded guilty to assault with intent to injure and was sentenced in the Whanganui District Court yesterday.

Smith was at a house party on August 19 when he read a Facebook message on his tablet and "became upset" police prosecutor Sergeant Rachel Willemsen told the court.

The victim, who Smith has known for about three years, was a tenant at the house, and was lying on a bed in the living room when Smith walked in and threw the tablet to him to read.

Advertisement

Smith began yelling and then pinned the victim against the bed and the wall and punched him around the head and shoulders, Ms Willemsen said.

The attack lasted about 30 seconds before Smith left.

"The victim sustained bruising and fluid in his shoulder."

Smith, who pleaded guilty to assault with intent to injure, has a criminal history which includes violence and dishonesty convictions.

Defence lawyer Raukawa Simon said the messages Smith read had been between his partner and the victim.

Judge David Cameron sentenced Smith to four months of community detention.