Skip to content

Commit 32a9b05

Browse files
committed
chore(fc): update message context action sheet ordering and copy
Signed-off-by: Brandon McAnsh <[email protected]>
1 parent 3e81513 commit 32a9b05

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

flipchatApp/src/main/kotlin/xyz/flipchat/app/features/chat/conversation/ConversationViewModel.kt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,23 @@ class ConversationViewModel @Inject constructor(
979979
enableTip: Boolean,
980980
): List<MessageControlAction> {
981981
return mutableListOf<MessageControlAction>().apply {
982+
if (enableReply) {
983+
add(
984+
MessageControlAction.Reply {
985+
val sender = Sender(
986+
id = message.senderId,
987+
profileImage = member?.imageUri.takeIf { it.orEmpty().isNotEmpty() },
988+
displayName = member?.memberName ?: "Deleted",
989+
isSelf = contents.isFromSelf,
990+
isHost = message.senderId == stateFlow.value.hostId && !contents.isFromSelf,
991+
isBlocked = member?.isBlocked == true
992+
)
993+
val anchor = MessageReplyAnchor(message.id, sender, contents)
994+
dispatchEvent(Event.ReplyTo(anchor))
995+
}
996+
)
997+
}
998+
982999
if (enableTip) {
9831000
add(
9841001
MessageControlAction.Tip {
@@ -999,23 +1016,6 @@ class ConversationViewModel @Inject constructor(
9991016
)
10001017
}
10011018
)
1002-
1003-
if (enableReply) {
1004-
add(
1005-
MessageControlAction.Reply {
1006-
val sender = Sender(
1007-
id = message.senderId,
1008-
profileImage = member?.imageUri.takeIf { it.orEmpty().isNotEmpty() },
1009-
displayName = member?.memberName ?: "Deleted",
1010-
isSelf = contents.isFromSelf,
1011-
isHost = message.senderId == stateFlow.value.hostId && !contents.isFromSelf,
1012-
isBlocked = member?.isBlocked == true
1013-
)
1014-
val anchor = MessageReplyAnchor(message.id, sender, contents)
1015-
dispatchEvent(Event.ReplyTo(anchor))
1016-
}
1017-
)
1018-
}
10191019
} + buildSelfDefenseControls(message, member, contents)
10201020
}
10211021

flipchatApp/src/main/kotlin/xyz/flipchat/app/features/chat/conversation/MessageActionContextSheet.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ internal data class MessageActionContextSheet(val actions: List<MessageControlAc
9393
)
9494

9595
is MessageControlAction.Reply -> stringResource(R.string.action_reply)
96-
is MessageControlAction.Tip -> stringResource(R.string.action_tipUser)
96+
is MessageControlAction.Tip -> stringResource(R.string.action_giveTip)
9797
},
9898
style = CodeTheme.typography.textMedium.copy(
9999
color = if (action.isDestructive) CodeTheme.colors.errorText else CodeTheme.colors.textMain

flipchatApp/src/main/res/values/strings.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131

132132
<string name="permissions_description_push_messages">Receive push notifications when people message you.</string>
133133

134-
<string name="action_copyMessage">Copy</string>
134+
<string name="action_copyMessage">Copy Message</string>
135135
<string name="action_deleteMessage">Delete</string>
136136
<string name="action_blockUser">Block User</string>
137137
<string name="action_blockUserByName">Block %1$s</string>
@@ -202,7 +202,7 @@
202202
<string name="prompt_description_logout">You will need to enter your Access Key to get back into this account</string>
203203

204204
<string name="action_reply">Reply</string>
205-
<string name="action_tipUser">Tip User</string>
205+
<string name="action_giveTip">Give Tip</string>
206206

207207
<string name="title_betaFlags">Labs</string>
208208

0 commit comments

Comments
 (0)