JMI: send 'ringing' and receipts only for contacts

fixes #110
This commit is contained in:
Daniel Gultsch 2023-10-01 08:05:36 +02:00
parent ac3ce93c56
commit 0dca7f8a5a
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2
2 changed files with 19 additions and 4 deletions

View file

@ -849,9 +849,22 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
if (serverMsgId == null) {
serverMsgId = extractStanzaId(account, packet);
}
mXmppConnectionService.getJingleConnectionManager().deliverMessage(account, packet.getTo(), packet.getFrom(), child, remoteMsgId, serverMsgId, timestamp);
if (!account.getJid().asBareJid().equals(from.asBareJid()) && remoteMsgId != null) {
processMessageReceipts(account, packet, remoteMsgId, query);
mXmppConnectionService
.getJingleConnectionManager()
.deliverMessage(
account,
packet.getTo(),
packet.getFrom(),
child,
remoteMsgId,
serverMsgId,
timestamp);
final Contact contact = account.getRoster().getContact(from);
if (mXmppConnectionService.confirmMessages()
&& !contact.isSelf()
&& remoteMsgId != null
&& contact.showInContactList()) {
processMessageReceipts(account, packet, remoteMsgId, null);
}
} else if (query.isCatchup()) {
if ("propose".equals(action)) {

View file

@ -1505,7 +1505,9 @@ public class JingleRtpConnection extends AbstractJingleConnection
}
this.message.setTime(timestamp);
startRinging();
if (xmppConnectionService.confirmMessages() && id.getContact().showInContactList()) {
sendJingleMessage("ringing");
}
} else {
Log.d(
Config.LOGTAG,