public void changeSubject ( final String subject ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { Message message = createMessage ( ) ; message . setSubject ( subject ) ; // Wait for an error or confirmation message back from the server. StanzaFilter responseFilter = new AndFilter ( fromRoomGroupchatFilter , new StanzaFilter ( ) { @ Override public boolean accept ( Stanza packet ) { Message msg = ( Message ) packet ; return subject . equals ( msg . getSubject ( ) ) ; } } ) ; StanzaCollector response = connection . createStanzaCollectorAndSend ( responseFilter , message ) ; // Wait up to a certain number of seconds for a reply. response . nextResultOrThrow ( ) ; }
Changes the subject within the room . As a default only users with a role of moderator are allowed to change the subject in a room . Although some rooms may be configured to allow a mere participant or even a visitor to change the subject .