src/net/java/sip/communicator/impl/protocol/jabber/OutgoingFileTransferJabberImpl.java
/**
     * Listens for all <tt>StreamInitiation</tt> packets and adds a thumbnail
     * to them if a thumbnailed file is supported.
     */
Listens for all StreamInitiation packets and adds a thumbnail
to them if a thumbnailed file is supported.
Listens for all StreamInitiation packets and adds a thumbnail to them if a thumbnailed file is supported .
@Override
    public void processStanza(Stanza packet)
    {
        if (!(file instanceof ThumbnailedFile))
            return;
        logger.debug("File transfer packet intercepted to add thumbnail");
        StreamInitiation fileTransferPacket = (StreamInitiation) packet;
        ThumbnailedFile thumbnailedFile = (ThumbnailedFile) file;
        if (jabberTransfer.getStreamID()
                .equals(fileTransferPacket.getSessionID()))
        {
            StreamInitiation.File file = fileTransferPacket.getFile();
            BoBData bobData = new BoBData(
                thumbnailedFile.getThumbnailMimeType(),
                thumbnailedFile.getThumbnailData());
            BoBManager bobManager = BoBManager.getInstanceFor(protocolProvider.getConnection());
            bobInfo = bobManager.addBoB(bobData);
            thumbnailElement = new Thumbnail(
                thumbnailedFile.getThumbnailData(),
                thumbnailedFile.getThumbnailMimeType(),
                thumbnailedFile.getThumbnailWidth(),
                thumbnailedFile.getThumbnailHeight());
            ThumbnailFile fileElement = new ThumbnailFile(file, thumbnailElement);
            fileTransferPacket.setFile(fileElement);
            if (logger.isDebugEnabled())
                logger.debug("The file transfer packet with thumbnail: "
                + fileTransferPacket.toXML());
        }
        protocolProvider.getConnection().removePacketInterceptor(this);
    }
@ Override public void processStanza ( Stanza packet ) { if ( ! ( file instanceof ThumbnailedFile ) ) return ; logger . debug ( "File transfer packet intercepted to add thumbnail" ) ; StreamInitiation fileTransferPacket = ( StreamInitiation ) packet ; ThumbnailedFile thumbnailedFile = ( ThumbnailedFile ) file ; if ( jabberTransfer . getStreamID ( ) . equals ( fileTransferPacket . getSessionID ( ) ) ) { StreamInitiation . File file = fileTransferPacket . getFile ( ) ; BoBData bobData = new BoBData ( thumbnailedFile . getThumbnailMimeType ( ) , thumbnailedFile . getThumbnailData ( ) ) ; BoBManager bobManager = BoBManager . getInstanceFor ( protocolProvider . getConnection ( ) ) ; bobInfo = bobManager . addBoB ( bobData ) ; thumbnailElement = new Thumbnail ( thumbnailedFile . getThumbnailData ( ) , thumbnailedFile . getThumbnailMimeType ( ) , thumbnailedFile . getThumbnailWidth ( ) , thumbnailedFile . getThumbnailHeight ( ) ) ; ThumbnailFile fileElement = new ThumbnailFile ( file , thumbnailElement ) ; fileTransferPacket . setFile ( fileElement ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "The file transfer packet with thumbnail: " + fileTransferPacket . toXML ( ) ) ; } protocolProvider . getConnection ( ) . removePacketInterceptor ( this ) ; }
Listens for all <tt>StreamInitiation</tt> packets and adds a thumbnail
 to them if a thumbnailed file is supported.
Listens for all <tt > StreamInitiation< / tt > packets and adds a thumbnail to them if a thumbnailed file is supported .
// If our file is not a thumbnailed file we have nothing to do here. // Remove this packet interceptor after we're done.