/**
   * Constructor
   *
   * @param imService InstantMessagingService
   * @param chatSession the chat session
   * @param fileTransferInfo the File transfer info document
   * @param fileTransferId the File transfer Id
   * @param contact the remote contact Id
   * @param displayName the display name of the remote contact
   * @param rcsSettings
   * @param messagingLog
   * @param timestamp
   * @param timestampSent
   * @param contactManager
   */
  public DownloadFromInviteFileSharingSession(
      InstantMessagingService imService,
      ChatSession chatSession,
      FileTransferHttpInfoDocument fileTransferInfo,
      String fileTransferId,
      ContactId contact,
      String displayName,
      RcsSettings rcsSettings,
      MessagingLog messagingLog,
      long timestamp,
      long timestampSent,
      ContactManager contactManager) {

    // @formatter:off
    super(
        imService,
        fileTransferInfo.getLocalMmContent(),
        fileTransferInfo.getExpiration(),
        fileTransferInfo.getFileThumbnail() == null
            ? null
            : fileTransferInfo.getFileThumbnail().getLocalMmContent(fileTransferId),
        getFileIconExpiration(fileTransferInfo.getFileThumbnail()),
        contact,
        chatSession.getContributionID(),
        fileTransferId,
        chatSession.isGroupChat(),
        fileTransferInfo.getUri(),
        rcsSettings,
        messagingLog,
        timestamp,
        getRemoteSipId(chatSession),
        contactManager);
    // @formatter:on

    mTimestampSent = timestampSent;

    setRemoteDisplayName(displayName);

    if (fileTransferInfo.getFileThumbnail() != null) {
      mIconRemoteUri = fileTransferInfo.getFileThumbnail().getUri();
    } else {
      mIconRemoteUri = null;
    }
    if (shouldBeAutoAccepted()) {
      setSessionAccepted();
    }
  }
 private static String getRemoteSipId(ChatSession session) {
   ContactHeader inviteContactHeader =
       (ContactHeader) session.getDialogPath().getInvite().getHeader(ContactHeader.NAME);
   if (inviteContactHeader == null) {
     return null;
   }
   return inviteContactHeader.getParameter(SipUtils.SIP_INSTANCE_PARAM);
 }