mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-28 19:08:15 +00:00
fixes
This commit is contained in:
@@ -110,7 +110,10 @@ struct ChannelRelaysView: View {
|
||||
}
|
||||
|
||||
private func ownerRelayStatusText(_ member: GroupMember) -> LocalizedStringKey {
|
||||
if [.memLeft, .memRemoved, .memGroupDeleted].contains(member.memberStatus) {
|
||||
let relayStatus = groupRelays.first(where: { $0.groupMemberId == member.groupMemberId })?.relayStatus
|
||||
return if relayStatus == .rsRejected {
|
||||
"rejected"
|
||||
} else if [.memLeft, .memRemoved, .memGroupDeleted].contains(member.memberStatus) {
|
||||
relayConnStatus(member).text
|
||||
} else if case .failed = member.activeConn?.connStatus {
|
||||
"failed"
|
||||
@@ -119,8 +122,7 @@ struct ChannelRelaysView: View {
|
||||
} else if member.activeConn?.connInactive ?? false {
|
||||
"inactive"
|
||||
} else {
|
||||
groupRelays.first(where: { $0.groupMemberId == member.groupMemberId })?.relayStatus.text
|
||||
?? relayConnStatus(member).text
|
||||
relayStatus?.text ?? relayConnStatus(member).text
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-3
@@ -175,7 +175,10 @@ private fun subscriberRelayStatusText(member: GroupMember): String {
|
||||
}
|
||||
|
||||
private fun ownerRelayStatusText(member: GroupMember, groupRelays: List<GroupRelay>): String {
|
||||
return if (member.memberStatus in listOf(GroupMemberStatus.MemLeft, GroupMemberStatus.MemRemoved, GroupMemberStatus.MemGroupDeleted)) {
|
||||
val relayStatus = groupRelays.firstOrNull { it.groupMemberId == member.groupMemberId }?.relayStatus
|
||||
return if (relayStatus == RelayStatus.RsRejected) {
|
||||
generalGetString(MR.strings.relay_status_rejected)
|
||||
} else if (member.memberStatus in listOf(GroupMemberStatus.MemLeft, GroupMemberStatus.MemRemoved, GroupMemberStatus.MemGroupDeleted)) {
|
||||
relayConnStatus(member).first
|
||||
} else if (member.activeConn?.connStatus is ConnStatus.Failed) {
|
||||
generalGetString(MR.strings.relay_conn_status_failed)
|
||||
@@ -184,8 +187,7 @@ private fun ownerRelayStatusText(member: GroupMember, groupRelays: List<GroupRel
|
||||
} else if (member.activeConn?.connInactive == true) {
|
||||
generalGetString(MR.strings.member_info_member_inactive)
|
||||
} else {
|
||||
groupRelays.firstOrNull { it.groupMemberId == member.groupMemberId }?.relayStatus?.text
|
||||
?: relayConnStatus(member).first
|
||||
relayStatus?.text ?: relayConnStatus(member).first
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -223,7 +223,13 @@ chatResponseToView hu cfg@ChatConfig {logLevel, showReactions, testView} liveIte
|
||||
CRUserDeletedMembers u g members wm signed -> case members of
|
||||
[m] -> ttyUser u [ttyGroup' g <> ": you removed " <> ttyMember m <> " from the group" <> withMessages wm <> signedStr signed]
|
||||
mems' -> ttyUser u [ttyGroup' g <> ": you removed " <> sShow (length mems') <> " members from the group" <> withMessages wm <> signedStr signed]
|
||||
CRLeftMemberUser u g -> ttyUser u $ [ttyGroup' g <> ": you left the group"] <> groupPreserved g
|
||||
CRLeftMemberUser u g
|
||||
| relayOwnStatus g == Just RSRejected ->
|
||||
ttyUser u
|
||||
[ ttyGroup' g <> ": you left the group (future invitations will be rejected)",
|
||||
"use " <> highlight ("/relay allow #" <> viewGroupName g) <> " then " <> highlight ("/d #" <> viewGroupName g) <> " to delete the group"
|
||||
]
|
||||
| otherwise -> ttyUser u $ [ttyGroup' g <> ": you left the group"] <> groupPreserved g
|
||||
CRGroupDeletedUser u g signed -> ttyUser u [ttyGroup' g <> ": you deleted the group" <> signedStr signed]
|
||||
CRForwardPlan u count itemIds fc -> ttyUser u $ viewForwardPlan count itemIds fc
|
||||
CRChatMsgContent u mc -> ttyUser u $ ttyMsgContent mc <> viewMsgTestInfo testView mc
|
||||
|
||||
+10
-10
@@ -9969,8 +9969,8 @@ testRelayRejectAfterLeave ps =
|
||||
-- relay leaves the channel: subscriber gets the signed leave notice via bob's
|
||||
-- DJRelayRemoved job, then has no relay to forward subsequent messages.
|
||||
bob ##> "/leave #team"
|
||||
bob <## "#team: you left the group"
|
||||
bob <## "use /d #team to delete the group"
|
||||
bob <## "#team: you left the group (future invitations will be rejected)"
|
||||
bob <## "use /relay allow #team then /d #team to delete the group"
|
||||
concurrentlyN_
|
||||
[ alice <## "#team: bob left the group (signed)",
|
||||
cath <## "#team: bob left the group (signed)"
|
||||
@@ -10034,8 +10034,8 @@ testRelayAllowAcceptsAgain ps =
|
||||
cath <# "#team> hello [>>]"
|
||||
|
||||
bob ##> "/leave #team"
|
||||
bob <## "#team: you left the group"
|
||||
bob <## "use /d #team to delete the group"
|
||||
bob <## "#team: you left the group (future invitations will be rejected)"
|
||||
bob <## "use /relay allow #team then /d #team to delete the group"
|
||||
concurrentlyN_
|
||||
[ alice <## "#team: bob left the group (signed)",
|
||||
cath <## "#team: bob left the group (signed)"
|
||||
@@ -10104,8 +10104,8 @@ testRelayDoesNotRejectUnrelatedChannel ps =
|
||||
threadDelay 100000
|
||||
|
||||
bob ##> "/leave #teama"
|
||||
bob <## "#teama: you left the group"
|
||||
bob <## "use /d #teama to delete the group"
|
||||
bob <## "#teama: you left the group (future invitations will be rejected)"
|
||||
bob <## "use /relay allow #teama then /d #teama to delete the group"
|
||||
alice <## "#teama: bob left the group (signed)"
|
||||
threadDelay 100000
|
||||
|
||||
@@ -10146,8 +10146,8 @@ testRelayRejectRaceConcurrentInvitations ps =
|
||||
cath <# "#team> hello [>>]"
|
||||
|
||||
bob ##> "/leave #team"
|
||||
bob <## "#team: you left the group"
|
||||
bob <## "use /d #team to delete the group"
|
||||
bob <## "#team: you left the group (future invitations will be rejected)"
|
||||
bob <## "use /relay allow #team then /d #team to delete the group"
|
||||
concurrentlyN_
|
||||
[ alice <## "#team: bob left the group (signed)",
|
||||
cath <## "#team: bob left the group (signed)"
|
||||
@@ -10202,8 +10202,8 @@ testRelayDeleteRejectedBlocked ps =
|
||||
cath <# "#team> hello [>>]"
|
||||
|
||||
bob ##> "/leave #team"
|
||||
bob <## "#team: you left the group"
|
||||
bob <## "use /d #team to delete the group"
|
||||
bob <## "#team: you left the group (future invitations will be rejected)"
|
||||
bob <## "use /relay allow #team then /d #team to delete the group"
|
||||
concurrentlyN_
|
||||
[ alice <## "#team: bob left the group (signed)",
|
||||
cath <## "#team: bob left the group (signed)"
|
||||
|
||||
Reference in New Issue
Block a user