Hi,
Am trying OX on Smack 4.4.0 alpha2 (Since I cannot login with alpha3) and Openfire 4.5.1 (if that is relevant).
I have faced a problem that I cannot understand. I have tried to get as much information as I can. The error happens on openPgpManager.announceSupportAndPublish()
(see below code) and am not sure how node stuff actually works.
Do I need to configure anything on the server?
Here is the code I use to test
private fun setupOpenPGP(conn: XMPPTCPConnection) {
val openPgpManager: OpenPgpManager = OpenPgpManager.getInstanceFor(connection)
val store = FileBasedOpenPgpStore(filesDir)
val provider: OpenPgpProvider = PainlessOpenPgpProvider(connection, store)
openPgpManager.openPgpProvider = provider
if (!openPgpManager.hasSecretKeysAvailable()) {
openPgpManager.generateAndImportKeyPair(conn.user.asBareJid())
}
openPgpManager.announceSupportAndPublish()
val instantManager = OXInstantMessagingManager.getInstanceFor(conn)
instantManager.addOxMessageListener { contact, _, decryptedPayload, _ ->
val body = decryptedPayload.getExtension<Message.Body>(
Message.Body.ELEMENT,
Message.Body.NAMESPACE
)
Toast.makeText(this, body.message, Toast.LENGTH_LONG).show()
Toast.makeText(this, contact.jid.toString(), Toast.LENGTH_LONG).show()
}
//announce I support OpenGPG messages
instantManager.announceSupportForOxInstantMessaging()
}
I get an error item-not-found
Here is the XMPP Log
2020-06-08 16:38:49.323 9378-21020/com.example.app D/SMACK: SENT (9):
<iq id='8P33H-408' type='set'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<create node='urn:xmpp:openpgp:0:public-keys:CDC71633EA022AD61C7AC18F9D4449CD36D24741'/>
</pubsub>
</iq>
2020-06-08 16:38:49.505 9378-21021/com.example.app D/SMACK: RECV (9):
<iq type="error" id="8P33H-408" from="2547445443433@192.168.1.101" to="2547445443433@192.168.1.101/Tulonge">
<pubsub xmlns="http://jabber.org/protocol/pubsub">
<create node="urn:xmpp:openpgp:0:public-keys:CDC71633EA022AD61C7AC18F9D4449CD36D24741"/>
</pubsub>
<error code="409" type="cancel">
<conflict xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error>
</iq>
<r xmlns='urn:xmpp:sm:3' />
2020-06-08 16:38:49.658 9378-21020/com.example.app D/SMACK: SENT (9):
<a xmlns='urn:xmpp:sm:3' h='20'/>
<iq id='8P33H-410' type='get'>
<query xmlns='http://jabber.org/protocol/disco#info' node='urn:xmpp:openpgp:0:public-keys:CDC71633EA022AD61C7AC18F9D4449CD36D24741'>
</query>
</iq>
2020-06-08 16:38:49.799 9378-21021/com.example.app D/SMACK: RECV (9):
<iq type="error" id="8P33H-410" to="2547445443433@192.168.1.101/Tulonge">
<query xmlns="http://jabber.org/protocol/disco#info" node="urn:xmpp:openpgp:0:public-keys:CDC71633EA022AD61C7AC18F9D4449CD36D24741">
</query>
<error code="404" type="cancel">
<item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error>
</iq>
I have traced down the exception and found that it occurs here: