ssb: Allow showing raw messages for contact messages.

This commit is contained in:
2025-08-13 12:14:31 -04:00
parent 6f11318e84
commit 73f4a3407f
2 changed files with 38 additions and 53 deletions

View File

@@ -1,5 +1,5 @@
{ {
"type": "tildefriends-app", "type": "tildefriends-app",
"emoji": "🦀", "emoji": "🦀",
"previous": "&3iV21tLQemlgG/Ui/WfYQyiprW/OBbFa8C3EKzPDt90=.sha256" "previous": "&TTGzyovmfKozjELCGPBFLLEXQcpfaArOMmqzemvz9J8=.sha256"
} }

View File

@@ -789,60 +789,45 @@ class TfMessageElement extends LitElement {
</div> </div>
`); `);
} else if (content.type == 'contact') { } else if (content.type == 'contact') {
return this.render_frame(html` switch (this.format) {
<div class="w3-bar"> case 'message':
<div class="w3-bar-item"> default:
<tf-user id=${this.message.author} .users=${this.users}></tf-user> return this.render_frame(html`
is <div class="w3-bar">
${content.blocking === true <div class="w3-bar-item">
? 'blocking' <tf-user
: content.blocking === false id=${this.message.author}
? 'no longer blocking' .users=${this.users}
: content.following === true ></tf-user>
? 'following' is
: content.following === false ${content.blocking === true
? 'no longer following' ? 'blocking'
: '?'} : content.blocking === false
<tf-user ? 'no longer blocking'
id=${this.message.content.contact} : content.following === true
.users=${this.users} ? 'following'
></tf-user> : content.following === false
</div> ? 'no longer following'
<div class="w3-bar-item w3-right"> : '?'}
<button class="w3-button w3-theme-d1" @click=${this.toggle_menu}> <tf-user
% id=${this.message.content.contact}
</button> .users=${this.users}
<div ></tf-user>
class="w3-dropdown-content w3-bar-block w3-card-4 w3-theme-l1" </div>
style="right: 48px" ${this.render_menu()} ${this.render_votes()}
> ${this.render_actions()}
<a
target="_top"
class="w3-button w3-bar-item"
href=${'#' + encodeURIComponent(this.message?.id)}
>View Message</a
>
<button
class="w3-button w3-bar-item w3-border-bottom"
@click=${this.copy_id}
>
Copy ID
</button>
${this.drafts[this.message?.id] === undefined
? html`
<button
class="w3-button w3-bar-item"
@click=${this.show_reply}
>
↩️ Reply
</button>
`
: undefined}
</div> </div>
`);
break;
case 'raw':
return this.render_frame(html`
${this.render_header()}
<div class="w3-container">${this.render_raw()}</div>
${this.render_votes()} ${this.render_actions()}
</div> </div>
${this.render_votes()} ${this.render_actions()} `);
</div> break;
`); }
} else if (content.type == 'post') { } else if (content.type == 'post') {
let self = this; let self = this;
let body; let body;