mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 20:48:43 +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()));
|
callback.onComplete(new JoinGroupSuccess(groupActionResult.getGroupRecipient(), groupActionResult.getThreadId()));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
Log.w(TAG, "Network error", e);
|
||||||
callback.onError(JoinGroupError.NETWORK_ERROR);
|
callback.onError(JoinGroupError.NETWORK_ERROR);
|
||||||
} catch (GroupChangeBusyException e) {
|
} catch (GroupChangeBusyException e) {
|
||||||
|
Log.w(TAG, "Change error", e);
|
||||||
callback.onError(JoinGroupError.BUSY);
|
callback.onError(JoinGroupError.BUSY);
|
||||||
} catch (GroupLinkNotActiveException e) {
|
} catch (GroupLinkNotActiveException e) {
|
||||||
|
Log.w(TAG, "Inactive group error", e);
|
||||||
callback.onError(e.getReason() == GroupLinkNotActiveException.Reason.BANNED ? JoinGroupError.BANNED : JoinGroupError.GROUP_LINK_NOT_ACTIVE);
|
callback.onError(e.getReason() == GroupLinkNotActiveException.Reason.BANNED ? JoinGroupError.BANNED : JoinGroupError.GROUP_LINK_NOT_ACTIVE);
|
||||||
} catch (GroupChangeFailedException | MembershipNotSuitableForV2Exception e) {
|
} catch (GroupChangeFailedException | MembershipNotSuitableForV2Exception e) {
|
||||||
|
Log.w(TAG, "Change failed", e);
|
||||||
callback.onError(JoinGroupError.FAILED);
|
callback.onError(JoinGroupError.FAILED);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ class GroupsV2StateProcessor private constructor(
|
|||||||
when (serverUpdateResult) {
|
when (serverUpdateResult) {
|
||||||
InternalUpdateResult.NoUpdateNeeded -> return GroupUpdateResult.CONSISTENT_OR_AHEAD
|
InternalUpdateResult.NoUpdateNeeded -> return GroupUpdateResult.CONSISTENT_OR_AHEAD
|
||||||
is InternalUpdateResult.Updated -> return GroupUpdateResult.updated(serverUpdateResult.updatedLocalState)
|
is InternalUpdateResult.Updated -> return GroupUpdateResult.updated(serverUpdateResult.updatedLocalState)
|
||||||
is InternalUpdateResult.UpdateFailed -> throw serverUpdateResult.throwable
|
is InternalUpdateResult.UpdateFailed,
|
||||||
is InternalUpdateResult.NotAMember -> Unit
|
is InternalUpdateResult.NotAMember -> Unit
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,7 +184,11 @@ class GroupsV2StateProcessor private constructor(
|
|||||||
profileAndMessageHelper.leaveGroupLocally(serviceIds)
|
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(
|
private fun canApplyP2pChange(
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/signal_transparent_80"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:padding="17dp"
|
android:padding="17dp"
|
||||||
style="@style/Signal.Text.Preview"
|
style="@style/Signal.Text.Preview"
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
android:id="@+id/conversation_no_longer_member_banner"
|
android:id="@+id/conversation_no_longer_member_banner"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/signal_background_tertiary"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:paddingStart="16dp"
|
android:paddingStart="16dp"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/signal_background_tertiary"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:paddingStart="16dp"
|
android:paddingStart="16dp"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
|
|||||||
Reference in New Issue
Block a user