Add block request action button to collapsed join request events.

This commit is contained in:
Cody Henthorne
2022-03-15 20:41:48 -04:00
parent 130d5a8945
commit d3049a3433
11 changed files with 188 additions and 5 deletions

View File

@@ -73,8 +73,6 @@ import java.util.Set;
import java.util.UUID;
import java.util.function.Function;
import kotlin.collections.CollectionsKt;
/**
* The base class for message record models that are displayed in
* conversations, as opposed to models that are displayed in a thread list.
@@ -423,6 +421,15 @@ public abstract class MessageRecord extends DisplayRecord {
return false;
}
public boolean isCollapsedGroupV2JoinUpdate() {
DecryptedGroupV2Context decryptedGroupV2Context = getDecryptedGroupV2Context();
if (decryptedGroupV2Context != null && decryptedGroupV2Context.hasChange()) {
DecryptedGroupChange change = decryptedGroupV2Context.getChange();
return change.getNewRequestingMembersCount() > 0 && change.getDeleteRequestingMembersCount() > 0;
}
return false;
}
public static @NonNull String createNewContextWithAppendedDeleteJoinRequest(@NonNull MessageRecord messageRecord, int revision, @NonNull ByteString id) {
DecryptedGroupV2Context decryptedGroupV2Context = messageRecord.getDecryptedGroupV2Context();