Intelligence officials maintained a chatroom to discuss polyamory and transgender surgeries, internal documents reveal.