mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-14 00:51:19 +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
|
|
@ -30,6 +30,7 @@ import org.jivesoftware.smack.util.PacketParserUtils;
|
|||
import org.jivesoftware.smackx.xdata.Form;
|
||||
import org.jivesoftware.smackx.xdata.FormField;
|
||||
import org.jivesoftware.smackx.xdata.packet.DataForm;
|
||||
import org.jxmpp.jid.DomainBareJid;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
|
|
@ -66,7 +67,7 @@ public class UserSearch extends SimpleIQ {
|
|||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public Form getSearchForm(XMPPConnection con, String searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
public Form getSearchForm(XMPPConnection con, DomainBareJid searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
UserSearch search = new UserSearch();
|
||||
search.setType(IQ.Type.get);
|
||||
search.setTo(searchService);
|
||||
|
|
@ -87,7 +88,7 @@ public class UserSearch extends SimpleIQ {
|
|||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public ReportedData sendSearchForm(XMPPConnection con, Form searchForm, String searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
public ReportedData sendSearchForm(XMPPConnection con, Form searchForm, DomainBareJid searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
UserSearch search = new UserSearch();
|
||||
search.setType(IQ.Type.set);
|
||||
search.setTo(searchService);
|
||||
|
|
@ -109,7 +110,7 @@ public class UserSearch extends SimpleIQ {
|
|||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public ReportedData sendSimpleSearchForm(XMPPConnection con, Form searchForm, String searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
public ReportedData sendSimpleSearchForm(XMPPConnection con, Form searchForm, DomainBareJid searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
SimpleUserSearch search = new SimpleUserSearch();
|
||||
search.setForm(searchForm);
|
||||
search.setType(IQ.Type.set);
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import org.jivesoftware.smack.XMPPConnection;
|
|||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||
import org.jivesoftware.smackx.xdata.Form;
|
||||
import org.jxmpp.jid.DomainBareJid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -68,7 +69,7 @@ public class UserSearchManager {
|
|||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public Form getSearchForm(String searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
public Form getSearchForm(DomainBareJid searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
return userSearch.getSearchForm(con, searchService);
|
||||
}
|
||||
|
||||
|
|
@ -84,7 +85,7 @@ public class UserSearchManager {
|
|||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public ReportedData getSearchResults(Form searchForm, String searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
public ReportedData getSearchResults(Form searchForm, DomainBareJid searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
return userSearch.sendSearchForm(con, searchForm, searchService);
|
||||
}
|
||||
|
||||
|
|
@ -98,7 +99,7 @@ public class UserSearchManager {
|
|||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public List<String> getSearchServices() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
public List<DomainBareJid> getSearchServices() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
ServiceDiscoveryManager discoManager = ServiceDiscoveryManager.getInstanceFor(con);
|
||||
return discoManager.findServices(UserSearch.NAMESPACE, false, false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue