def _build_room_occupant(self, txtrep): node, domain, resource = split_identifier(txtrep) return self.roomoccupant_factory(node, domain, resource, self.query_room(node + '@' + domain), aclattr=self._find_user(resource, 'name'))
def build_reply(self, mess, text=None, private=False): response = super().build_reply(mess=mess, text=text, private=private) if mess.is_group and mess.frm == response.to: # HipChat violates the XMPP spec :( This results in a valid XMPP JID # but HipChat mangles them into stuff like # "[email protected]/none||proxy|pubproxy-b100.hipchat.com|5292" # so we request the user's proper JID through their API and use that here # so that private responses originating from a room (IE, DIVERT_TO_PRIVATE) # work correctly. node, domain, resource = split_identifier(self.username_to_jid(response.to.client)) response.to = XMPPPerson(node=node, domain=domain, resource=resource) return response