use escaped jid in more places
This commit is contained in:
parent
ef7d4fca86
commit
198a7db954
|
@ -28,7 +28,7 @@ public class Bookmark extends Element implements ListItem {
|
|||
public Bookmark(final Account account, final Jid jid) {
|
||||
super("conference");
|
||||
this.jid = jid;
|
||||
this.setAttribute("jid", jid.toString());
|
||||
this.setAttribute("jid", jid);
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
|
|
|
@ -334,7 +334,7 @@ public class IqGenerator extends AbstractGenerator {
|
|||
public IqPacket generateSetBlockRequest(final Jid jid, boolean reportSpam) {
|
||||
final IqPacket iq = new IqPacket(IqPacket.TYPE.SET);
|
||||
final Element block = iq.addChild("block", Namespace.BLOCKING);
|
||||
final Element item = block.addChild("item").setAttribute("jid", jid.toEscapedString());
|
||||
final Element item = block.addChild("item").setAttribute("jid", jid);
|
||||
if (reportSpam) {
|
||||
item.addChild("report", "urn:xmpp:reporting:0").addChild("spam");
|
||||
}
|
||||
|
@ -345,7 +345,7 @@ public class IqGenerator extends AbstractGenerator {
|
|||
public IqPacket generateSetUnblockRequest(final Jid jid) {
|
||||
final IqPacket iq = new IqPacket(IqPacket.TYPE.SET);
|
||||
final Element block = iq.addChild("unblock", Namespace.BLOCKING);
|
||||
block.addChild("item").setAttribute("jid", jid.toEscapedString());
|
||||
block.addChild("item").setAttribute("jid", jid);
|
||||
return iq;
|
||||
}
|
||||
|
||||
|
@ -372,7 +372,7 @@ public class IqGenerator extends AbstractGenerator {
|
|||
Element query = packet.query("http://jabber.org/protocol/muc#admin");
|
||||
for (Jid jid : jids) {
|
||||
Element item = query.addChild("item");
|
||||
item.setAttribute("jid", jid.toEscapedString());
|
||||
item.setAttribute("jid", jid);
|
||||
item.setAttribute("affiliation", affiliation);
|
||||
}
|
||||
return packet;
|
||||
|
@ -489,7 +489,7 @@ public class IqGenerator extends AbstractGenerator {
|
|||
public IqPacket enablePush(final Jid jid, final String node, final String secret) {
|
||||
IqPacket packet = new IqPacket(IqPacket.TYPE.SET);
|
||||
Element enable = packet.addChild("enable", Namespace.PUSH);
|
||||
enable.setAttribute("jid", jid.toString());
|
||||
enable.setAttribute("jid", jid);
|
||||
enable.setAttribute("node", node);
|
||||
if (secret != null) {
|
||||
Data data = new Data();
|
||||
|
@ -504,7 +504,7 @@ public class IqGenerator extends AbstractGenerator {
|
|||
public IqPacket disablePush(final Jid jid, final String node) {
|
||||
IqPacket packet = new IqPacket(IqPacket.TYPE.SET);
|
||||
Element disable = packet.addChild("disable", Namespace.PUSH);
|
||||
disable.setAttribute("jid", jid.toEscapedString());
|
||||
disable.setAttribute("jid", jid);
|
||||
disable.setAttribute("node", node);
|
||||
return packet;
|
||||
}
|
||||
|
|
|
@ -198,7 +198,7 @@ public class MessageGenerator extends AbstractGenerator {
|
|||
packet.setTo(contact);
|
||||
packet.setFrom(conversation.getAccount().getJid());
|
||||
Element x = packet.addChild("x", "jabber:x:conference");
|
||||
x.setAttribute("jid", conversation.getJid().asBareJid().toString());
|
||||
x.setAttribute("jid", conversation.getJid().asBareJid());
|
||||
String password = conversation.getMucOptions().getPassword();
|
||||
if (password != null) {
|
||||
x.setAttribute("password", password);
|
||||
|
|
|
@ -445,9 +445,9 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
|
|||
final User self = mucOptions.getSelf();
|
||||
String account;
|
||||
if (Config.DOMAIN_LOCK != null) {
|
||||
account = mConversation.getAccount().getJid().getLocal();
|
||||
account = mConversation.getAccount().getJid().getEscapedLocal();
|
||||
} else {
|
||||
account = mConversation.getAccount().getJid().asBareJid().toString();
|
||||
account = mConversation.getAccount().getJid().asBareJid().toEscapedString();
|
||||
}
|
||||
setTitle(mucOptions.isPrivateAndNonAnonymous() ? R.string.action_muc_details : R.string.channel_details);
|
||||
this.binding.editMucNameButton.setVisibility((self.getAffiliation().ranks(MucOptions.Affiliation.OWNER) || mucOptions.canChangeSubject()) ? View.VISIBLE : View.GONE);
|
||||
|
@ -584,7 +584,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
|
|||
|
||||
@Override
|
||||
public void onAffiliationChangeFailed(Jid jid, int resId) {
|
||||
displayToast(getString(resId, jid.asBareJid().toString()));
|
||||
displayToast(getString(resId, jid.asBareJid().toEscapedString()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -213,7 +213,7 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat
|
|||
showCameraToast();
|
||||
}
|
||||
|
||||
binding.ownKeysTitle.setText(mAccount.getJid().asBareJid().toString());
|
||||
binding.ownKeysTitle.setText(mAccount.getJid().asBareJid().toEscapedString());
|
||||
binding.ownKeysCard.setVisibility(hasOwnKeys ? View.VISIBLE : View.GONE);
|
||||
binding.foreignKeys.setVisibility(hasForeignKeys ? View.VISIBLE : View.GONE);
|
||||
if (hasPendingKeyFetches()) {
|
||||
|
|
|
@ -10,15 +10,13 @@ import com.google.firebase.iid.InstanceIdResult;
|
|||
import eu.siacs.conversations.Config;
|
||||
import eu.siacs.conversations.R;
|
||||
import eu.siacs.conversations.entities.Account;
|
||||
import eu.siacs.conversations.entities.Conversation;
|
||||
import eu.siacs.conversations.utils.PhoneHelper;
|
||||
import eu.siacs.conversations.xml.Element;
|
||||
import eu.siacs.conversations.xml.Namespace;
|
||||
import eu.siacs.conversations.xmpp.OnIqPacketReceived;
|
||||
import eu.siacs.conversations.xmpp.Jid;
|
||||
import eu.siacs.conversations.xmpp.XmppConnection;
|
||||
import eu.siacs.conversations.xmpp.forms.Data;
|
||||
import eu.siacs.conversations.xmpp.stanzas.IqPacket;
|
||||
import rocks.xmpp.addr.Jid;
|
||||
|
||||
public class PushManagementService {
|
||||
|
||||
|
@ -63,18 +61,6 @@ public class PushManagementService {
|
|||
});
|
||||
}
|
||||
|
||||
public void unregisterChannel(final Account account, final String channel) {
|
||||
final String androidId = PhoneHelper.getAndroidId(mXmppConnectionService);
|
||||
final Jid appServer = getAppServer();
|
||||
final IqPacket packet = mXmppConnectionService.getIqGenerator().unregisterChannelOnAppServer(appServer, androidId, channel);
|
||||
mXmppConnectionService.sendIqPacket(account, packet, (a, response) -> {
|
||||
if (response.getType() == IqPacket.TYPE.RESULT) {
|
||||
Log.d(Config.LOGTAG,a.getJid().asBareJid()+": successfully unregistered channel");
|
||||
} else if (response.getType() == IqPacket.TYPE.ERROR) {
|
||||
Log.d(Config.LOGTAG, a.getJid().asBareJid()+": unable to unregister channel with hash "+channel);
|
||||
}
|
||||
});
|
||||
}
|
||||
private void enablePushOnServer(final Account account, final Jid appServer, final String node, final String secret) {
|
||||
final IqPacket enable = mXmppConnectionService.getIqGenerator().enablePush(appServer, node, secret);
|
||||
mXmppConnectionService.sendIqPacket(account, enable, (a, p) -> {
|
||||
|
|
Loading…
Reference in a new issue