use Account.getDomain() for direct access to domain jid
This commit is contained in:
parent
b347d57848
commit
a0920b83e2
|
@ -208,7 +208,7 @@ public class ImportBackupService extends Service {
|
|||
}
|
||||
}
|
||||
final Jid jid = backupFileHeader.getJid();
|
||||
Cursor countCursor = db.rawQuery("select count(messages.uuid) from messages join conversations on conversations.uuid=messages.conversationUuid join accounts on conversations.accountUuid=accounts.uuid where accounts.username=? and accounts.server=?", new String[]{jid.getEscapedLocal(), jid.getDomain()});
|
||||
Cursor countCursor = db.rawQuery("select count(messages.uuid) from messages join conversations on conversations.uuid=messages.conversationUuid join accounts on conversations.accountUuid=accounts.uuid where accounts.username=? and accounts.server=?", new String[]{jid.getEscapedLocal(), jid.getDomain().toEscapedString()});
|
||||
countCursor.moveToFirst();
|
||||
int count = countCursor.getInt(0);
|
||||
Log.d(Config.LOGTAG, "restored " + count + " messages");
|
||||
|
|
|
@ -24,9 +24,9 @@ public class SignupUtils {
|
|||
public static Intent getTokenRegistrationIntent(final Activity activity, Jid jid, String preAuth) {
|
||||
final Intent intent = new Intent(activity, MagicCreateActivity.class);
|
||||
if (jid.isDomainJid()) {
|
||||
intent.putExtra(MagicCreateActivity.EXTRA_DOMAIN, jid.getDomain());
|
||||
intent.putExtra(MagicCreateActivity.EXTRA_DOMAIN, jid.getDomain().toEscapedString());
|
||||
} else {
|
||||
intent.putExtra(MagicCreateActivity.EXTRA_DOMAIN, jid.getDomain());
|
||||
intent.putExtra(MagicCreateActivity.EXTRA_DOMAIN, jid.getDomain().toEscapedString());
|
||||
intent.putExtra(MagicCreateActivity.EXTRA_USERNAME, jid.getEscapedLocal());
|
||||
}
|
||||
intent.putExtra(MagicCreateActivity.EXTRA_PRE_AUTH, preAuth);
|
||||
|
|
|
@ -232,10 +232,14 @@ public class Account extends AbstractEntity implements AvatarService.Avatarable
|
|||
return next != null && !next.equals(previousFull);
|
||||
}
|
||||
|
||||
public String getServer() {
|
||||
public Jid getDomain() {
|
||||
return jid.getDomain();
|
||||
}
|
||||
|
||||
public String getServer() {
|
||||
return jid.getDomain().toEscapedString();
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
@ -369,7 +373,7 @@ public class Account extends AbstractEntity implements AvatarService.Avatarable
|
|||
final ContentValues values = new ContentValues();
|
||||
values.put(UUID, uuid);
|
||||
values.put(USERNAME, jid.getLocal());
|
||||
values.put(SERVER, jid.getDomain());
|
||||
values.put(SERVER, jid.getDomain().toEscapedString());
|
||||
values.put(PASSWORD, password);
|
||||
values.put(OPTIONS, options);
|
||||
synchronized (this.keys) {
|
||||
|
@ -587,7 +591,7 @@ public class Account extends AbstractEntity implements AvatarService.Avatarable
|
|||
|
||||
public boolean isBlocked(final ListItem contact) {
|
||||
final Jid jid = contact.getJid();
|
||||
return jid != null && (blocklist.contains(jid.asBareJid()) || blocklist.contains(Jid.ofDomain(jid.getDomain())));
|
||||
return jid != null && (blocklist.contains(jid.asBareJid()) || blocklist.contains(jid.getDomain()));
|
||||
}
|
||||
|
||||
public boolean isBlocked(final Jid jid) {
|
||||
|
|
|
@ -134,12 +134,12 @@ public class Contact implements ListItem, Blockable {
|
|||
return this.systemName;
|
||||
} else if (!TextUtils.isEmpty(this.serverName)) {
|
||||
return this.serverName;
|
||||
} else if (!TextUtils.isEmpty(this.presenceName) && ((QuickConversationsService.isQuicksy() && Config.QUICKSY_DOMAIN.equals(jid.getDomain())) ||mutualPresenceSubscription())) {
|
||||
} else if (!TextUtils.isEmpty(this.presenceName) && ((QuickConversationsService.isQuicksy() && Config.QUICKSY_DOMAIN.equals(jid.getDomain().toEscapedString())) ||mutualPresenceSubscription())) {
|
||||
return this.presenceName;
|
||||
} else if (jid.getLocal() != null) {
|
||||
return JidHelper.localPartOrFallback(jid);
|
||||
} else {
|
||||
return jid.getDomain();
|
||||
return jid.getDomain().toEscapedString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -413,7 +413,7 @@ public class Contact implements ListItem, Blockable {
|
|||
}
|
||||
|
||||
public String getServer() {
|
||||
return getJid().getDomain();
|
||||
return getJid().getDomain().toEscapedString();
|
||||
}
|
||||
|
||||
public boolean setAvatar(Avatar avatar) {
|
||||
|
|
|
@ -139,7 +139,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
|
|||
if (conversation.getContact().isOwnServer()) {
|
||||
return false;
|
||||
}
|
||||
final String contact = conversation.getJid().getDomain();
|
||||
final String contact = conversation.getJid().getDomain().toEscapedString();
|
||||
final String account = conversation.getAccount().getServer();
|
||||
if (Config.OMEMO_EXCEPTIONS.CONTACT_DOMAINS.contains(contact) || Config.OMEMO_EXCEPTIONS.ACCOUNT_DOMAINS.contains(account)) {
|
||||
return false;
|
||||
|
|
|
@ -351,7 +351,7 @@ public class IqGenerator extends AbstractGenerator {
|
|||
|
||||
public IqPacket generateSetPassword(final Account account, final String newPassword) {
|
||||
final IqPacket packet = new IqPacket(IqPacket.TYPE.SET);
|
||||
packet.setTo(Jid.of(account.getServer()));
|
||||
packet.setTo(account.getDomain());
|
||||
final Element query = packet.addChild("query", Namespace.REGISTER);
|
||||
final Jid jid = account.getJid();
|
||||
query.addChild("username").setContent(jid.getLocal());
|
||||
|
@ -442,7 +442,7 @@ public class IqGenerator extends AbstractGenerator {
|
|||
public IqPacket generateCreateAccountWithCaptcha(Account account, String id, Data data) {
|
||||
final IqPacket register = new IqPacket(IqPacket.TYPE.SET);
|
||||
register.setFrom(account.getJid().asBareJid());
|
||||
register.setTo(Jid.of(account.getServer()));
|
||||
register.setTo(account.getDomain());
|
||||
register.setId(id);
|
||||
Element query = register.query(Namespace.REGISTER);
|
||||
if (data != null) {
|
||||
|
|
|
@ -265,7 +265,7 @@ public class HttpDownloadConnection implements Transferable {
|
|||
private void retrieveUrl() {
|
||||
changeStatus(STATUS_CHECKING);
|
||||
final Account account = message.getConversation().getAccount();
|
||||
IqPacket request = mXmppConnectionService.getIqGenerator().requestP1S3Url(Jid.of(account.getJid().getDomain()), mUrl.getHost());
|
||||
IqPacket request = mXmppConnectionService.getIqGenerator().requestP1S3Url(account.getDomain(), mUrl.getHost());
|
||||
mXmppConnectionService.sendIqPacket(message.getConversation().getAccount(), request, (a, packet) -> {
|
||||
if (packet.getType() == IqPacket.TYPE.RESULT) {
|
||||
String download = packet.query().getAttribute("download");
|
||||
|
|
|
@ -61,7 +61,7 @@ public class SlotRequester {
|
|||
Jid host = account.getXmppConnection().findDiscoItemByFeature(Namespace.HTTP_UPLOAD_LEGACY);
|
||||
requestHttpUploadLegacy(account, host, file, mime, callback);
|
||||
} else {
|
||||
requestP1S3(account, Jid.of(account.getServer()), file.getName(), md5, callback);
|
||||
requestP1S3(account, account.getDomain(), file.getName(), md5, callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ public abstract class AbstractParser {
|
|||
|
||||
public static MucOptions.User parseItem(Conversation conference, Element item, Jid fullJid) {
|
||||
final String local = conference.getJid().getLocal();
|
||||
final String domain = conference.getJid().getDomain();
|
||||
final String domain = conference.getJid().getDomain().toEscapedString();
|
||||
String affiliation = item.getAttribute("affiliation");
|
||||
String role = item.getAttribute("role");
|
||||
String nick = item.getAttribute("nick");
|
||||
|
|
|
@ -617,7 +617,7 @@ public class DatabaseBackend extends SQLiteOpenHelper {
|
|||
cursor.getString(cursor.getColumnIndex(Account.USERNAME)),
|
||||
cursor.getString(cursor.getColumnIndex(Account.SERVER)),
|
||||
null
|
||||
).getDomain();
|
||||
).getDomain().toEscapedString();
|
||||
} catch (IllegalArgumentException ignored) {
|
||||
Log.e(Config.LOGTAG, "Failed to migrate Account SERVER "
|
||||
+ cursor.getString(cursor.getColumnIndex(Account.SERVER))
|
||||
|
|
|
@ -2205,7 +2205,7 @@ public class XmppConnectionService extends Service {
|
|||
callback.onAccountCreated(account);
|
||||
if (Config.X509_VERIFICATION) {
|
||||
try {
|
||||
getMemorizingTrustManager().getNonInteractive(account.getJid().getDomain()).checkClientTrusted(chain, "RSA");
|
||||
getMemorizingTrustManager().getNonInteractive(account.getServer()).checkClientTrusted(chain, "RSA");
|
||||
} catch (CertificateException e) {
|
||||
callback.informUser(R.string.certificate_chain_is_not_trusted);
|
||||
}
|
||||
|
@ -4160,7 +4160,7 @@ public class XmppConnectionService extends Service {
|
|||
mucServers.addAll(account.getXmppConnection().getMucServers());
|
||||
for (Bookmark bookmark : account.getBookmarks()) {
|
||||
final Jid jid = bookmark.getJid();
|
||||
final String s = jid == null ? null : jid.getDomain();
|
||||
final String s = jid == null ? null : jid.getDomain().toEscapedString();
|
||||
if (s != null) {
|
||||
mucServers.add(s);
|
||||
}
|
||||
|
|
|
@ -816,7 +816,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
|
|||
|
||||
private String getUserModeDomain() {
|
||||
if (mAccount != null && mAccount.getJid().getDomain() != null) {
|
||||
return mAccount.getJid().getDomain();
|
||||
return mAccount.getServer();
|
||||
} else {
|
||||
return Config.DOMAIN_LOCK;
|
||||
}
|
||||
|
|
|
@ -168,7 +168,7 @@ public class EnterJidDialog extends DialogFragment implements OnBackendConnected
|
|||
issuedWarning = true;
|
||||
return;
|
||||
}
|
||||
if (suspiciousSubDomain(contactJid.getDomain())) {
|
||||
if (suspiciousSubDomain(contactJid.getDomain().toEscapedString())) {
|
||||
binding.jidLayout.setError(getActivity().getString(R.string.this_looks_like_channel));
|
||||
dialog.getButton(AlertDialog.BUTTON_POSITIVE).setText(R.string.add_anway);
|
||||
issuedWarning = true;
|
||||
|
|
|
@ -129,7 +129,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
|
|||
final Intent intent = getIntent();
|
||||
final String action = intent.getAction();
|
||||
final Account account = extractAccount(intent);
|
||||
final Jid with = Jid.of(intent.getStringExtra(EXTRA_WITH));
|
||||
final Jid with = Jid.ofEscaped(intent.getStringExtra(EXTRA_WITH));
|
||||
final String state = intent.getStringExtra(EXTRA_LAST_REPORTED_STATE);
|
||||
if (!Intent.ACTION_VIEW.equals(action) || state == null || !END_CARD.contains(RtpEndUserState.valueOf(state))) {
|
||||
resetIntent(account, with, RtpEndUserState.RETRACTED, actionToMedia(intent.getAction()));
|
||||
|
@ -246,7 +246,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
|
|||
return;
|
||||
}
|
||||
final Account account = extractAccount(intent);
|
||||
final Jid with = Jid.of(intent.getStringExtra(EXTRA_WITH));
|
||||
final Jid with = Jid.ofEscaped(intent.getStringExtra(EXTRA_WITH));
|
||||
final String sessionId = intent.getStringExtra(EXTRA_SESSION_ID);
|
||||
if (sessionId != null) {
|
||||
Log.d(Config.LOGTAG, "reinitializing from onNewIntent()");
|
||||
|
@ -268,7 +268,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
|
|||
final Intent intent = getIntent();
|
||||
final String action = intent.getAction();
|
||||
final Account account = extractAccount(intent);
|
||||
final Jid with = Jid.of(intent.getStringExtra(EXTRA_WITH));
|
||||
final Jid with = Jid.ofEscaped(intent.getStringExtra(EXTRA_WITH));
|
||||
final String sessionId = intent.getStringExtra(EXTRA_SESSION_ID);
|
||||
if (sessionId != null) {
|
||||
if (initializeActivityWithRunningRtpSession(account, with, sessionId)) {
|
||||
|
@ -831,7 +831,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
|
|||
Log.d(Config.LOGTAG, "attempting retry");
|
||||
final Intent intent = getIntent();
|
||||
final Account account = extractAccount(intent);
|
||||
final Jid with = Jid.of(intent.getStringExtra(EXTRA_WITH));
|
||||
final Jid with = Jid.ofEscaped(intent.getStringExtra(EXTRA_WITH));
|
||||
final String lastAction = intent.getStringExtra(EXTRA_LAST_ACTION);
|
||||
final String action = intent.getAction();
|
||||
final Set<Media> media = actionToMedia(lastAction == null ? action : lastAction);
|
||||
|
|
|
@ -870,7 +870,7 @@ public abstract class XmppActivity extends ActionBarActivity {
|
|||
protected Account extractAccount(Intent intent) {
|
||||
final String jid = intent != null ? intent.getStringExtra(EXTRA_ACCOUNT) : null;
|
||||
try {
|
||||
return jid != null ? xmppConnectionService.findAccountByJid(Jid.of(jid)) : null;
|
||||
return jid != null ? xmppConnectionService.findAccountByJid(Jid.ofEscaped(jid)) : null;
|
||||
} catch (IllegalArgumentException e) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ public class IrregularUnicodeDetector {
|
|||
builder.append('@');
|
||||
}
|
||||
if (jid.getDomain() != null) {
|
||||
String[] labels = jid.getDomain().split("\\.");
|
||||
String[] labels = jid.getDomain().toEscapedString().split("\\.");
|
||||
for (int i = 0; i < labels.length; ++i) {
|
||||
SpannableString spannableString = new SpannableString(labels[i]);
|
||||
colorize(spannableString, patternTuple.domain.get(i), color);
|
||||
|
@ -263,7 +263,7 @@ public class IrregularUnicodeDetector {
|
|||
} else {
|
||||
localPattern = null;
|
||||
}
|
||||
String domain = jid.getDomain();
|
||||
String domain = jid.getDomain().toEscapedString();
|
||||
final List<Pattern> domainPatterns = new ArrayList<>();
|
||||
if (domain != null) {
|
||||
for (String label : domain.split("\\.")) {
|
||||
|
|
|
@ -43,7 +43,7 @@ public class JidHelper {
|
|||
|
||||
public static String localPartOrFallback(Jid jid) {
|
||||
if (LOCAL_PART_BLACKLIST.contains(jid.getLocal().toLowerCase(Locale.ENGLISH))) {
|
||||
final String domain = jid.getDomain();
|
||||
final String domain = jid.getDomain().toEscapedString();
|
||||
final int index = domain.indexOf('.');
|
||||
return index > 1 ? domain.substring(0, index) : domain;
|
||||
} else {
|
||||
|
|
|
@ -94,7 +94,7 @@ public class InvalidJid implements Jid {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getDomain() {
|
||||
public Jid getDomain() {
|
||||
throw new AssertionError("Not implemented");
|
||||
}
|
||||
|
||||
|
|
|
@ -80,14 +80,14 @@ public interface Jid extends Comparable<Jid>, Serializable, CharSequence {
|
|||
|
||||
static Jid ofDomainAndResource(CharSequence domain, CharSequence resource) {
|
||||
try {
|
||||
return new WrappedJid(
|
||||
JidCreate.domainFullFrom(
|
||||
Domainpart.from(domain.toString()),
|
||||
Resourcepart.from(resource.toString())
|
||||
));
|
||||
} catch (XmppStringprepException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
return new WrappedJid(
|
||||
JidCreate.domainFullFrom(
|
||||
Domainpart.from(domain.toString()),
|
||||
Resourcepart.from(resource.toString())
|
||||
));
|
||||
} catch (XmppStringprepException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
}
|
||||
|
||||
static Jid ofLocalAndDomainEscaped(CharSequence local, CharSequence domain) {
|
||||
|
@ -138,7 +138,7 @@ public interface Jid extends Comparable<Jid>, Serializable, CharSequence {
|
|||
|
||||
String getEscapedLocal();
|
||||
|
||||
String getDomain();
|
||||
Jid getDomain();
|
||||
|
||||
String getResource();
|
||||
|
||||
|
|
|
@ -65,9 +65,8 @@ public class WrappedJid implements eu.siacs.conversations.xmpp.Jid {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getDomain() {
|
||||
final Domainpart domainpart = inner.getDomain();
|
||||
return domainpart == null ? null : domainpart.toString();
|
||||
public eu.siacs.conversations.xmpp.Jid getDomain() {
|
||||
return new WrappedJid(inner.asDomainBareJid());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -289,7 +289,7 @@ public class XmppConnection implements Runnable {
|
|||
throw new IOException(e.getMessage());
|
||||
}
|
||||
} else {
|
||||
final String domain = account.getJid().getDomain();
|
||||
final String domain = account.getServer();
|
||||
final List<Resolver.Result> results;
|
||||
final boolean hardcoded = extended && !account.getHostname().isEmpty();
|
||||
if (hardcoded) {
|
||||
|
@ -434,7 +434,7 @@ public class XmppConnection implements Runnable {
|
|||
} else {
|
||||
keyManager = null;
|
||||
}
|
||||
final String domain = account.getJid().getDomain();
|
||||
final String domain = account.getServer();
|
||||
sc.init(keyManager, new X509TrustManager[]{mInteractive ? trustManager.getInteractive(domain) : trustManager.getNonInteractive(domain)}, mXmppConnectionService.getRNG());
|
||||
final SSLSocketFactory factory = sc.getSocketFactory();
|
||||
final DomainHostnameVerifier verifier = trustManager.wrapHostnameVerifier(new XmppDomainVerifier(), mInteractive);
|
||||
|
@ -930,7 +930,7 @@ public class XmppConnection implements Runnable {
|
|||
private void sendRegistryRequest() {
|
||||
final IqPacket register = new IqPacket(IqPacket.TYPE.GET);
|
||||
register.query(Namespace.REGISTER);
|
||||
register.setTo(Jid.of(account.getServer()));
|
||||
register.setTo(account.getDomain());
|
||||
sendUnmodifiedIqPacket(register, (account, packet) -> {
|
||||
if (packet.getType() == IqPacket.TYPE.TIMEOUT) {
|
||||
return;
|
||||
|
@ -1172,18 +1172,18 @@ public class XmppConnection implements Runnable {
|
|||
}
|
||||
final boolean requestDiscoItemsFirst = !account.isOptionSet(Account.OPTION_LOGGED_IN_SUCCESSFULLY);
|
||||
if (requestDiscoItemsFirst) {
|
||||
sendServiceDiscoveryItems(Jid.of(account.getServer()));
|
||||
sendServiceDiscoveryItems(account.getDomain());
|
||||
}
|
||||
if (discoveryResult == null) {
|
||||
sendServiceDiscoveryInfo(Jid.of(account.getServer()));
|
||||
sendServiceDiscoveryInfo(account.getDomain());
|
||||
} else {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": server caps came from cache");
|
||||
disco.put(Jid.of(account.getServer()), discoveryResult);
|
||||
disco.put(account.getDomain(), discoveryResult);
|
||||
}
|
||||
discoverMamPreferences();
|
||||
sendServiceDiscoveryInfo(account.getJid().asBareJid());
|
||||
if (!requestDiscoItemsFirst) {
|
||||
sendServiceDiscoveryItems(Jid.of(account.getServer()));
|
||||
sendServiceDiscoveryItems(account.getDomain());
|
||||
}
|
||||
|
||||
if (!mWaitForDisco.get()) {
|
||||
|
@ -1202,24 +1202,24 @@ public class XmppConnection implements Runnable {
|
|||
boolean advancedStreamFeaturesLoaded;
|
||||
synchronized (XmppConnection.this.disco) {
|
||||
ServiceDiscoveryResult result = new ServiceDiscoveryResult(packet);
|
||||
if (jid.equals(Jid.of(account.getServer()))) {
|
||||
if (jid.equals(account.getDomain())) {
|
||||
mXmppConnectionService.databaseBackend.insertDiscoveryResult(result);
|
||||
}
|
||||
disco.put(jid, result);
|
||||
advancedStreamFeaturesLoaded = disco.containsKey(Jid.of(account.getServer()))
|
||||
advancedStreamFeaturesLoaded = disco.containsKey(account.getDomain())
|
||||
&& disco.containsKey(account.getJid().asBareJid());
|
||||
}
|
||||
if (advancedStreamFeaturesLoaded && (jid.equals(Jid.of(account.getServer())) || jid.equals(account.getJid().asBareJid()))) {
|
||||
if (advancedStreamFeaturesLoaded && (jid.equals(account.getDomain()) || jid.equals(account.getJid().asBareJid()))) {
|
||||
enableAdvancedStreamFeatures();
|
||||
}
|
||||
} else if (packet.getType() == IqPacket.TYPE.ERROR) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": could not query disco info for " + jid.toString());
|
||||
final boolean serverOrAccount = jid.equals(Jid.of(account.getServer())) || jid.equals(account.getJid().asBareJid());
|
||||
final boolean serverOrAccount = jid.equals(account.getDomain()) || jid.equals(account.getJid().asBareJid());
|
||||
final boolean advancedStreamFeaturesLoaded;
|
||||
if (serverOrAccount) {
|
||||
synchronized (XmppConnection.this.disco) {
|
||||
disco.put(jid, ServiceDiscoveryResult.empty());
|
||||
advancedStreamFeaturesLoaded = disco.containsKey(Jid.of(account.getServer())) && disco.containsKey(account.getJid().asBareJid());
|
||||
advancedStreamFeaturesLoaded = disco.containsKey(account.getDomain()) && disco.containsKey(account.getJid().asBareJid());
|
||||
}
|
||||
} else {
|
||||
advancedStreamFeaturesLoaded = false;
|
||||
|
@ -1285,7 +1285,7 @@ public class XmppConnection implements Runnable {
|
|||
for (final Element element : elements) {
|
||||
if (element.getName().equals("item")) {
|
||||
final Jid jid = InvalidJid.getNullForInvalid(element.getAttributeAsJid("jid"));
|
||||
if (jid != null && !jid.equals(Jid.of(account.getServer()))) {
|
||||
if (jid != null && !jid.equals(account.getDomain())) {
|
||||
items.add(jid);
|
||||
}
|
||||
}
|
||||
|
@ -1559,7 +1559,7 @@ public class XmppConnection implements Runnable {
|
|||
|
||||
public List<String> getMucServersWithholdAccount() {
|
||||
List<String> servers = getMucServers();
|
||||
servers.remove(account.getServer());
|
||||
servers.remove(account.getDomain());
|
||||
return servers;
|
||||
}
|
||||
|
||||
|
@ -1764,7 +1764,7 @@ public class XmppConnection implements Runnable {
|
|||
}
|
||||
|
||||
public boolean carbons() {
|
||||
return hasDiscoFeature(Jid.of(account.getServer()), "urn:xmpp:carbons:2");
|
||||
return hasDiscoFeature(account.getDomain(), "urn:xmpp:carbons:2");
|
||||
}
|
||||
|
||||
public boolean bookmarksConversion() {
|
||||
|
@ -1776,19 +1776,19 @@ public class XmppConnection implements Runnable {
|
|||
}
|
||||
|
||||
public boolean blocking() {
|
||||
return hasDiscoFeature(Jid.of(account.getServer()), Namespace.BLOCKING);
|
||||
return hasDiscoFeature(account.getDomain(), Namespace.BLOCKING);
|
||||
}
|
||||
|
||||
public boolean spamReporting() {
|
||||
return hasDiscoFeature(Jid.of(account.getServer()), "urn:xmpp:reporting:reason:spam:0");
|
||||
return hasDiscoFeature(account.getDomain(), "urn:xmpp:reporting:reason:spam:0");
|
||||
}
|
||||
|
||||
public boolean flexibleOfflineMessageRetrieval() {
|
||||
return hasDiscoFeature(Jid.of(account.getServer()), Namespace.FLEXIBLE_OFFLINE_MESSAGE_RETRIEVAL);
|
||||
return hasDiscoFeature(account.getDomain(), Namespace.FLEXIBLE_OFFLINE_MESSAGE_RETRIEVAL);
|
||||
}
|
||||
|
||||
public boolean register() {
|
||||
return hasDiscoFeature(Jid.of(account.getServer()), Namespace.REGISTER);
|
||||
return hasDiscoFeature(account.getDomain(), Namespace.REGISTER);
|
||||
}
|
||||
|
||||
public boolean invite() {
|
||||
|
@ -1837,7 +1837,7 @@ public class XmppConnection implements Runnable {
|
|||
|
||||
public boolean push() {
|
||||
return hasDiscoFeature(account.getJid().asBareJid(), Namespace.PUSH)
|
||||
|| hasDiscoFeature(Jid.of(account.getServer()), Namespace.PUSH);
|
||||
|| hasDiscoFeature(account.getDomain(), Namespace.PUSH);
|
||||
}
|
||||
|
||||
public boolean rosterVersioning() {
|
||||
|
@ -1849,7 +1849,7 @@ public class XmppConnection implements Runnable {
|
|||
}
|
||||
|
||||
public boolean p1S3FileTransfer() {
|
||||
return hasDiscoFeature(Jid.of(account.getServer()), Namespace.P1_S3_FILE_TRANSFER);
|
||||
return hasDiscoFeature(account.getDomain(), Namespace.P1_S3_FILE_TRANSFER);
|
||||
}
|
||||
|
||||
public boolean httpUpload(long filesize) {
|
||||
|
@ -1903,7 +1903,7 @@ public class XmppConnection implements Runnable {
|
|||
}
|
||||
|
||||
public boolean externalServiceDiscovery() {
|
||||
return hasDiscoFeature(Jid.of(account.getServer()),Namespace.EXTERNAL_SERVICE_DISCOVERY);
|
||||
return hasDiscoFeature(account.getDomain(),Namespace.EXTERNAL_SERVICE_DISCOVERY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -601,7 +601,7 @@ public class JingleConnectionManager extends AbstractConnectionManager {
|
|||
}
|
||||
|
||||
public WeakReference<JingleRtpConnection> findJingleRtpConnection(Account account, Jid with, String sessionId) {
|
||||
final AbstractJingleConnection.Id id = AbstractJingleConnection.Id.of(account, Jid.ofEscaped(with), sessionId);
|
||||
final AbstractJingleConnection.Id id = AbstractJingleConnection.Id.of(account, with, sessionId);
|
||||
final AbstractJingleConnection connection = connections.get(id);
|
||||
if (connection instanceof JingleRtpConnection) {
|
||||
return new WeakReference<>((JingleRtpConnection) connection);
|
||||
|
|
|
@ -1104,7 +1104,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
|
|||
private void discoverIceServers(final OnIceServersDiscovered onIceServersDiscovered) {
|
||||
if (id.account.getXmppConnection().getFeatures().externalServiceDiscovery()) {
|
||||
final IqPacket request = new IqPacket(IqPacket.TYPE.GET);
|
||||
request.setTo(Jid.of(id.account.getJid().getDomain()));
|
||||
request.setTo(id.account.getDomain());
|
||||
request.addChild("services", Namespace.EXTERNAL_SERVICE_DISCOVERY);
|
||||
xmppConnectionService.sendIqPacket(id.account, request, (account, response) -> {
|
||||
ImmutableList.Builder<PeerConnection.IceServer> listBuilder = new ImmutableList.Builder<>();
|
||||
|
|
|
@ -33,7 +33,7 @@ public class AbstractStanza extends Element {
|
|||
public boolean fromServer(final Account account) {
|
||||
final Jid from = getFrom();
|
||||
return from == null
|
||||
|| from.equals(Jid.of(account.getServer()))
|
||||
|| from.equals(account.getDomain())
|
||||
|| from.equals(account.getJid().asBareJid())
|
||||
|| from.equals(account.getJid());
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class AbstractStanza extends Element {
|
|||
public boolean toServer(final Account account) {
|
||||
final Jid to = getTo();
|
||||
return to == null
|
||||
|| to.equals(Jid.of(account.getServer()))
|
||||
|| to.equals(account.getDomain())
|
||||
|| to.equals(account.getJid().asBareJid())
|
||||
|| to.equals(account.getJid());
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ import java.util.List;
|
|||
|
||||
import eu.siacs.conversations.android.PhoneNumberContact;
|
||||
import eu.siacs.conversations.xml.Element;
|
||||
import rocks.xmpp.addr.Jid;
|
||||
import eu.siacs.conversations.xmpp.Jid;
|
||||
|
||||
public class Entry implements Comparable<Entry> {
|
||||
private final List<Jid> jids;
|
||||
|
|
|
@ -49,9 +49,9 @@ import eu.siacs.conversations.utils.PhoneNumberUtilWrapper;
|
|||
import eu.siacs.conversations.utils.SerialSingleThreadExecutor;
|
||||
import eu.siacs.conversations.xml.Element;
|
||||
import eu.siacs.conversations.xml.Namespace;
|
||||
import eu.siacs.conversations.xmpp.Jid;
|
||||
import eu.siacs.conversations.xmpp.stanzas.IqPacket;
|
||||
import io.michaelrocks.libphonenumber.android.Phonenumber;
|
||||
import rocks.xmpp.addr.Jid;
|
||||
|
||||
public class QuickConversationsService extends AbstractQuickConversationsService {
|
||||
|
||||
|
|
|
@ -7,10 +7,10 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import eu.siacs.conversations.xmpp.Jid;
|
||||
import io.michaelrocks.libphonenumber.android.NumberParseException;
|
||||
import io.michaelrocks.libphonenumber.android.PhoneNumberUtil;
|
||||
import io.michaelrocks.libphonenumber.android.Phonenumber;
|
||||
import rocks.xmpp.addr.Jid;
|
||||
|
||||
public class PhoneNumberUtilWrapper {
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import eu.siacs.conversations.ui.EnterPhoneNumberActivity;
|
|||
import eu.siacs.conversations.ui.StartConversationActivity;
|
||||
import eu.siacs.conversations.ui.TosActivity;
|
||||
import eu.siacs.conversations.ui.VerifyActivity;
|
||||
import rocks.xmpp.addr.Jid;
|
||||
import eu.siacs.conversations.xmpp.Jid;
|
||||
|
||||
public class SignupUtils {
|
||||
|
||||
|
|
Loading…
Reference in New Issue