mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-03-30 16:25:57 +00:00
Merge branch 'stable'
This commit is contained in:
@@ -1342,9 +1342,9 @@ struct ChatView: View {
|
||||
if ci.chatDir != .groupSnd {
|
||||
if let (groupInfo, _) = ci.memberToModerate(chat.chatInfo) {
|
||||
moderateButton(ci, groupInfo)
|
||||
} else if ci.meta.itemDeleted == nil, case let .group(gInfo) = chat.chatInfo, gInfo.membership.memberRole == .member, !live, composeState.voiceMessageRecordingState == .noRecording {
|
||||
reportButton(ci)
|
||||
}
|
||||
} // else if ci.meta.itemDeleted == nil, case let .group(gInfo) = chat.chatInfo, gInfo.membership.memberRole == .member, !live, composeState.voiceMessageRecordingState == .noRecording {
|
||||
// reportButton(ci)
|
||||
// }
|
||||
}
|
||||
} else if ci.meta.itemDeleted != nil {
|
||||
if revealed {
|
||||
|
||||
@@ -400,9 +400,9 @@ fun ChatItemView(
|
||||
val groupInfo = cItem.memberToModerate(cInfo)?.first
|
||||
if (groupInfo != null) {
|
||||
ModerateItemAction(cItem, questionText = moderateMessageQuestionText(cInfo.featureEnabled(ChatFeature.FullDelete), 1), showMenu, deleteMessage)
|
||||
} else if (cItem.meta.itemDeleted == null && cInfo is ChatInfo.Group && cInfo.groupInfo.membership.memberRole == GroupMemberRole.Member && !live) {
|
||||
ReportItemAction(cItem, composeState, showMenu)
|
||||
}
|
||||
} // else if (cItem.meta.itemDeleted == null && cInfo is ChatInfo.Group && cInfo.groupInfo.membership.memberRole == GroupMemberRole.Member && !live) {
|
||||
// ReportItemAction(cItem, composeState, showMenu)
|
||||
// }
|
||||
}
|
||||
if (cItem.canBeDeletedForSelf) {
|
||||
Divider()
|
||||
|
||||
@@ -297,7 +297,7 @@ private fun AlertContent(
|
||||
belowTextContent: @Composable (() -> Unit) = {},
|
||||
content: @Composable (() -> Unit)
|
||||
) {
|
||||
BoxWithConstraints(Modifier.verticalScroll(rememberScrollState())) {
|
||||
BoxWithConstraints {
|
||||
Column(
|
||||
Modifier
|
||||
.padding(bottom = if (appPlatform.isDesktop) DEFAULT_PADDING else DEFAULT_PADDING_HALF)
|
||||
@@ -311,6 +311,7 @@ private fun AlertContent(
|
||||
if (text != null) {
|
||||
Column(Modifier.heightIn(max = this@BoxWithConstraints.maxHeight * 0.7f)
|
||||
.padding(start = DEFAULT_PADDING, end = DEFAULT_PADDING)
|
||||
.verticalScroll(rememberScrollState())
|
||||
) {
|
||||
SelectionContainer {
|
||||
Text(
|
||||
@@ -333,9 +334,10 @@ private fun AlertContent(
|
||||
|
||||
@Composable
|
||||
private fun AlertContent(text: AnnotatedString?, hostDevice: Pair<Long?, String>?, extraPadding: Boolean = false, content: @Composable (() -> Unit)) {
|
||||
BoxWithConstraints(Modifier.verticalScroll(rememberScrollState())) {
|
||||
BoxWithConstraints {
|
||||
Column(
|
||||
Modifier
|
||||
.verticalScroll(rememberScrollState())
|
||||
.padding(bottom = if (appPlatform.isDesktop) DEFAULT_PADDING else DEFAULT_PADDING_HALF)
|
||||
) {
|
||||
if (appPlatform.isDesktop) {
|
||||
@@ -347,6 +349,7 @@ private fun AlertContent(text: AnnotatedString?, hostDevice: Pair<Long?, String>
|
||||
if (text != null) {
|
||||
Column(
|
||||
Modifier.heightIn(max = this@BoxWithConstraints.maxHeight * 0.7f)
|
||||
.verticalScroll(rememberScrollState())
|
||||
) {
|
||||
SelectionContainer {
|
||||
Text(
|
||||
|
||||
@@ -40,7 +40,7 @@ import Data.Maybe (fromMaybe, mapMaybe)
|
||||
import Data.String
|
||||
import Data.Text (Text)
|
||||
import qualified Data.Text as T
|
||||
import Data.Text.Encoding (decodeASCII', decodeLatin1, encodeUtf8)
|
||||
import Data.Text.Encoding (decodeLatin1, encodeUtf8)
|
||||
import Data.Time.Clock (UTCTime)
|
||||
import Data.Type.Equality
|
||||
import Data.Typeable (Typeable)
|
||||
@@ -296,7 +296,7 @@ instance StrEncoding ReportReason where
|
||||
"community" -> pure RRCommunity
|
||||
"profile" -> pure RRProfile
|
||||
"other" -> pure RROther
|
||||
t -> maybe (fail "bad ReportReason") (pure . RRUnknown) $ decodeASCII' t
|
||||
t -> pure $ RRUnknown $ safeDecodeUtf8 t
|
||||
|
||||
instance FromJSON ReportReason where
|
||||
parseJSON = strParseJSON "ReportReason"
|
||||
|
||||
Reference in New Issue
Block a user