jyhong836 / Vivi

Vivi is a XMPP chatting client on OS X.
GNU General Public License v2.0
1 stars 0 forks source link

File transfer #3

Open jyhong836 opened 9 years ago

jyhong836 commented 9 years ago

File transfer is a necessary function for current users. User should be abel to drag file into the client for transfer.

jyhong836 commented 9 years ago

The 'drag and drop file' and 'copy and paste file' feature is viewed same in cocoa.

jyhong836 commented 9 years ago

Now I'm working for sending file from path, which means unsupported for URL or images context.

jyhong836 commented 8 years ago

The NSFileWrapper require an existing file for wrapper. However, in the sending message could not include absolute file path. That's an issue.

jyhong836 commented 8 years ago

: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.

jyhong836 commented 8 years ago
  1. [x] Check if it goes wrong with presence.
  2. [ ] The presence should be bond to resource.
jyhong836 commented 8 years ago

I have checked, there is no error with presence getting. The client I tested with has no file transfer feature.

jyhong836 commented 8 years ago

Now I'm working for issue #25, to solve the NSTextAttachment UI bug. So this issue would be delayed for some time.