public List < SendMessageResult > sendMessage ( List < SignalServiceAddress > recipients , List < Optional < UnidentifiedAccessPair > > unidentifiedAccess , SignalServiceDataMessage message ) throws IOException , UntrustedIdentityException { byte [ ] content = createMessageContent ( message ) ; long timestamp = message . getTimestamp ( ) ; List < SendMessageResult > results = sendMessage ( recipients , getTargetUnidentifiedAccess ( unidentifiedAccess ) , timestamp , content , false ) ; boolean needsSyncInResults = false ; for ( SendMessageResult result : results ) { if ( result . getSuccess ( ) != null && result . getSuccess ( ) . isNeedsSync ( ) ) { needsSyncInResults = true ; break ; } } if ( needsSyncInResults || ( isMultiDevice . get ( ) ) ) { byte [ ] syncMessage = createMultiDeviceSentTranscriptContent ( content , Optional . < SignalServiceAddress > absent ( ) , timestamp , results ) ; sendMessage ( localAddress , Optional . < UnidentifiedAccess > absent ( ) , timestamp , syncMessage , false ) ; } return results ; }
Send a message to a group .