ssb: Consolidate/fix following and blocking messaging.

This commit is contained in:
2025-12-17 18:55:07 -05:00
parent 5c173b2695
commit 09a4fae432
2 changed files with 17 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
{
"type": "tildefriends-app",
"emoji": "🦀",
"previous": "&Gq9oYdYRgeFSi5TbP/K8xRFtRmcRFmKgnbsEgDzEDoE=.sha256"
"previous": "&GFcL8Yy2JlyaDK0HghfSEEVmr1NRWpxkqa7qKF2ygD4=.sha256"
}

View File

@@ -648,21 +648,25 @@ class TfMessageElement extends LitElement {
`;
}
contact_description(content) {
return content.following && content.blocking
? 'following and blocking'
: content.following
? 'following'
: content.blocking
? 'blocking'
: content.blocking !== undefined
? 'no longer blocking'
: content.following !== undefined
? 'no longer following'
: '';
}
content_group_by_author() {
let sorted = this.message.messages
.map((x) => [
x.author,
x.content.following && x.content.blocking
? 'is following and blocking'
: x.content.following
? 'is following'
: x.content.blocking
? 'is blocking'
: x.content.blocking !== undefined
? 'is no longer blocking'
: x.content.following !== undefined
? 'is no longer following'
: '',
this.contact_description(x.content),
x.content.contact,
x,
])
@@ -969,16 +973,7 @@ class TfMessageElement extends LitElement {
id=${this.message.author}
.users=${this.users}
></tf-user>
is
${content.blocking === true
? 'blocking'
: content.blocking === false
? 'no longer blocking'
: content.following === true
? 'following'
: content.following === false
? 'no longer following'
: '?'}
is ${this.contact_description(content)}
<tf-user
id=${this.message.content.contact}
.users=${this.users}