[next] Fix FileTransfer ContentHash property
@jonnylamb
Submitted by Jonny Lamb Assigned to Telepathy bugs list
Description
Now that we've got a next branch, we can fix this:
FileTransfer.ContentHash is really annoying because it means the person requesting the channel must be the one who hashes the file.
We should fix this by:
-
specifying that the file send request is sent when ProvideFile() is called, and not when the new channel is created.
-
making ContentHash and ContentHashType mutable before ProvideFile() has been called (just like the URI property). Of course for incoming file transfers, it's always immutable.
So here is the outgoing file transfer case:
- request a FileTransfer channel in some dummy app with:
{ ChannelType: FileTransfer, TargetHandleType: CONTACT, TargetID: "foo@bar.com", URI="file:///home/user/party.jpg" }
- the appropriate channel appears and another app is activated as the handler. The handler sees the file is /home/user/party.jpg and hashes it to get the hash "abcdefghijklmnopqrstuvwxyz". So calls:
Set("FileTransfer", "ContentHashType", 1337) Set("FileTransfer", "ContentHash", "abcdefghijklmnopqrstuvwxyz")
-
the handler then calls ProvideFile().
-
the CM then sends the, say, SI file transfer stanza.
The incoming transfer case is pretty much the same. How does this sound then?
Version: git master