Sentencing had been adjourned from a previous court so that a pre-sentence report could be obtained.

Deputy District Judge Neil Rafferty wondered if this came within the guidelines of revenge pornography.

The prosecutor said that acts were calculated to humiliate the injured party and intimidate her with photographs on social media. The second count of harassment happened after Gibson had been released on bail.

A barrister representing the defendant said it was a nasty series of events and Gibson called her not very nice names.

He explained that his client found it hard to accept the relationship was over and that his ex-partner may have been interested in someone else.

The barrister added that jealously led him to going round to her house at night. She had left the back door open and allowed him to come in but there was another argument.

Gibson snapped the phone from her wrist and took her keys which he threw into the garden next door.

He added that this happened in June and July last year and since then there have been no further issues.

The prosecutor said that the injured party said Gibson had messaged her friends with pictures of her and him together without her permission but there was nothing about her being half dressed in her statement.

Judge Rafferty said he would draw inference from that in favour of the defendant but he added that the court was going to be robust given the nature of the offences.

He told Gibson that ‘a woman is not your property’ and he could not humiliate, brow beat or harass her into doing what he wanted.

“You are not a caveman. This is the 21st century,” added the judge who told Gibson he was ‘just about’ staying out of jail on this occasion.

But he warned him that if he breached the restraining order or acted in this way again he would be going to jail for a significant period of time.