4 Commits

Author SHA1 Message Date
3ae4b7086a build: Let's build 0.2025.9.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 30m53s
2025-09-24 15:02:22 -04:00
446b1f8600 ssb: Simplify some things to make funky layout issues with the sync now / stay connected buttons go away.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 31m3s
2025-09-24 13:43:33 -04:00
00fd208a2c ssb: Enough plumbing that if a blob is received, we will try to load the image again.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 32m24s
2025-09-24 11:34:34 -04:00
e574d03716 core: Prefer EXIT_FAILURE. 2025-09-24 10:09:40 -04:00
12 changed files with 56 additions and 18 deletions

View File

@@ -18,7 +18,7 @@ MAKEFLAGS += --no-builtin-rules
VERSION_CODE := 43 VERSION_CODE := 43
VERSION_CODE_IOS := 17 VERSION_CODE_IOS := 17
VERSION_NUMBER := 0.2025.9-wip VERSION_NUMBER := 0.2025.9
VERSION_NAME := This program kills fascists. VERSION_NAME := This program kills fascists.
IPHONEOS_VERSION_MIN=14.0 IPHONEOS_VERSION_MIN=14.0

View File

@@ -1,5 +1,5 @@
{ {
"type": "tildefriends-app", "type": "tildefriends-app",
"emoji": "🦀", "emoji": "🦀",
"previous": "&x37oguxC9LPiOHrvaPmRGa2HNRDNB8QbulsKzdEefnE=.sha256" "previous": "&IDzjVQjtPyhesUrl45qkZFjzWl0xVlj+2M/XXQRvXO0=.sha256"
} }

View File

