robbiehanson / XMPPFramework

An XMPP Framework in Objective-C for Mac and iOS
Other
5.91k stars 2.09k forks source link

FileTransfer - with Potential Fix: "Unable to send SI offer; the recipient doesn't have the required features." #1230

Open dpasirst opened 1 year ago

dpasirst commented 1 year ago

XMPPFramework: 4.1.0 Running with eJabberd 23.04

Setup both sides with:

xmppIncommingFileTranser = XMPPIncomingFileTransfer()
xmppIncommingFileTranser.disableIBB = false
xmppIncommingFileTranser.disableSOCKS5 = false

fileTransfer = XMPPOutgoingFileTransfer(dispatchQueue: DispatchQueue.main)
fileTransfer.disableIBB = false
fileTransfer.disableSOCKS5 = false

Client 1 sends the transfer request to Client 2, Client 2 responds to Client 1 with:

<iq xmlns="jabber:client" lang="en" to="client1@aaa.bbb/ccc" from="client2@aaa.bbb/ddd" type="result" id="20AB1C3E-CEDD-4A7B-9512-28F50F2DFBDB">
  <query xmlns="http://jabber.org/protocol/disco#info">
  <identity category="client" type="ios-osx"></identity>
    <feature var="http://jabber.org/protocol/si"></feature>
    <feature var="http://jabber.org/protocol/si/profile/file-transfer"></feature>
    <feature var="http://jabber.org/protocol/bytestreams"></feature>
    <feature var="http://jabber.org/protocol/ibb"></feature>
  </query>
</iq>

XMPPFramework on Client 1: results in "Unable to send SI offer; the recipient doesn't have the required features."

I tracked it down to this file: XMPPFramework/Extensions/FileTransfer/XMPPOutgoingFileTransfer.m LINE: 1048 NSXMLElement *query = [iq elementForName:@"query"]; The result of that line is query is NULL.
Changing that line to NSXMLElement *query = [iq childElement]; seems to fix the issue, but I'm not sure if it is specific enough to be a proper fix.