public IChatMessage sendMessage2(Geoloc geoloc) throws RemoteException {
  if (geoloc == null) {
    throw new ServerApiIllegalArgumentException("Geoloc message must not be null!");
  }
  if (!isAllowedToSendMessage()) {
    throw new ServerApiPermissionDeniedException("Not allowed to send Geoloc message on the connected IMS server!");
  }
  String label=geoloc.getLabel();
  if (label != null) {
    int labelLength=label.length();
    int labelMaxLength=mRcsSettings.getMaxGeolocLabelLength();
    if (labelLength > labelMaxLength) {
      throw new ServerApiIllegalArgumentException("geoloc message label length: " + labelLength + " exeeds max length: "+ labelMaxLength+ "!");
    }
  }
  try {
    long timestamp=System.currentTimeMillis();
    final ChatMessage geolocMsg=ChatUtils.createGeolocMessage(null,geoloc,timestamp,timestamp);
    ChatMessagePersistedStorageAccessor persistedStorage=new ChatMessagePersistedStorageAccessor(mMessagingLog,geolocMsg.getMessageId(),geolocMsg.getRemoteContact(),geolocMsg.getContent(),geolocMsg.getMimeType(),mChatId,Direction.OUTGOING);
    addOutgoingGroupChatMessage(geolocMsg,Content.Status.QUEUED,Content.ReasonCode.UNSPECIFIED);
    if (!mChatService.isGroupChatActive(mChatId)) {
      mChatService.setGroupChatStateAndReasonCode(mChatId,GroupChat.State.STARTED,GroupChat.ReasonCode.UNSPECIFIED);
    }
    mImService.tryToDequeueGroupChatMessagesAndGroupFileTransfers(mChatId);
    return new ChatMessageImpl(persistedStorage);
  }
 catch (  ServerApiBaseException e) {
    if (!e.shouldNotBeLogged()) {
      sLogger.error(ExceptionUtil.getFullStackTrace(e));
    }
    throw e;
  }
catch (  Exception e) {
    sLogger.error(ExceptionUtil.getFullStackTrace(e));
    throw new ServerApiGenericException(e);
  }
}

public IChatMessage sendMessage2 ( Geoloc geoloc ) throws RemoteException { if ( geoloc == null ) { throw new ServerApiIllegalArgumentException ( "Geoloc message must not be null!" ) ; } if ( ! isAllowedToSendMessage ( ) ) { throw new ServerApiPermissionDeniedException ( "Not allowed to send Geoloc message on the connected IMS server!" ) ; } String label = geoloc . getLabel ( ) ; if ( label != null ) { int labelLength = label . length ( ) ; int labelMaxLength = mRcsSettings . getMaxGeolocLabelLength ( ) ; if ( labelLength > labelMaxLength ) { throw new ServerApiIllegalArgumentException ( "geoloc message label length: " + labelLength + " exeeds max length: " + labelMaxLength + "!" ) ; } } try { long timestamp = System . currentTimeMillis ( ) ; final ChatMessage geolocMsg = ChatUtils . createGeolocMessage ( null , geoloc , timestamp , timestamp ) ; ChatMessagePersistedStorageAccessor persistedStorage = new ChatMessagePersistedStorageAccessor ( mMessagingLog , geolocMsg . getMessageId ( ) , geolocMsg . getRemoteContact ( ) , geolocMsg . getContent ( ) , geolocMsg . getMimeType ( ) , mChatId , Direction . OUTGOING ) ; addOutgoingGroupChatMessage ( geolocMsg , Content . Status . QUEUED , Content . ReasonCode . UNSPECIFIED ) ; if ( ! mChatService . isGroupChatActive ( mChatId ) ) { mChatService . setGroupChatStateAndReasonCode ( mChatId , GroupChat . State . STARTED , GroupChat . ReasonCode . UNSPECIFIED ) ; } mImService . tryToDequeueGroupChatMessagesAndGroupFileTransfers ( mChatId ) ; return new ChatMessageImpl ( persistedStorage ) ; } catch ( ServerApiBaseException e ) { if ( ! e . shouldNotBeLogged ( ) ) { sLogger . error ( ExceptionUtil . getFullStackTrace ( e ) ) ; } throw e ; } catch ( Exception e ) { sLogger . error ( ExceptionUtil . getFullStackTrace ( e ) ) ; throw new ServerApiGenericException ( e ) ; } }
sends a geoloc message
