mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-14 09:01:08 +01:00
Use Jid (and subclasses) from jxmpp-jid
Fixes SMACK-634
This commit is contained in:
parent
0ee2d9ed1e
commit
5bb4727c57
180 changed files with 1510 additions and 1032 deletions
|
|
@ -40,6 +40,7 @@ import org.jivesoftware.smack.packet.XMPPError;
|
|||
import org.jivesoftware.smack.packet.XMPPError.Condition;
|
||||
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||
import org.jivesoftware.smackx.iqlast.packet.LastActivity;
|
||||
import org.jxmpp.jid.Jid;
|
||||
|
||||
/**
|
||||
* A last activity manager for handling information about the last activity
|
||||
|
|
@ -233,7 +234,7 @@ public class LastActivityManager extends Manager {
|
|||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public LastActivity getLastActivity(String jid) throws NoResponseException, XMPPErrorException,
|
||||
public LastActivity getLastActivity(Jid jid) throws NoResponseException, XMPPErrorException,
|
||||
NotConnectedException, InterruptedException {
|
||||
LastActivity activity = new LastActivity(jid);
|
||||
return (LastActivity) connection().createPacketCollectorAndSend(activity).nextResultOrThrow();
|
||||
|
|
@ -249,7 +250,7 @@ public class LastActivityManager extends Manager {
|
|||
* @throws NoResponseException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public boolean isLastActivitySupported(String jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
public boolean isLastActivitySupported(Jid jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
return ServiceDiscoveryManager.getInstanceFor(connection()).supportsFeature(jid, LastActivity.NAMESPACE);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import java.io.IOException;
|
|||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.provider.IQProvider;
|
||||
import org.jxmpp.jid.Jid;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
|
|
@ -47,7 +48,7 @@ public class LastActivity extends IQ {
|
|||
setType(IQ.Type.get);
|
||||
}
|
||||
|
||||
public LastActivity(String to) {
|
||||
public LastActivity(Jid to) {
|
||||
this();
|
||||
setTo(to);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue