don’t send origin-ids to rooms that support stable-ids. fixes #3905
This commit is contained in:
parent
16c4e3eec7
commit
1fafe4287d
|
@ -211,6 +211,10 @@ public class MucOptions {
|
|||
return conversation.getBooleanAttribute(Conversation.ATTRIBUTE_MODERATED, false);
|
||||
}
|
||||
|
||||
public boolean stableId() {
|
||||
return getFeatures().contains("http://jabber.org/protocol/muc#stable_id");
|
||||
}
|
||||
|
||||
public User deleteUser(Jid jid) {
|
||||
User user = findUserByFullJid(jid);
|
||||
if (user != null) {
|
||||
|
|
|
@ -18,12 +18,12 @@ import eu.siacs.conversations.http.P1S3UrlStreamHandler;
|
|||
import eu.siacs.conversations.services.XmppConnectionService;
|
||||
import eu.siacs.conversations.xml.Element;
|
||||
import eu.siacs.conversations.xml.Namespace;
|
||||
import eu.siacs.conversations.xmpp.Jid;
|
||||
import eu.siacs.conversations.xmpp.chatstate.ChatState;
|
||||
import eu.siacs.conversations.xmpp.jingle.JingleConnectionManager;
|
||||
import eu.siacs.conversations.xmpp.jingle.JingleRtpConnection;
|
||||
import eu.siacs.conversations.xmpp.jingle.Media;
|
||||
import eu.siacs.conversations.xmpp.stanzas.MessagePacket;
|
||||
import eu.siacs.conversations.xmpp.Jid;
|
||||
|
||||
public class MessageGenerator extends AbstractGenerator {
|
||||
private static final String OMEMO_FALLBACK_MESSAGE = "I sent you an OMEMO encrypted message but your client doesn’t seem to support that. Find more information on https://conversations.im/omemo";
|
||||
|
@ -58,7 +58,9 @@ public class MessageGenerator extends AbstractGenerator {
|
|||
}
|
||||
packet.setFrom(account.getJid());
|
||||
packet.setId(message.getUuid());
|
||||
if (conversation.getMode() == Conversational.MODE_SINGLE || message.isPrivateMessage() || !conversation.getMucOptions().stableId()) {
|
||||
packet.addChild("origin-id", Namespace.STANZA_IDS).setAttribute("id", message.getUuid());
|
||||
}
|
||||
if (message.edited()) {
|
||||
packet.addChild("replace", "urn:xmpp:message-correct:0").setAttribute("id", message.getEditedIdWireFormat());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue