disable mds for bug fix release

This commit is contained in:
Daniel Gultsch 2024-03-30 14:54:28 +01:00
parent cb37321ecb
commit f22d19f7d0
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2
4 changed files with 19 additions and 7 deletions

View file

@ -56,6 +56,8 @@ public final class Config {
public static final boolean USE_RANDOM_RESOURCE_ON_EVERY_BIND = false; public static final boolean USE_RANDOM_RESOURCE_ON_EVERY_BIND = false;
public static final boolean MESSAGE_DISPLAYED_SYNCHRONIZATION = false;
public static final boolean ALLOW_NON_TLS_CONNECTIONS = public static final boolean ALLOW_NON_TLS_CONNECTIONS =
false; // very dangerous. you should have a good reason to set this to true false; // very dangerous. you should have a good reason to set this to true

View file

@ -24,7 +24,7 @@ import java.util.TimeZone;
public abstract class AbstractGenerator { public abstract class AbstractGenerator {
private static final SimpleDateFormat DATE_FORMAT = private static final SimpleDateFormat DATE_FORMAT =
new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US); new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US);
private final String[] FEATURES = { private final String[] STATIC_FEATURES = {
Namespace.JINGLE, Namespace.JINGLE,
Namespace.JINGLE_APPS_FILE_TRANSFER, Namespace.JINGLE_APPS_FILE_TRANSFER,
Namespace.JINGLE_TRANSPORTS_S5B, Namespace.JINGLE_TRANSPORTS_S5B,
@ -40,8 +40,7 @@ public abstract class AbstractGenerator {
Namespace.NICK + "+notify", Namespace.NICK + "+notify",
"urn:xmpp:ping", "urn:xmpp:ping",
"jabber:iq:version", "jabber:iq:version",
"http://jabber.org/protocol/chatstates", "http://jabber.org/protocol/chatstates"
Namespace.MDS_DISPLAYED + "+notify"
}; };
private final String[] MESSAGE_CONFIRMATION_FEATURES = { private final String[] MESSAGE_CONFIRMATION_FEATURES = {
"urn:xmpp:chat-markers:0", "urn:xmpp:receipts" "urn:xmpp:chat-markers:0", "urn:xmpp:receipts"
@ -108,7 +107,10 @@ public abstract class AbstractGenerator {
public List<String> getFeatures(Account account) { public List<String> getFeatures(Account account) {
final XmppConnection connection = account.getXmppConnection(); final XmppConnection connection = account.getXmppConnection();
final ArrayList<String> features = new ArrayList<>(Arrays.asList(FEATURES)); final ArrayList<String> features = new ArrayList<>(Arrays.asList(STATIC_FEATURES));
if (Config.MESSAGE_DISPLAYED_SYNCHRONIZATION) {
features.add(Namespace.MDS_DISPLAYED + "+notify");
}
if (mXmppConnectionService.confirmMessages()) { if (mXmppConnectionService.confirmMessages()) {
features.addAll(Arrays.asList(MESSAGE_CONFIRMATION_FEATURES)); features.addAll(Arrays.asList(MESSAGE_CONFIRMATION_FEATURES));
} }

View file

@ -271,11 +271,17 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
mXmppConnectionService.updateConversationUi(); mXmppConnectionService.updateConversationUi();
} }
} }
} else if (Namespace.MDS_DISPLAYED.equals(node) && account.getJid().asBareJid().equals(from)) { } else if (Config.MESSAGE_DISPLAYED_SYNCHRONIZATION
&& Namespace.MDS_DISPLAYED.equals(node)
&& account.getJid().asBareJid().equals(from)) {
final Element item = items.findChild("item"); final Element item = items.findChild("item");
mXmppConnectionService.processMdsItem(account, item); mXmppConnectionService.processMdsItem(account, item);
} else { } else {
Log.d(Config.LOGTAG, account.getJid().asBareJid() + " received pubsub notification for node=" + node); Log.d(
Config.LOGTAG,
account.getJid().asBareJid()
+ " received pubsub notification for node="
+ node);
} }
} }

View file

@ -3074,7 +3074,9 @@ public class XmppConnection implements Runnable {
} }
public boolean mds() { public boolean mds() {
return pepPublishOptions() && pepConfigNodeMax(); return pepPublishOptions()
&& pepConfigNodeMax()
&& Config.MESSAGE_DISPLAYED_SYNCHRONIZATION;
} }
public boolean mdsServerAssist() { public boolean mdsServerAssist() {