From 9ffcb060f6e3480ab8b4bcba2c8040eee1510c0e Mon Sep 17 00:00:00 2001 From: 4ndreaSt4gi Date: Tue, 22 Feb 2011 01:40:55 +0100 Subject: [PATCH] Fixed send and receive preview in filetransfer --- papyon/msnp2p/filetransfer.py | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/papyon/msnp2p/filetransfer.py b/papyon/msnp2p/filetransfer.py index af07d04..1b0fda7 100644 --- a/papyon/msnp2p/filetransfer.py +++ b/papyon/msnp2p/filetransfer.py @@ -84,6 +84,10 @@ class FileTransferSession(P2PSession): self._size = info[2] self._has_preview = not bool(info[4]) self._filename = unicode(context[20:570], "utf-16-le").rstrip("\x00") + + if(self._has_preview): + self._preview = context[574:] + except: raise FTParseError(context) @@ -92,6 +96,8 @@ class FileTransferSession(P2PSession): context = struct.pack("<5I", 574, 2, self._size, 0, int(self._has_preview)) context += struct.pack("550s", filename) context += "\xFF" * 4 + if(self._data!=None): + context += self._data return context def _on_session_accepted(self): -- 1.7.1