-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implements Send File for both IM and CHAT conversations. #85
base: master
Are you sure you want to change the base?
Conversation
What about implementing it via the file transfer api? Then you'd be able to drag-drop files to send on the conversation window |
I think that in order to implement drag&drop plugin has to implement PIDGIN_PLUGIN_TYPE ? (not sure .. but for example purple_blist_get/set_ui_ops() does not work at present either ? ). This PR uses transfer api (well, just a part of it, purple 'thinks' that the transfer finished OK just after we read the file and are about to start sending it to MM). I will have a look at how to implement proper update_progress and destroy callbacks, What I wanted to have is 'Send File' option in conversation window: that works for buddies, but does not for chats: see around line 370 of libmattermost.c -> I get there a chat blist node .. but it points 'nowhere' - does not have any chat components set .. etc. as a result we were coming to mm_send_file_menu_cb .. not knowing from which chat we are called ..not sure how to solve that. .. - that's why the /sendfile command for chats .. (iterating over all conversations and checking purple_conversation_has_focus() ? ..) |
The commented out code there looks good. In what case does the bnode struct in mm_send_file_menu_cb() not have the chat components? |
Looking at other code that uses the blistnode functions for chats, it can be possible for the id to not be set as a component if its not saved to the buddy list. Other code falls-back to using |
Using |
'''purple_chat_get_name'()'' returns chat alias - which could have been changed by user.. so not good here. However I think I found a workaround searching for focused conversation window and getting chat id from there - please check if that works for libpurple 3 ..
|
Ah yeah, I forgot that I've just tried Conversation->More->Leave Chat on another prpl, and it has all the chat components. How did you join the chat? Was it opened from the buddy list or was it opened from the Tools->Room Listi menu? |
Opened from buddy list. (BTW: checked
|
.. just discovered that it is possible to initiate transfer with undefined |
Indeed, not portable: but if UI does not implement it the 'Send File' action will not work, in that case maybe just presenting a message that it is not implemented and enabling /sendfile would be a workaround until better implementation can be found ? |
OK, current version of patch enables |
I've tried the code and when I send a file to a peer, it is corrupted. The size is OK, but checksum does not match. Edit: I've located the problem and created a pull request for this branch. When receiving file, I get |
fixed file reading during send
Is there anything preventing this PR from merging? It works for me, but I cannot test every platform. |
The main issues I have with the PR is the inconsistent UI with the file transfer API. Also, re-reviewing the code, it looks like it tries to load the entire file into memory, rather than sending it in chunks. The latest change in 2a56dcd looks like it only looks at the |
Since we can send images , lets extend it and allow sending any files to chat/im conversations: unfortunately somehow adding ui menu to chat 'Conversation' menu does not work (lines ~ 379) , therefore in chats files can be sent using '/sendfile' command while in im convs -> using Conversation -> Send File menu ...