mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-09-27 15:48:54 +00:00
ui: show own support chat after leaving or being removed from the group
The "chat with admins" row is gated on membership.memberActive, which is false for left, removed, rejected and group deleted. Messages received in that chat before the user stopped being an active member stay unread with no way to open the chat and read them, and getUsersInfo counts every rcv_new item in a group, support scopes included, so they inflate the profile unread count until the whole profile is marked read. Reproduced by joining a group with admission review, being messaged by an admin in the support chat and then removed: two received items stay rcv_new with group_scope_tag member_support and a null scope member id, the id being null because it is the user's own support chat, and the profile count stays at 2. Reading that scope over the API clears it, so the items are reachable - only the UI hides them. Show the support chat whenever one exists, and apply the active member, group preference and role checks only to offering to start a new one.
This commit is contained in:
@@ -103,9 +103,10 @@ struct GroupChatInfoView: View {
|
||||
}
|
||||
}
|
||||
|
||||
let showUserSupportChat = groupInfo.membership.memberActive
|
||||
&& ((groupInfo.fullGroupPreferences.support.on && groupInfo.membership.memberRole < .moderator)
|
||||
|| groupInfo.membership.supportChat != nil)
|
||||
let showUserSupportChat = groupInfo.membership.supportChat != nil
|
||||
|| (groupInfo.membership.memberActive
|
||||
&& groupInfo.fullGroupPreferences.support.on
|
||||
&& groupInfo.membership.memberRole < .moderator)
|
||||
|
||||
if groupInfo.useRelays {
|
||||
Section {
|
||||
|
||||
+4
-3
@@ -629,9 +629,10 @@ fun ModalData.GroupChatInfoLayout(
|
||||
|
||||
var anyTopSectionRowShow = false
|
||||
val channelLink = groupInfo.groupProfile.publicGroup?.groupLink
|
||||
val showUserSupportChat = groupInfo.membership.memberActive &&
|
||||
((groupInfo.fullGroupPreferences.support.on && groupInfo.membership.memberRole < GroupMemberRole.Moderator)
|
||||
|| groupInfo.membership.supportChat != null)
|
||||
val showUserSupportChat = groupInfo.membership.supportChat != null ||
|
||||
(groupInfo.membership.memberActive
|
||||
&& groupInfo.fullGroupPreferences.support.on
|
||||
&& groupInfo.membership.memberRole < GroupMemberRole.Moderator)
|
||||
|
||||
if (groupInfo.useRelays) {
|
||||
SectionView {
|
||||
|
||||
Reference in New Issue
Block a user