Some more insights:
- When do we call the filelink "Fallback"?
The file transfer is initiated by calling libpurple method |sendFile|.
After that we try to send the file with IBB method(speaking specifically to
our implementation). And if that fails then we try to fallback method:
Filelink.
What I've thought of the this fallback mechanism is as follows:
We will be having a status of a file transfer. And we will have
observers listening to these status. Thus whenever the status of a file
transfer changes, the prpl will be notified and we can act
accordingly(similar to how I'm handling the ui changes in the current
patch) Thus we will get notified of the change in the status of the file
transfer. Now following can be the scenarios where we would want to try
Filelink
- User doesn't want the file through IBB. This is known when the reply
to initiate ibb session receives an error. Then we would want to send the
file through the FileLink. This point is subjective.
- FileSize is too big to be"practically" transferred through IBB.
This is known in the starting of the file transfer. Thus this can be
handled pretty easily.
- The transfer is stopped abruptly. This is the case when the ibb
file transfer was initiated, and some data stanzas were transmitted, but
transfer is on hold right now. This will be known when we are
waiting for a
response to a stanza but we haven't received it for a long time. We cans
set a timeout limit. This timeout will be fixed as we are sending 4096
bytes each time, so timeout can be 1-2 minutes?
In all these cases we need to use Filelink and stop the ongoing ibb
transfer. This can be handled with notifications as I mentioned.
- Where/How will the fileLink method be called.
There are few options to exactly where this method would be called.
1. In sendFile method. But for this we'll require some changes in the
notification method which I proposed above.
2. In the libpurple where we are getting notification about the
status of File
3. We can have a function in prplIFileTransfer which will be called
when we a corresponding notification is arrived.
Again this is very much depend on how we are going to implement the
notification of status changes.
- How does prpl tell the backend that transfer has failed and we need to
start fileLink
This can be done by sending status changes to prpl about the current
file transfer and then prpl will decide if it's a case in which we want to
start the filelink, and if yes, it will call a proper method(maybe defined
in prplIFileTransfer) to do so.
- How can we integrate the fileLink into ib.
Most of the coding is done. We'll be changing the ui to suit IB and this
will require some major changes to suit our UI. But I guess UI can be
tackled later, after we have a working filelink and fallback mechanism.
- Do we want to try the fileLink if the person rejected the file
transfer?
I would like this to be user adjustable. This will depend on many
parameters, mainly user's bandwidth. Would it be feasible to upload a 500MB
iso to a receiver who rejected the file transfer request?
There are some things which I thought of. Presently I'm working on creating
an actual flow of things, how I expect the function callback. I will send
another mail regarding that.
I would like to hear your views on this.
Thanks
> _______________________________________________
> dev-chat mailing list
>
dev-...@lists.mozilla.org
>
https://lists.mozilla.org/listinfo/dev-chat
>
--
Atul Jangra
Computer Science and Engineering
Indian Institute of Technology ,Delhi