powered by Jive Software

PATCH: Set file info in all send* methods

Currently, only one of the send* methods in OutgoingFileTransfer calls setFileInfo() in the super class. This patch makes getFileName() and getFileSize() in all FileTransfer objects, incoming as well as outgoing, return meaningful data.

Index: source/org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer.java

— source/org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer.java (revision 10957)
+++ source/org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer.java (working copy)
@@ -120,6 +120,7 @@
+ " been attempted on this file transfer");
}
try {

  •                   setFileInfo(fileName, fileSize);
                      this.outputStream = negotiateStream(fileName, fileSize, description);
              } catch (XMPPException e) {
                      handleXMPPException(e);
    

@@ -159,6 +160,7 @@
“The negotation process has already”
+ " been attempted for this file transfer");
}

  •    setFileInfo(fileName, fileSize);
       this.callback = progress;
       transferThread = new Thread(new Runnable() {
                      public void run() {
    

@@ -274,6 +276,7 @@
public synchronized void sendStream(final InputStream in, final String fileName, final long fileSize, final String description){
checkTransferThread();

  •           setFileInfo(fileName, fileSize);
             transferThread = new Thread(new Runnable() {
                     public void run() {
              //Create packet filter

Can you attach your patch in diff patch form here? I will then attach it to SMACK-263

Sure.
set-file-info.patch (1205 Bytes)

Attached

Fixed in the Smack community patch repo:

http://repo.or.cz/w/Smack.git?h=refs/heads/smack-3.1.1

in commit

http://repo.or.cz/w/Smack.git?a=commit;h=71b75b942e02d89c8490659adac76d496ff9f98 6