mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Improve handling of group join messages
This commit is contained in:
parent
30167d81e6
commit
605f31d1ad
1 changed files with 9 additions and 1 deletions
|
@ -185,10 +185,18 @@ public final class IncomingMessageHandler {
|
||||||
account.getMessageSendLogStore().deleteEntryForRecipient(envelope.getTimestamp(), sender, senderDeviceId);
|
account.getMessageSendLogStore().deleteEntryForRecipient(envelope.getTimestamp(), sender, senderDeviceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var notAllowedToSendToGroup = isNotAllowedToSendToGroup(envelope, content);
|
||||||
|
final var groupContext = getGroupContext(content);
|
||||||
|
if (groupContext != null && groupContext.getGroupV2().isPresent()) {
|
||||||
|
handleGroupV2Context(groupContext.getGroupV2().get());
|
||||||
|
}
|
||||||
|
// Check again in case the user just joined the group
|
||||||
|
notAllowedToSendToGroup = notAllowedToSendToGroup && isNotAllowedToSendToGroup(envelope, content);
|
||||||
|
|
||||||
if (isMessageBlocked(envelope, content)) {
|
if (isMessageBlocked(envelope, content)) {
|
||||||
logger.info("Ignoring a message from blocked user/group: {}", envelope.getTimestamp());
|
logger.info("Ignoring a message from blocked user/group: {}", envelope.getTimestamp());
|
||||||
return List.of();
|
return List.of();
|
||||||
} else if (isNotAllowedToSendToGroup(envelope, content)) {
|
} else if (notAllowedToSendToGroup) {
|
||||||
logger.info("Ignoring a group message from an unauthorized sender (no member or admin): {} {}",
|
logger.info("Ignoring a group message from an unauthorized sender (no member or admin): {} {}",
|
||||||
(envelope.hasSourceUuid() ? envelope.getSourceAddress() : content.getSender()).getIdentifier(),
|
(envelope.hasSourceUuid() ? envelope.getSourceAddress() : content.getSender()).getIdentifier(),
|
||||||
envelope.getTimestamp());
|
envelope.getTimestamp());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue