DOVER, Del. (AP) — Delaware’s Supreme Court has rejected an appeal from a felon convicted on gun charges after accepting a Facebook “friend” request from an undercover police officer.

A court panel on Tuesday said a detective’s viewing of 40-year-old Terrance Everett’s Facebook page did not violate constitutional prohibitions against illegal searches.

Everett was sentenced as a habitual offender last year to 15 years in prison after being convicted of possession of a firearm by a person prohibited.

Everett was arrested in 2015 after accepting a friend request about two years earlier from a detective using a fictitious Facebook profile.

The detective then used information gained from Everett’s posts, including a photo of showing a handgun on a nightstand, to obtain a search warrant for Everett’s house, where officers found a loaded 9mm pistol.