Perform directory refresh after a PNI invite accept.
This commit is contained in:
parent
ebd8d85a3d
commit
e7c018283a
2 changed files with 15 additions and 4 deletions
|
@ -61,10 +61,6 @@ public final class ProfileKeySet {
|
||||||
for (DecryptedMember member : change.promotePendingPniAciMembers) {
|
for (DecryptedMember member : change.promotePendingPniAciMembers) {
|
||||||
addMemberKey(member, editor);
|
addMemberKey(member, editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (DecryptedMember member : change.promotePendingPniAciMembers) {
|
|
||||||
addMemberKey(member, editor);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -35,6 +35,7 @@ import org.thoughtcrime.securesms.groups.GroupsV2Authorization;
|
||||||
import org.thoughtcrime.securesms.groups.v2.ProfileKeySet;
|
import org.thoughtcrime.securesms.groups.v2.ProfileKeySet;
|
||||||
import org.thoughtcrime.securesms.jobmanager.Job;
|
import org.thoughtcrime.securesms.jobmanager.Job;
|
||||||
import org.thoughtcrime.securesms.jobs.AvatarGroupsV2DownloadJob;
|
import org.thoughtcrime.securesms.jobs.AvatarGroupsV2DownloadJob;
|
||||||
|
import org.thoughtcrime.securesms.jobs.DirectoryRefreshJob;
|
||||||
import org.thoughtcrime.securesms.jobs.LeaveGroupV2Job;
|
import org.thoughtcrime.securesms.jobs.LeaveGroupV2Job;
|
||||||
import org.thoughtcrime.securesms.jobs.RequestGroupV2InfoJob;
|
import org.thoughtcrime.securesms.jobs.RequestGroupV2InfoJob;
|
||||||
import org.thoughtcrime.securesms.jobs.RetrieveProfileJob;
|
import org.thoughtcrime.securesms.jobs.RetrieveProfileJob;
|
||||||
|
@ -352,6 +353,10 @@ public class GroupsV2StateProcessor {
|
||||||
}
|
}
|
||||||
profileAndMessageHelper.persistLearnedProfileKeys(inputGroupState);
|
profileAndMessageHelper.persistLearnedProfileKeys(inputGroupState);
|
||||||
|
|
||||||
|
if (!signedGroupChange.promotePendingPniAciMembers.isEmpty()) {
|
||||||
|
ApplicationDependencies.getJobManager().add(new DirectoryRefreshJob(false));
|
||||||
|
}
|
||||||
|
|
||||||
GlobalGroupState remainingWork = advanceGroupStateResult.getNewGlobalGroupState();
|
GlobalGroupState remainingWork = advanceGroupStateResult.getNewGlobalGroupState();
|
||||||
if (remainingWork.getServerHistory().size() > 0) {
|
if (remainingWork.getServerHistory().size() > 0) {
|
||||||
info(String.format(Locale.US, "There are more revisions on the server for this group, scheduling for later, V[%d..%d]", newLocalState.revision + 1, remainingWork.getLatestRevisionNumber()));
|
info(String.format(Locale.US, "There are more revisions on the server for this group, scheduling for later, V[%d..%d]", newLocalState.revision + 1, remainingWork.getLatestRevisionNumber()));
|
||||||
|
@ -443,6 +448,7 @@ public class GroupsV2StateProcessor {
|
||||||
ProfileKeySet profileKeys = new ProfileKeySet();
|
ProfileKeySet profileKeys = new ProfileKeySet();
|
||||||
DecryptedGroup finalState = localState;
|
DecryptedGroup finalState = localState;
|
||||||
GlobalGroupState finalGlobalGroupState = inputGroupState;
|
GlobalGroupState finalGlobalGroupState = inputGroupState;
|
||||||
|
boolean performCdsLookup = false;
|
||||||
|
|
||||||
boolean hasMore = true;
|
boolean hasMore = true;
|
||||||
|
|
||||||
|
@ -474,8 +480,13 @@ public class GroupsV2StateProcessor {
|
||||||
if (entry.getGroup() != null) {
|
if (entry.getGroup() != null) {
|
||||||
profileKeys.addKeysFromGroupState(entry.getGroup());
|
profileKeys.addKeysFromGroupState(entry.getGroup());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry.getChange() != null) {
|
if (entry.getChange() != null) {
|
||||||
profileKeys.addKeysFromGroupChange(entry.getChange());
|
profileKeys.addKeysFromGroupChange(entry.getChange());
|
||||||
|
|
||||||
|
if (!entry.getChange().promotePendingPniAciMembers.isEmpty()) {
|
||||||
|
performCdsLookup = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -496,6 +507,10 @@ public class GroupsV2StateProcessor {
|
||||||
|
|
||||||
profileAndMessageHelper.persistLearnedProfileKeys(profileKeys);
|
profileAndMessageHelper.persistLearnedProfileKeys(profileKeys);
|
||||||
|
|
||||||
|
if (performCdsLookup) {
|
||||||
|
ApplicationDependencies.getJobManager().add(new DirectoryRefreshJob(false));
|
||||||
|
}
|
||||||
|
|
||||||
if (finalGlobalGroupState.getServerHistory().size() > 0) {
|
if (finalGlobalGroupState.getServerHistory().size() > 0) {
|
||||||
info(String.format(Locale.US, "There are more revisions on the server for this group, scheduling for later, V[%d..%d]", finalState.revision + 1, finalGlobalGroupState.getLatestRevisionNumber()));
|
info(String.format(Locale.US, "There are more revisions on the server for this group, scheduling for later, V[%d..%d]", finalState.revision + 1, finalGlobalGroupState.getLatestRevisionNumber()));
|
||||||
ApplicationDependencies.getJobManager().add(new RequestGroupV2InfoJob(groupId, finalGlobalGroupState.getLatestRevisionNumber()));
|
ApplicationDependencies.getJobManager().add(new RequestGroupV2InfoJob(groupId, finalGlobalGroupState.getLatestRevisionNumber()));
|
||||||
|
|
Loading…
Add table
Reference in a new issue