Fix broken conversation

This commit is contained in:
Pleroma User 2025-10-07 06:48:17 +00:00 committed by HJ
commit 00ba6b7c5d
8 changed files with 47 additions and 26 deletions

2
changelog.d/broken.fix Normal file
View file

@ -0,0 +1,2 @@
Fix display of the broken/deleted/banned users

View file

@ -452,7 +452,7 @@ const Status = {
}, },
scrobblePresent () { scrobblePresent () {
if (this.mergedConfig.hideScrobbles) return false if (this.mergedConfig.hideScrobbles) return false
if (!this.status.user.latestScrobble) return false if (!this.status.user?.latestScrobble) return false
const value = this.mergedConfig.hideScrobblesAfter.match(/\d+/gs)[0] const value = this.mergedConfig.hideScrobblesAfter.match(/\d+/gs)[0]
const unit = this.mergedConfig.hideScrobblesAfter.match(/\D+/gs)[0] const unit = this.mergedConfig.hideScrobblesAfter.match(/\D+/gs)[0]
let multiplier = 60 * 1000 // minutes is smallest unit let multiplier = 60 * 1000 // minutes is smallest unit
@ -474,7 +474,7 @@ const Status = {
return this.status.user.latestScrobble.artist return this.status.user.latestScrobble.artist
}, },
scrobble () { scrobble () {
return this.status.user.latestScrobble return this.status.user?.latestScrobble
} }
}, },
methods: { methods: {

View file

@ -108,6 +108,10 @@
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
flex: 1 1 0; flex: 1 1 0;
&.unknown {
min-width: 8em;
}
} }
.heading-left { .heading-left {

View file

@ -109,6 +109,7 @@
class="left-side" class="left-side"
> >
<a <a
v-if="status.user?.name"
:href="$router.resolve(userProfileLink).href" :href="$router.resolve(userProfileLink).href"
@click.prevent @click.prevent
> >
@ -120,10 +121,17 @@
class="post-avatar" class="post-avatar"
:show-actor-type-indicator="showActorTypeIndicator" :show-actor-type-indicator="showActorTypeIndicator"
:compact="compact" :compact="compact"
:user="status.user" :user="status?.user"
/> />
</UserPopover> </UserPopover>
</a> </a>
<UserAvatar
v-else
:user="status?.user"
class="post-avatar"
:compact="compact"
:title="$t('status.unknown_user_info')"
/>
</div> </div>
<div class="right-side"> <div class="right-side">
<div <div
@ -133,29 +141,31 @@
<div class="heading-name-row"> <div class="heading-name-row">
<div class="heading-left"> <div class="heading-left">
<h4 <h4
v-if="status.user.name_html"
class="status-username" class="status-username"
:title="status.user.name" :title="status.user?.name ?? $t('status.unknown_user_info')"
>
<user-link
v-if="status.user?.name"
class="account-name"
:title="status.user?.screen_name_ui"
:user="status?.user"
:at="false"
> >
<RichContent <RichContent
v-if="status.user.name_html"
:html="status.user.name" :html="status.user.name"
:emoji="status.user.emoji" :emoji="status.user.emoji"
:is-local="status.user.is_local" :is-local="status.user.is_local"
/> />
</h4> <span v-else>{{ status.user.name }}</span>
<h4 </user-link>
<span
v-else v-else
class="status-username" class="account-name unknown"
:title="status.user.name"
> >
{{ status.user.name }} {{ $t('status.unknown_user') }}
</span>
</h4> </h4>
<user-link
class="account-name"
:title="status.user.screen_name_ui"
:user="status.user"
:at="false"
/>
<img <img
v-if="!!(status.user && status.user.favicon)" v-if="!!(status.user && status.user.favicon)"
class="status-favicon" class="status-favicon"

View file

@ -1346,6 +1346,8 @@
"show_content": "Show content", "show_content": "Show content",
"hide_content": "Hide content", "hide_content": "Hide content",
"status_deleted": "This post was deleted", "status_deleted": "This post was deleted",
"unknown_user": "unknown user",
"unknown_user_info": "Unable to fetch information about this user",
"nsfw": "NSFW", "nsfw": "NSFW",
"expand": "Expand", "expand": "Expand",
"you": "(You)", "you": "(You)",

View file

@ -111,7 +111,10 @@ const sortTimeline = (timeline) => {
const getLatestScrobble = (state, user) => { const getLatestScrobble = (state, user) => {
const scrobblesSupport = state.pleromaScrobblesAvailable const scrobblesSupport = state.pleromaScrobblesAvailable
if (!scrobblesSupport) return
if (!scrobblesSupport || !user.name || user.id === 'undefined') {
return
}
if (state.scrobblesNextFetch[user.id] && state.scrobblesNextFetch[user.id] > Date.now()) { if (state.scrobblesNextFetch[user.id] && state.scrobblesNextFetch[user.id] > Date.now()) {
return return

View file

@ -2,7 +2,7 @@ export const muteFilterHits = (muteFilters, status) => {
const statusText = status.text.toLowerCase() const statusText = status.text.toLowerCase()
const statusSummary = status.summary.toLowerCase() const statusSummary = status.summary.toLowerCase()
const replyToUser = status.in_reply_to_screen_name?.toLowerCase() const replyToUser = status.in_reply_to_screen_name?.toLowerCase()
const poster = status.user.screen_name.toLowerCase() const poster = status.user.screen_name?.toLowerCase()
const mentions = (status.attentions || []).map(att => att.screen_name.toLowerCase()) const mentions = (status.attentions || []).map(att => att.screen_name.toLowerCase())

View file

@ -46,7 +46,7 @@ const highlightStyle = (prefs) => {
const highlightClass = (user) => { const highlightClass = (user) => {
return 'USER____' + user.screen_name return 'USER____' + user.screen_name
.replace(/\./g, '_') ?.replace(/\./g, '_')
.replace(/@/g, '_AT_') .replace(/@/g, '_AT_')
} }