mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 04:28:35 +00:00
Fix request to rejoin after group updates bug.
This commit is contained in:
committed by
Greyson Parrelli
parent
57a70c3085
commit
21ada2a503
@@ -60,12 +60,16 @@ final class GroupJoinRepository {
|
||||
|
||||
callback.onComplete(new JoinGroupSuccess(groupActionResult.getGroupRecipient(), groupActionResult.getThreadId()));
|
||||
} catch (IOException e) {
|
||||
Log.w(TAG, "Network error", e);
|
||||
callback.onError(JoinGroupError.NETWORK_ERROR);
|
||||
} catch (GroupChangeBusyException e) {
|
||||
Log.w(TAG, "Change error", e);
|
||||
callback.onError(JoinGroupError.BUSY);
|
||||
} catch (GroupLinkNotActiveException e) {
|
||||
Log.w(TAG, "Inactive group error", e);
|
||||
callback.onError(e.getReason() == GroupLinkNotActiveException.Reason.BANNED ? JoinGroupError.BANNED : JoinGroupError.GROUP_LINK_NOT_ACTIVE);
|
||||
} catch (GroupChangeFailedException | MembershipNotSuitableForV2Exception e) {
|
||||
Log.w(TAG, "Change failed", e);
|
||||
callback.onError(JoinGroupError.FAILED);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -158,7 +158,7 @@ class GroupsV2StateProcessor private constructor(
|
||||
when (serverUpdateResult) {
|
||||
InternalUpdateResult.NoUpdateNeeded -> return GroupUpdateResult.CONSISTENT_OR_AHEAD
|
||||
is InternalUpdateResult.Updated -> return GroupUpdateResult.updated(serverUpdateResult.updatedLocalState)
|
||||
is InternalUpdateResult.UpdateFailed -> throw serverUpdateResult.throwable
|
||||
is InternalUpdateResult.UpdateFailed,
|
||||
is InternalUpdateResult.NotAMember -> Unit
|
||||
}
|
||||
|
||||
@@ -184,7 +184,11 @@ class GroupsV2StateProcessor private constructor(
|
||||
profileAndMessageHelper.leaveGroupLocally(serviceIds)
|
||||
}
|
||||
|
||||
throw GroupNotAMemberException(serverUpdateResult.exception)
|
||||
throw when (serverUpdateResult) {
|
||||
is InternalUpdateResult.NotAMember -> GroupNotAMemberException(serverUpdateResult.exception)
|
||||
is InternalUpdateResult.UpdateFailed -> throw serverUpdateResult.throwable
|
||||
else -> AssertionError("Should not reach here with ${serverUpdateResult::class.java.simpleName}")
|
||||
}
|
||||
}
|
||||
|
||||
private fun canApplyP2pChange(
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/signal_transparent_80"
|
||||
android:gravity="center"
|
||||
android:padding="17dp"
|
||||
style="@style/Signal.Text.Preview"
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
android:id="@+id/conversation_no_longer_member_banner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/signal_background_tertiary"
|
||||
android:gravity="center"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="8dp"
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/signal_background_tertiary"
|
||||
android:gravity="center"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="8dp"
|
||||
|
||||
Reference in New Issue
Block a user