@@ -76,6 +76,9 @@ tfrpc.register(function setHash(hash) {
core.register('onMessage', async function (id) { core.register('onMessage', async function (id) {
await tfrpc.rpc.notifyNewMessage(id); await tfrpc.rpc.notifyNewMessage(id);
}); });
core.register('onBlob', async function (id) {
await tfrpc.rpc.notifyNewBlob(id);
});
tfrpc.register(async function store_blob(blob) { tfrpc.register(async function store_blob(blob) {
if (Array.isArray(blob)) { if (Array.isArray(blob)) {
blob = Uint8Array.from(blob); blob = Uint8Array.from(blob);

View File

@@ -65,6 +65,17 @@ class TfElement extends LitElement {
tfrpc.register(async function notifyNewMessage(id) { tfrpc.register(async function notifyNewMessage(id) {
await self.fetch_new_message(id); await self.fetch_new_message(id);
}); });
tfrpc.register(async function notifyNewBlob(id) {
window.dispatchEvent(
new CustomEvent('blob-stored', {
bubbles: true,
composed: true,
detail: {
id: id,
},
})
);
});
tfrpc.register(function set(name, value) { tfrpc.register(function set(name, value) {
if (name === 'broadcasts') { if (name === 'broadcasts') {
self.broadcasts = value; self.broadcasts = value;
@@ -789,14 +800,13 @@ class TfElement extends LitElement {
class="w3-bar w3-theme-l1" class="w3-bar w3-theme-l1"
style="position: static; top: 0; z-index: 10" style="position: static; top: 0; z-index: 10"
> >
${this.is_administrator && self.tab != 'news' ${this.is_administrator
? html` ? html`
<button <button
class=${'w3-bar-item w3-button w3-circle w3-ripple' + class=${'w3-bar-item w3-button w3-circle w3-ripple' +
(this.connections?.some((x) => x.flags.one_shot) (this.connections?.some((x) => x.flags.one_shot)
? ' w3-spin' ? ' w3-spin'
: '')} : '')}
style="width: 1.5em; height: 1.5em; padding: 8px"
@click=${this.refresh} @click=${this.refresh}
> >

View File

@@ -45,11 +45,14 @@ class TfMessageElement extends LitElement {
connectedCallback() { connectedCallback() {
super.connectedCallback(); super.connectedCallback();
this._click_callback = this.document_click.bind(this); this._click_callback = this.document_click.bind(this);
this._blob_stored = this.blob_stored.bind(this);
document.body.addEventListener('mouseup', this._click_callback); document.body.addEventListener('mouseup', this._click_callback);
window.addEventListener('blob-stored', this._blob_stored);
} }
disconnectedCallback() { disconnectedCallback() {
super.disconnectedCallback(); super.disconnectedCallback();
window.removeEventListener('blob-stored', this._blob_stored);
document.body.removeEventListener('mouseup', this._click_callback); document.body.removeEventListener('mouseup', this._click_callback);
} }
@@ -61,6 +64,16 @@ class TfMessageElement extends LitElement {
} }
} }
blob_stored(event) {
let search = `/${event.detail.id}/view`;
for (let img of this.shadowRoot.querySelectorAll('img')) {
if (img.src.indexOf(search) != -1) {
let src = img.src.split('?')[0];
img.src = `${src}?${new Date().valueOf()}`;
}
}
}
show_reply() { show_reply() {
let event = new CustomEvent('tf-draft', { let event = new CustomEvent('tf-draft', {
bubbles: true, bubbles: true,

View File

@@ -693,6 +693,10 @@ ssb.addEventListener('message', function () {
broadcastEvent('onMessage', [...arguments]); broadcastEvent('onMessage', [...arguments]);
}); });
ssb.addEventListener('blob', function () {
broadcastEvent('onBlob', [...arguments]);
});
ssb.addEventListener('broadcasts', function () { ssb.addEventListener('broadcasts', function () {
broadcastEvent('onBroadcastsChanged', []); broadcastEvent('onBroadcastsChanged', []);
}); });

View File

@@ -0,0 +1,8 @@
* Fixed multiple issues with blob replication.
* Fixed some link encoding issues.
* Fixed some context menus being cut off.
* Minor Android fixes.
* Updates:
* CodeMirror
* OpenSSL 3.5.3
* QuickJS 2025-09-13

View File

@@ -2,7 +2,7 @@
<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="43" android:versionCode="43"
android:versionName="0.2025.9-wip"> android:versionName="0.2025.9">
<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

@@ -1578,28 +1578,28 @@ static void _shed_privileges()
if (setrlimit(RLIMIT_FSIZE, &zeroLimit) != 0) if (setrlimit(RLIMIT_FSIZE, &zeroLimit) != 0)
{ {
perror("setrlimit(RLIMIT_FSIZE, {0, 0})"); perror("setrlimit(RLIMIT_FSIZE, {0, 0})");
exit(-1); exit(EXIT_FAILURE);
} }
if (setrlimit(RLIMIT_NOFILE, &zeroLimit) != 0) if (setrlimit(RLIMIT_NOFILE, &zeroLimit) != 0)
{ {
perror("setrlimit(RLIMIT_NOFILE, {0, 0})"); perror("setrlimit(RLIMIT_NOFILE, {0, 0})");
exit(-1); exit(EXIT_FAILURE);
} }
if (setrlimit(RLIMIT_NPROC, &zeroLimit) != 0) if (setrlimit(RLIMIT_NPROC, &zeroLimit) != 0)
{ {
perror("setrlimit(RLIMIT_NPROC, {0, 0})"); perror("setrlimit(RLIMIT_NPROC, {0, 0})");
exit(-1); exit(EXIT_FAILURE);
} }
#if !defined(__MACH__) && !defined(__OpenBSD__) #if !defined(__MACH__) && !defined(__OpenBSD__)
if (setrlimit(RLIMIT_LOCKS, &zeroLimit) != 0) if (setrlimit(RLIMIT_LOCKS, &zeroLimit) != 0)
{ {
perror("setrlimit(RLIMIT_LOCKS, {0, 0})"); perror("setrlimit(RLIMIT_LOCKS, {0, 0})");
exit(-1); exit(EXIT_FAILURE);
} }
if (setrlimit(RLIMIT_MSGQUEUE, &zeroLimit) != 0) if (setrlimit(RLIMIT_MSGQUEUE, &zeroLimit) != 0)
{ {
perror("setrlimit(RLIMIT_MSGQUEUE, {0, 0})"); perror("setrlimit(RLIMIT_MSGQUEUE, {0, 0})");
exit(-1); exit(EXIT_FAILURE);
} }
#endif #endif
#endif #endif
@@ -1609,12 +1609,12 @@ static void _shed_privileges()
if (unveil("/dev/null", "r") || unveil(NULL, NULL)) if (unveil("/dev/null", "r") || unveil(NULL, NULL))
{ {
perror("unveil"); perror("unveil");
exit(-1); exit(EXIT_FAILURE);
} }
if (pledge("stdio unveil", NULL)) if (pledge("stdio unveil", NULL))
{ {
perror("pledge"); perror("pledge");
exit(-1); exit(EXIT_FAILURE);
} }
#endif #endif
} }
@@ -1831,7 +1831,7 @@ static void _error_handler(int sig)
const char* stack = tf_util_backtrace_string(); const char* stack = tf_util_backtrace_string();
tf_printf("ERROR:\n%s\n", stack); tf_printf("ERROR:\n%s\n", stack);
tf_free((void*)stack); tf_free((void*)stack);
_exit(1); _exit(EXIT_FAILURE);
} }
#if defined(_WIN32) #if defined(_WIN32)
@@ -1843,7 +1843,7 @@ static LONG WINAPI _win32_exception_handler(EXCEPTION_POINTERS* info)
const char* stack = tf_util_backtrace_string(); const char* stack = tf_util_backtrace_string();
tf_printf("ERROR:\n%s\n", stack); tf_printf("ERROR:\n%s\n", stack);
tf_free((void*)stack); tf_free((void*)stack);
_exit(1); _exit(EXIT_FAILURE);
} }
return EXCEPTION_CONTINUE_SEARCH; return EXCEPTION_CONTINUE_SEARCH;
} }

View File

@@ -976,7 +976,7 @@ static void _tf_ssb_db_blob_store_work(tf_ssb_t* ssb, void* user_data)
static void _tf_ssb_db_blob_store_after_work(tf_ssb_t* ssb, int status, void* user_data) static void _tf_ssb_db_blob_store_after_work(tf_ssb_t* ssb, int status, void* user_data)
{ {
blob_store_work_t* blob_work = user_data; blob_store_work_t* blob_work = user_data;
if (status == 0 && *blob_work->id) if (status == 0 && *blob_work->id && blob_work->is_new)
{ {
tf_ssb_notify_blob_stored(ssb, blob_work->id); tf_ssb_notify_blob_stored(ssb, blob_work->id);
} }

View File

@@ -1101,7 +1101,7 @@ void tf_task_on_receive_packet(int packetType, const char* begin, size_t length,
} }
else else
{ {
exit(1); exit(EXIT_FAILURE);
} }
break; break;
case kSetImports: case kSetImports:
@@ -1699,7 +1699,7 @@ void tf_task_activate(tf_task_t* task)
else else
{ {
tf_printf("Assignment missing '=': %s.\n", assignment); tf_printf("Assignment missing '=': %s.\n", assignment);
exit(1); exit(EXIT_FAILURE);
} }
} }
tf_free(copy); tf_free(copy);

View File

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