quote:
Originally posted by SourSpud
would that be hard matty?
To start with, see your other thread where you asked the opposite (to check when a file transfer, which you have initiated, finishes):
dont show sent file
Everything said there applies for this too.
Thus also the complexity of the whole thing. Although for checking when the file has been recieved, it is a bit less complex because you don't need to deal with so many possible messages.
However, the counter side is that, as matty said, you need to constantly poll and process the history text which can take a relative fair bit of processing by Messenger and thus might slow things down depending on the frequency of checking.
Nutshell: yes, it is possible for files _other_ than pictures, in most cases*, and it would be easier than the other way around, but it comes with a downside: the need to constant poll the history.
* there is always one scenario where such stuff will fail: if you or your contact initiated a transfer and cancels the transfer before something is send and before saying anything else. In that case no action message is send to either of you and thus this can not be detected by these methods.
-------------------------
However, it is not possible with these methods to detect the file type before the file is actually successfully received. So you can not automatically accept just a picture and not accept the rest. You need to accept all files.
This said, even files with other extensions can be pictures too. And vice-versa: a file with the extension png, jpg or gif is not always a real picture. Especially for the png file type, it is sometimes used to send a desguised virus. Hence the png file type is considered more dangerous than the others. There actually once was a big security hole in Windows, and thus Messenger, regarding this (when you opened a special crafted PNG file in a MS program, remote code could be executed).
But more importantly: to do what you want your contact also needs to disable Photo Sharing! And seeing that most people haven't disabled Photo Sharing (can only be done by patching messenger because there is no out-of-the-box option for it), the picture will always be sent with Photo Sharing, making this whole 'constantly check history' method completely useless. In fact, a file transfer wont be used at all when your contact sends you a picture.