overwrite body for plaintext group chat messages only
This commit is contained in:
parent
e947a3f808
commit
0fa06d65b5
|
@ -3964,7 +3964,7 @@ public class XmppConnectionService extends Service {
|
||||||
if (message.getServerMsgId() == null) {
|
if (message.getServerMsgId() == null) {
|
||||||
message.setServerMsgId(serverMessageId);
|
message.setServerMsgId(serverMessageId);
|
||||||
}
|
}
|
||||||
if (body != null && body.content != null && !body.content.equals(message.getBody())) {
|
if (message.getEncryption() == Message.ENCRYPTION_NONE && isBodyModified(message, body)) {
|
||||||
message.setBody(body.content);
|
message.setBody(body.content);
|
||||||
if (body.count > 1) {
|
if (body.count > 1) {
|
||||||
message.setBodyLanguage(body.language);
|
message.setBodyLanguage(body.language);
|
||||||
|
@ -3980,6 +3980,13 @@ public class XmppConnectionService extends Service {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean isBodyModified(final Message message, final LocalizedContent body) {
|
||||||
|
if (body == null || body.content == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return !body.content.equals(message.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
public void markMessage(Message message, int status) {
|
public void markMessage(Message message, int status) {
|
||||||
markMessage(message, status, null);
|
markMessage(message, status, null);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue