4 Commits

Author SHA1 Message Date
9c36e0db7b ssb: Show flagged messages similar to a message with a content warning.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 9m19s
2025-11-25 19:20:49 -05:00
fcd26bac1c ssb: Add some UI for posting 'flag' messages.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 9m8s
2025-11-25 19:04:52 -05:00
e8e7c98705 build: wip.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 9m14s
2025-11-25 18:31:25 -05:00
b5af5cc223 build: Let's start work on the December build. 2025-11-25 18:29:50 -05:00
10 changed files with 63 additions and 26 deletions

View File

@@ -16,9 +16,9 @@ MAKEFLAGS += --no-builtin-rules
## LD := Linker. ## LD := Linker.
## ANDROID_SDK := Path to the Android SDK. ## ANDROID_SDK := Path to the Android SDK.
VERSION_CODE := 48 VERSION_CODE := 49
VERSION_CODE_IOS := 26 VERSION_CODE_IOS := 27
VERSION_NUMBER := 0.2025.11 VERSION_NUMBER := 0.2025.12-wip
VERSION_NAME := This program kills fascists. VERSION_NAME := This program kills fascists.
IPHONEOS_VERSION_MIN=14.5 IPHONEOS_VERSION_MIN=14.5

View File

@@ -1,5 +1,5 @@
{ {
"type": "tildefriends-app", "type": "tildefriends-app",
"emoji": "🦀", "emoji": "🦀",
"previous": "&7dPNAI4sffljUTiwGr3XEUeB8sBD72CFkWMk/o0Z2pw=.sha256" "previous": "&ttk+7f/g/WgX4SRItibpx+2t+vs1/OcJm+1Xb1JFv6w=.sha256"
} }

View File

@@ -196,6 +196,26 @@ class TfMessageElement extends LitElement {
); );
} }
flag(event) {
let reason = prompt(
'What is the reason for reporting this content (spam, nsfw, ...)?',
'offensive'
);
if (reason !== undefined) {
tfrpc.rpc
.appendMessage(this.whoami, {
type: 'flag',
flag: {
link: this.message.id,
reason: reason.length ? reason : undefined,
},
})
.catch(function (error) {
alert(error?.message);
});
}
}
show_image(link) { show_image(link) {
let div = document.createElement('div'); let div = document.createElement('div');
div.style.left = 0; div.style.left = 0;
@@ -499,11 +519,14 @@ class TfMessageElement extends LitElement {
</button> </button>
` `
: undefined} : undefined}
<button class="w3-button w3-bar-item" @click=${this.react}>
👍 React
</button>
<button <button
class="w3-button w3-bar-item w3-border-bottom" class="w3-button w3-bar-item w3-border-bottom"
@click=${this.react} @click=${this.flag}
> >
👍 React ⚠️ Flag
</button> </button>
${formats.map( ${formats.map(
([format, name]) => html` ([format, name]) => html`
@@ -965,7 +988,11 @@ class TfMessageElement extends LitElement {
style="cursor: pointer" style="cursor: pointer"
@click=${(x) => this.toggle_expanded(':cw')} @click=${(x) => this.toggle_expanded(':cw')}
> >
<p>${content.contentWarning}</p> <p>
${this.message.flags
? `Caution: This message has been flagged ${this.message.flags.length} time${this.message.flags.length == 1 ? '' : 's'}.`
: content.contentWarning}
</p>
<p class="w3-small"> <p class="w3-small">
${this.is_expanded(':cw') ? 'Show less' : 'Show more'} ${this.is_expanded(':cw') ? 'Show less' : 'Show more'}
</p> </p>
@@ -976,11 +1003,12 @@ class TfMessageElement extends LitElement {
<div @click=${this.body_click}>${body}</div> <div @click=${this.body_click}>${body}</div>
${this.render_mentions()} ${this.render_mentions()}
`; `;
let payload = content.contentWarning let payload =
? self.expanded[(this.message.id || '') + ':cw'] this.message.flags || content.contentWarning
? html` ${content_warning} ${content_html} ` ? self.expanded[(this.message.id || '') + ':cw']
: content_warning ? html` ${content_warning} ${content_html} `
: content_html; : content_warning
: content_html;
return this.render_frame(html` return this.render_frame(html`
${this.render_header()} ${this.render_header()}
<div class="w3-container">${payload}</div> <div class="w3-container">${payload}</div>

View File

@@ -66,6 +66,16 @@ class TfNewsElement extends LitElement {
} }
parent.votes.push(message); parent.votes.push(message);
message.parent_message = message.content.vote.link; message.parent_message = message.content.vote.link;
} else if (message.content.type == 'flag') {
let parent = ensure_message(message.content.flag.link, message.rowid);
if (!parent.flags) {
parent.flags = [];
}
parent.flags.push(message);
parent.flags = Object.values(
Object.fromEntries(parent.flags.map((x) => [x.id, x]))
);
message.parent_message = message.content.flag.link;
} else if (message.content.type == 'post') { } else if (message.content.type == 'post') {
if (message.content.root) { if (message.content.root) {
if (typeof message.content.root === 'string') { if (typeof message.content.root === 'string') {

View File

@@ -84,7 +84,6 @@ class TfTabNewsFeedElement extends LitElement {
`, `,
[JSON.stringify(combined.map((x) => x.id))] [JSON.stringify(combined.map((x) => x.id))]
); );
let t0 = new Date();
let result = [].concat( let result = [].concat(
combined, combined,
await tfrpc.rpc.query( await tfrpc.rpc.query(
@@ -101,8 +100,7 @@ class TfTabNewsFeedElement extends LitElement {
] ]
) )
); );
let t1 = new Date(); console.log(result);
console.log((t1 - t0) / 1000);
return result; return result;
} }
@@ -227,7 +225,8 @@ class TfTabNewsFeedElement extends LitElement {
k_max_results, k_max_results,
] ]
); );
result = (await this.decrypt(result)).filter((x) => x.decrypted); let decrypted = (await this.decrypt(result)).filter((x) => x.decrypted);
result = await this._fetch_related_messages(decrypted);
} else if (this.hash == '#👍') { } else if (this.hash == '#👍') {
result = await tfrpc.rpc.query( result = await tfrpc.rpc.query(
` `

View File

@@ -25,14 +25,14 @@
}: }:
pkgs.stdenv.mkDerivation rec { pkgs.stdenv.mkDerivation rec {
pname = "tildefriends"; pname = "tildefriends";
version = "0.2025.9"; version = "0.2025.11";
src = pkgs.fetchFromGitea { src = pkgs.fetchFromGitea {
domain = "dev.tildefriends.net"; domain = "dev.tildefriends.net";
owner = "cory"; owner = "cory";
repo = "tildefriends"; repo = "tildefriends";
rev = "v${version}"; rev = "v${version}";
hash = "sha256-1nhsfhdOO5HIiiTMb+uROB8nDPL/UpOYm52hZ/OpPyk="; hash = "sha256-z4v4ghKOBTMv+agTUKg+HU8zfE4imluXFsozQCT4qX8=";
fetchSubmodules = true; fetchSubmodules = true;
}; };

6
flake.lock generated
View File

@@ -20,11 +20,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1758589230, "lastModified": 1763948260,
"narHash": "sha256-zMTCFGe8aVGTEr2RqUi/QzC1nOIQ0N1HRsbqB4f646k=", "narHash": "sha256-dY9qLD0H0zOUgU3vWacPY6Qc421BeQAfm8kBuBtPVE0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d1d883129b193f0b495d75c148c2c3a7d95789a0", "rev": "1c8ba8d3f7634acac4a2094eef7c32ad9106532c",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.unprompted.tildefriends" package="com.unprompted.tildefriends"
android:versionCode="48" android:versionCode="49"
android:versionName="0.2025.11"> android:versionName="0.2025.12-wip">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<application <application

View File

@@ -13,13 +13,13 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.2025.11</string> <string>0.2025.12</string>
<key>CFBundleSupportedPlatforms</key> <key>CFBundleSupportedPlatforms</key>
<array> <array>
<string>iPhoneOS</string> <string>iPhoneOS</string>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>26</string> <string>27</string>
<key>DTPlatformName</key> <key>DTPlatformName</key>
<string>iphoneos</string> <string>iphoneos</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>

View File

@@ -1,2 +1,2 @@
#define VERSION_NUMBER "0.2025.11" #define VERSION_NUMBER "0.2025.12-wip"
#define VERSION_NAME "This program kills fascists." #define VERSION_NAME "This program kills fascists."