diff --git a/src/components/dms/getSystemMessageInfo.ts b/src/components/dms/getSystemMessageInfo.ts index f01d72cdde..756f178566 100644 --- a/src/components/dms/getSystemMessageInfo.ts +++ b/src/components/dms/getSystemMessageInfo.ts @@ -46,14 +46,19 @@ function getProfileAction( export function getSystemMessageInfo( data: ChatBskyConvoDefs.SystemMessageView['data'], relatedProfiles: Map, + opts = {short: false}, ): SystemMessageInfo | null { if (ChatBskyConvoDefs.isSystemMessageDataAddMember(data)) { const action = getProfileAction(data.member, relatedProfiles) return { Icon: JoinIcon, message: action - ? msg`${action.displayName} was added to the group` - : msg`Someone was added to the group`, + ? opts.short + ? msg`${action.displayName} was added` + : msg`${action.displayName} was added to the group` + : opts.short + ? msg`Someone was added` + : msg`Someone was added to the group`, action: action ?? undefined, } } else if (ChatBskyConvoDefs.isSystemMessageDataRemoveMember(data)) { @@ -61,8 +66,12 @@ export function getSystemMessageInfo( return { Icon: LeaveIcon, message: action - ? msg`${action.displayName} was removed from the group` - : msg`Someone was removed from the group`, + ? opts.short + ? msg`${action.displayName} was removed` + : msg`${action.displayName} was removed from the group` + : opts.short + ? msg`Someone was removed` + : msg`Someone was removed from the group`, action: action ?? undefined, } } else if (ChatBskyConvoDefs.isSystemMessageDataMemberJoin(data)) { @@ -70,8 +79,12 @@ export function getSystemMessageInfo( return { Icon: JoinIcon, message: action - ? msg`${action.displayName} joined the group` - : msg`Someone joined the group`, + ? opts.short + ? msg`${action.displayName} joined` + : msg`${action.displayName} joined the group` + : opts.short + ? msg`Someone joined` + : msg`Someone joined the group`, action: action ?? undefined, } } else if (ChatBskyConvoDefs.isSystemMessageDataMemberLeave(data)) { @@ -79,8 +92,12 @@ export function getSystemMessageInfo( return { Icon: LeaveIcon, message: action - ? msg`${action.displayName} left the group` - : msg`Someone left the group`, + ? opts.short + ? msg`${action.displayName} left` + : msg`${action.displayName} left the group` + : opts.short + ? msg`Someone left` + : msg`Someone left the group`, action: action ?? undefined, } } else if (ChatBskyConvoDefs.isSystemMessageDataLockConvo(data)) { @@ -92,9 +109,10 @@ export function getSystemMessageInfo( } else if (ChatBskyConvoDefs.isSystemMessageDataEditGroup(data)) { return { Icon: PencilIcon, - message: data.newName - ? msg`Chat title changed to ${data.newName}` - : msg`Chat title changed`, + message: + data.newName && !opts.short + ? msg`Chat title changed to ${data.newName}` + : msg`Chat title changed`, } } else if (ChatBskyConvoDefs.isSystemMessageDataCreateJoinLink(data)) { return { diff --git a/src/screens/Messages/components/ChatListItem.tsx b/src/screens/Messages/components/ChatListItem.tsx index 307aa53b11..1796eb5b0c 100644 --- a/src/screens/Messages/components/ChatListItem.tsx +++ b/src/screens/Messages/components/ChatListItem.tsx @@ -345,6 +345,7 @@ function BaseChatItem({ const info = getSystemMessageInfo( convo.view.lastMessage.data, new Map(convo.view.members.map(m => [m.did, m])), + {short: true}, ) if (info) { lastMessage = i18n._(info.message) @@ -425,6 +426,8 @@ function BaseChatItem({ }, } + const isGroupConvo = convo.kind === 'group' + const actions = hasUnread ? { leftFirst: markReadAction, @@ -481,12 +484,19 @@ function BaseChatItem({ @@ -495,7 +505,8 @@ function BaseChatItem({ - + - · {timeElapsed} + {timeElapsed} )} @@ -545,13 +556,28 @@ function BaseChatItem({ web({whiteSpace: 'preserve nowrap'}), ]}> {' '} - ·{' '} )} + {hasUnread && ( + + )} {subtitle && ( @@ -569,7 +595,12 @@ function BaseChatItem({ {LastMessageIcon && ( )} {lastMessage} @@ -589,24 +618,6 @@ function BaseChatItem({ {children} - - {hasUnread && ( - - )} )}