1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-09 10:19:41 +02:00

Improve PepManager.publish()

by using PubSubManager.tryToPublishAndPossibleAutoCreate().

This also swaps the parameters of the method.

Thanks to Guus der Kinderen for suggesting this.
This commit is contained in:
Florian Schmaus 2019-08-28 22:50:58 +02:00
parent 851bd3c5dd
commit 4249c1a845
5 changed files with 57 additions and 32 deletions

View file

@ -39,6 +39,7 @@ import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.tcp.XMPPTCPConnection;
import org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration;
import org.jivesoftware.smackx.carbons.packet.CarbonExtension;
import org.jivesoftware.smackx.muc.MultiUserChat;
import org.jivesoftware.smackx.omemo.OmemoManager;
@ -56,6 +57,7 @@ import org.jivesoftware.smackx.omemo.signal.SignalOmemoService;
import org.jivesoftware.smackx.omemo.trust.OmemoFingerprint;
import org.jivesoftware.smackx.omemo.trust.OmemoTrustCallback;
import org.jivesoftware.smackx.omemo.trust.TrustState;
import org.jivesoftware.smackx.pubsub.PubSubException;
import org.jxmpp.jid.BareJid;
import org.jxmpp.jid.EntityBareJid;
@ -202,7 +204,7 @@ public class OmemoClient {
try {
omemoManager.purgeDeviceList();
print("Purged.");
} catch (XMPPException.XMPPErrorException | SmackException.NoResponseException e) {
} catch (XMPPException.XMPPErrorException | SmackException.NoResponseException | PubSubException.NotALeafNodeException e) {
LOGGER.log(Level.SEVERE, "Unexpected Exception", e);
}
}