private void handleGroupChannel ( JsonNode jsonChannel ) { long channelId = jsonChannel . get ( "id" ) . asLong ( ) ; api . getGroupChannelById ( channelId ) . map ( GroupChannelImpl . class :: cast ) . ifPresent ( channel -> { String oldName = channel . getName ( ) . orElseThrow ( AssertionError :: new ) ; String newName = jsonChannel . get ( "name" ) . asText ( ) ; if ( ! Objects . equals ( oldName , newName ) ) { channel . setName ( newName ) ; GroupChannelChangeNameEvent event = new GroupChannelChangeNameEventImpl ( channel , newName , oldName ) ; api . getEventDispatcher ( ) . dispatchGroupChannelChangeNameEvent ( api , Collections . singleton ( channel ) , channel . getMembers ( ) , event ) ; } } ) ; }
Handles a group channel update .