Open jyhong836 opened 9 years ago
The 'drag and drop file' and 'copy and paste file' feature is viewed same in cocoa.
Now I'm working for sending file from path, which means unsupported for URL or images context.
The NSFileWrapper require an existing file for wrapper. However, in the sending message could not include absolute file path. That's an issue.
:warning: When use target account without any resource, the FileTransferManager will try to search for resource who capable for file transfer at highest priority. Refer to FileTransferManagerImpl.cpp:103
,
boost::optional<JID> FileTransferManagerImpl::highestPriorityJIDSupportingFileTransfer(const JID& bareJID) {
JID fullReceipientJID;
int priority = INT_MIN;
//getAllPresence(bareJID) gives you all presences for the bare JID (i.e. all resources) Isode Limited. @ 11:11
std::vector<Presence::ref> presences = presenceOracle->getAllPresence(bareJID);
//iterate over them
foreach(Presence::ref pres, presences) {
if (pres->getPriority() > priority) {
// look up caps from the jid
DiscoInfo::ref info = capsProvider->getCaps(pres->getFrom());
if (isSupportedBy(info)) {
priority = pres->getPriority();
fullReceipientJID = pres->getFrom();
}
}
}
return fullReceipientJID.isValid() ? boost::optional<JID>(fullReceipientJID) : boost::optional<JID>();
}
But it always return NULL, in GUI situation, not in xctest.
The reason may be the presence is not found.
I have checked, there is no error with presence getting. The client I tested with has no file transfer feature.
Now I'm working for issue #25, to solve the NSTextAttachment UI bug. So this issue would be delayed for some time.
File transfer is a necessary function for current users. User should be abel to drag file into the client for transfer.