Compare commits
33 Commits
3f8daf257c
...
latest_rel
Author | SHA1 | Date | |
---|---|---|---|
c550f92003 | |||
ed836b3ee0 | |||
ac7a43abf4 | |||
49f19fce91 | |||
b2197eb8e9 | |||
5fbc2cae1c | |||
730abb49ce | |||
edccab054a | |||
e8210c6fdd | |||
55d69d7c13 | |||
50fb18d4ff | |||
77b1ea1fc8 | |||
61501a9b64 | |||
c1507adac5 | |||
45fb9eda1c | |||
982a61f4bf | |||
18e5b41663 | |||
910c39cbd0 | |||
9952dfd49d | |||
00f75d5382 | |||
d78828554b | |||
b84b561109 | |||
a618815500 | |||
e1f3dc6ae4 | |||
f378db6c6f | |||
7cec0f7d61 | |||
f902d0374c | |||
b5f0a0c4f7 | |||
00623cea09 | |||
ed4f1d6f2c | |||
73f4a3407f | |||
6f11318e84 | |||
e88ee91f0e |
14
GNUmakefile
14
GNUmakefile
@@ -16,9 +16,9 @@ MAKEFLAGS += --no-builtin-rules
|
||||
## LD := Linker.
|
||||
## ANDROID_SDK := Path to the Android SDK.
|
||||
|
||||
VERSION_CODE := 41
|
||||
VERSION_CODE := 42
|
||||
VERSION_CODE_IOS := 16
|
||||
VERSION_NUMBER := 0.2025.8-wip
|
||||
VERSION_NUMBER := 0.2025.8
|
||||
VERSION_NAME := This program kills fascists.
|
||||
|
||||
IPHONEOS_VERSION_MIN=14.0
|
||||
@@ -253,7 +253,10 @@ $(ANDROID_TARGETS): CFLAGS += \
|
||||
-fno-asynchronous-unwind-tables \
|
||||
-funwind-tables \
|
||||
-Wno-unknown-warning-option
|
||||
$(ANDROID_TARGETS): LDFLAGS += --sysroot $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/sysroot -fPIC
|
||||
$(ANDROID_TARGETS): LDFLAGS += \
|
||||
--sysroot $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/sysroot \
|
||||
-Wl,-z,max-page-size=16384 \
|
||||
-fPIC
|
||||
$(DEBUG_TARGETS): CFLAGS += -DDEBUG -Og
|
||||
$(DEBUG_TARGETS): LDFLAGS += -Og
|
||||
$(RELEASE_TARGETS): CFLAGS += \
|
||||
@@ -1140,6 +1143,11 @@ releaseapkgo: out/TildeFriends-arm-release.apk ## Build, install, and run a rele
|
||||
@adb shell am start com.unprompted.tildefriends/.TildeFriendsActivity
|
||||
.PHONY: releaseapkgo
|
||||
|
||||
x86releaseapkgo: out/TildeFriends-x86-release.apk ## Build, install, and run an x86 release Android APK.
|
||||
@adb install -r $<
|
||||
@adb shell am start com.unprompted.tildefriends/.TildeFriendsActivity
|
||||
.PHONY: x86releaseapkgo
|
||||
|
||||
apklog: ## Display Android log output.
|
||||
@adb logcat *:S tildefriends
|
||||
.PHONY: apklog
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"type": "tildefriends-app",
|
||||
"emoji": "🦀",
|
||||
"previous": "&2aXpc2RssZi3P9MUHjpjRl0wrDSS5HUIewtwOiCEDCg=.sha256"
|
||||
"previous": "&Hd6CuhhnZIf13PdFJYZBUYLYZO84WdaKvWXLC29M7Ac=.sha256"
|
||||
}
|
||||
|
@@ -21,7 +21,9 @@ class TfElement extends LitElement {
|
||||
channels_latest: {type: Object},
|
||||
guest: {type: Boolean},
|
||||
url: {type: String},
|
||||
private_closed: {type: Object},
|
||||
private_messages: {type: Array},
|
||||
grouped_private_messages: {type: Object},
|
||||
recent_reactions: {type: Array},
|
||||
is_administrator: {type: Boolean},
|
||||
stay_connected: {type: Boolean},
|
||||
@@ -48,6 +50,7 @@ class TfElement extends LitElement {
|
||||
this.loading_latest = 0;
|
||||
this.loading_latest_scheduled = 0;
|
||||
this.recent_reactions = [];
|
||||
this.private_closed = {};
|
||||
tfrpc.rpc.getBroadcasts().then((b) => {
|
||||
self.broadcasts = b || [];
|
||||
});
|
||||
@@ -85,9 +88,22 @@ class TfElement extends LitElement {
|
||||
this.whoami = whoami ?? (ids.length ? ids[0] : undefined);
|
||||
this.guest = !this.whoami?.length;
|
||||
this.ids = ids;
|
||||
let private_closed =
|
||||
(await tfrpc.rpc.databaseGet('private_closed')) ?? '{}';
|
||||
this.private_closed = JSON.parse(private_closed);
|
||||
await this.load_channels();
|
||||
}
|
||||
|
||||
async close_private_chat(event) {
|
||||
let update = {};
|
||||
update[event.detail.key] = true;
|
||||
this.private_closed = Object.assign(update, this.private_closed);
|
||||
await tfrpc.rpc.databaseSet(
|
||||
'private_closed',
|
||||
JSON.stringify(this.private_closed)
|
||||
);
|
||||
}
|
||||
|
||||
async load_channels() {
|
||||
let channels = await tfrpc.rpc.query(
|
||||
`
|
||||
@@ -135,12 +151,32 @@ class TfElement extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
visible_private() {
|
||||
if (!this.grouped_private_messages || !this.private_closed) {
|
||||
return [];
|
||||
}
|
||||
let self = this;
|
||||
return Object.fromEntries(
|
||||
Object.entries(this.grouped_private_messages).filter(([key, value]) => {
|
||||
let channel = '🔐' + [...new Set(JSON.parse(key))].sort().join(',');
|
||||
let grouped_latest = Math.max(...value.map((x) => x.rowid));
|
||||
return (
|
||||
!self.private_closed[key] ||
|
||||
self.channels_unread[channel] === undefined ||
|
||||
grouped_latest > self.channels_unread[channel]
|
||||
);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
next_channel(delta) {
|
||||
let channel_names = [
|
||||
'',
|
||||
'@',
|
||||
'👍',
|
||||
'🔐',
|
||||
...Object.keys(this.visible_private())
|
||||
.sort()
|
||||
.map((x) => '🔐' + JSON.parse(x).join(',')),
|
||||
...this.channels.map((x) => '#' + x),
|
||||
];
|
||||
let index = channel_names.indexOf(this.hash.substring(1));
|
||||
@@ -366,6 +402,36 @@ class TfElement extends LitElement {
|
||||
return result;
|
||||
}
|
||||
|
||||
async group_private_messages(messages) {
|
||||
let groups = {};
|
||||
let result = await this.decrypt(
|
||||
await tfrpc.rpc.query(
|
||||
`
|
||||
SELECT messages.rowid, messages.id, author, timestamp, json(content) AS content
|
||||
FROM messages
|
||||
JOIN json_each(?) AS ids
|
||||
WHERE messages.id = ids.value
|
||||
ORDER BY timestamp DESC
|
||||
`,
|
||||
[JSON.stringify(messages)]
|
||||
)
|
||||
);
|
||||
for (let message of result) {
|
||||
let key = JSON.stringify(
|
||||
[
|
||||
...new Set(
|
||||
message?.decrypted?.recps?.filter((x) => x != this.whoami)
|
||||
),
|
||||
].sort() ?? []
|
||||
);
|
||||
if (!groups[key]) {
|
||||
groups[key] = [];
|
||||
}
|
||||
groups[key].push(message);
|
||||
}
|
||||
return groups;
|
||||
}
|
||||
|
||||
async load_channels_latest(following) {
|
||||
let start_time = new Date();
|
||||
let latest_private = this.get_latest_private(following);
|
||||
@@ -438,12 +504,15 @@ class TfElement extends LitElement {
|
||||
console.log('channels took', (new Date() - start_time) / 1000.0);
|
||||
let self = this;
|
||||
start_time = new Date();
|
||||
latest_private.then(function (latest) {
|
||||
latest_private.then(async function (latest) {
|
||||
self.channels_latest = Object.assign({}, self.channels_latest, {
|
||||
'🔐': latest[0],
|
||||
});
|
||||
console.log('private took', (new Date() - start_time) / 1000.0);
|
||||
self.private_messages = latest[1];
|
||||
self.grouped_private_messages = await self.group_private_messages(
|
||||
latest[1]
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -628,8 +697,10 @@ class TfElement extends LitElement {
|
||||
@refresh=${this.refresh}
|
||||
@toggle_stay_connected=${this.toggle_stay_connected}
|
||||
@loadmessages=${this.reset_progress}
|
||||
@closeprivatechat=${this.close_private_chat}
|
||||
.connections=${this.connections}
|
||||
.private_messages=${this.private_messages}
|
||||
.grouped_private_messages=${this.visible_private()}
|
||||
.recent_reactions=${this.recent_reactions}
|
||||
?is_administrator=${this.is_administrator}
|
||||
?stay_connected=${this.stay_connected}
|
||||
|
@@ -16,6 +16,7 @@ class TfComposeElement extends LitElement {
|
||||
author: {type: String},
|
||||
channel: {type: String},
|
||||
new_thread: {type: Boolean},
|
||||
recipients: {type: Array},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -91,7 +92,9 @@ class TfComposeElement extends LitElement {
|
||||
bubbles: true,
|
||||
composed: true,
|
||||
detail: {
|
||||
id: this.branch,
|
||||
id:
|
||||
this.branch ??
|
||||
(this.recipients ? this.recipients.join(',') : undefined),
|
||||
draft: draft,
|
||||
},
|
||||
})
|
||||
@@ -291,7 +294,7 @@ class TfComposeElement extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
firstUpdated() {
|
||||
get_values() {
|
||||
let values = Object.entries(this.users).map((x) => ({
|
||||
key: x[1].name ?? x[0],
|
||||
value: x[0],
|
||||
@@ -307,11 +310,15 @@ class TfComposeElement extends LitElement {
|
||||
values
|
||||
);
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
firstUpdated() {
|
||||
let tribute = new Tribute({
|
||||
iframe: this.shadowRoot,
|
||||
collection: [
|
||||
{
|
||||
values: values,
|
||||
values: this.get_values(),
|
||||
selectTemplate: function (item) {
|
||||
return item
|
||||
? `[@${item.original.key}](${item.original.value})`
|
||||
@@ -330,6 +337,7 @@ class TfComposeElement extends LitElement {
|
||||
],
|
||||
});
|
||||
tribute.attach(this.renderRoot.getElementById('edit'));
|
||||
this._tribute = tribute;
|
||||
}
|
||||
|
||||
updated() {
|
||||
@@ -340,6 +348,7 @@ class TfComposeElement extends LitElement {
|
||||
preview.innerHTML = this.process_text(edit.innerText);
|
||||
this.last_updated_text = edit.innerText;
|
||||
}
|
||||
this._tribute.collection[0].values = this.get_values();
|
||||
let encrypt = this.renderRoot.getElementById('encrypt_to');
|
||||
if (encrypt) {
|
||||
let tribute = new Tribute({
|
||||
@@ -496,7 +505,17 @@ class TfComposeElement extends LitElement {
|
||||
}
|
||||
|
||||
get_draft() {
|
||||
return this.drafts[this.branch || ''] || {};
|
||||
let key =
|
||||
this.branch ||
|
||||
(this.recipients ? this.recipients.join(',') : undefined) ||
|
||||
'';
|
||||
let draft = this.drafts[key] || {};
|
||||
if (this.recipients && !draft.encrypt_to?.length) {
|
||||
draft.encrypt_to = [
|
||||
...new Set(this.recipients).union(new Set(draft.encrypt_to ?? [])),
|
||||
];
|
||||
}
|
||||
return draft;
|
||||
}
|
||||
|
||||
update_encrypt(event) {
|
||||
|
@@ -789,60 +789,45 @@ class TfMessageElement extends LitElement {
|
||||
</div>
|
||||
`);
|
||||
} else if (content.type == 'contact') {
|
||||
return this.render_frame(html`
|
||||
<div class="w3-bar">
|
||||
<div class="w3-bar-item">
|
||||
<tf-user 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'
|
||||
: '?'}
|
||||
<tf-user
|
||||
id=${this.message.content.contact}
|
||||
.users=${this.users}
|
||||
></tf-user>
|
||||
</div>
|
||||
<div class="w3-bar-item w3-right">
|
||||
<button class="w3-button w3-theme-d1" @click=${this.toggle_menu}>
|
||||
%
|
||||
</button>
|
||||
<div
|
||||
class="w3-dropdown-content w3-bar-block w3-card-4 w3-theme-l1"
|
||||
style="right: 48px"
|
||||
>
|
||||
<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}
|
||||
switch (this.format) {
|
||||
case 'message':
|
||||
default:
|
||||
return this.render_frame(html`
|
||||
<div class="w3-bar">
|
||||
<div class="w3-bar-item">
|
||||
<tf-user
|
||||
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'
|
||||
: '?'}
|
||||
<tf-user
|
||||
id=${this.message.content.contact}
|
||||
.users=${this.users}
|
||||
></tf-user>
|
||||
</div>
|
||||
${this.render_menu()} ${this.render_votes()}
|
||||
${this.render_actions()}
|
||||
</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>
|
||||
${this.render_votes()} ${this.render_actions()}
|
||||
</div>
|
||||
`);
|
||||
`);
|
||||
break;
|
||||
}
|
||||
} else if (content.type == 'post') {
|
||||
let self = this;
|
||||
let body;
|
||||
|
@@ -349,6 +349,9 @@ class TfProfileElement extends LitElement {
|
||||
${until(this.load_follows(), html`<p>Loading accounts followed...</p>`)}
|
||||
<footer class="w3-container">
|
||||
<p>
|
||||
<a class="w3-button w3-theme-d1" href=${'#🔐' + (this.id != this.whoami ? this.id : '')}>
|
||||
Open Private Chat
|
||||
</a>
|
||||
${edit}
|
||||
${follow}
|
||||
${block}
|
||||
|
@@ -43,6 +43,8 @@ const tf = css`
|
||||
border-left: 4px solid #fff;
|
||||
padding: 8px;
|
||||
padding-left: 12px;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
`;
|
||||
|
||||
|
@@ -18,6 +18,7 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
time_range: {type: Array},
|
||||
time_loading: {type: Array},
|
||||
private_messages: {type: Array},
|
||||
grouped_private_messages: {type: Object},
|
||||
recent_reactions: {type: Array},
|
||||
};
|
||||
}
|
||||
@@ -208,7 +209,9 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
console.log(
|
||||
`load of ${result.length} rows took ${(t2 - t0) / 1000} (${(t1 - t0) / 1000} to find ${initial_messages.length} initial messages, ${(t2 - t1) / 1000} to find ${result.length} total messages) following=${this.following.length} st=${start_time} et=${end_time}`
|
||||
);
|
||||
} else if (this.hash == '#🔐') {
|
||||
} else if (this.hash.startsWith('#🔐')) {
|
||||
let ids =
|
||||
this.hash == '#🔐' ? [] : this.hash.substring('#🔐'.length).split(',');
|
||||
result = await tfrpc.rpc.query(
|
||||
`
|
||||
SELECT TRUE AS is_primary, messages.rowid, messages.id, previous, author, sequence, timestamp, hash, json(content) AS content, signature
|
||||
@@ -220,7 +223,11 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
ORDER BY messages.rowid DESC LIMIT ?4
|
||||
`,
|
||||
[
|
||||
JSON.stringify(this.private_messages),
|
||||
JSON.stringify(
|
||||
this.grouped_private_messages?.[JSON.stringify(ids)]?.map(
|
||||
(x) => x.id
|
||||
) ?? []
|
||||
),
|
||||
start_time,
|
||||
end_time,
|
||||
k_max_results,
|
||||
@@ -379,12 +386,16 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
let self = this;
|
||||
this.loading++;
|
||||
let messages = [];
|
||||
let original_hash = this.hash;
|
||||
try {
|
||||
if (this._messages_hash !== this.hash) {
|
||||
this.messages = [];
|
||||
this._messages_hash = this.hash;
|
||||
}
|
||||
this._messages_following = this.following;
|
||||
this._messages_following = JSON.stringify(this.following);
|
||||
this._private_messages =
|
||||
JSON.stringify(this.private_messages) +
|
||||
JSON.stringify(this.grouped_private_messages);
|
||||
let now = new Date().valueOf();
|
||||
let start_time = now - 24 * 60 * 60 * 1000;
|
||||
this.start_time = start_time;
|
||||
@@ -397,7 +408,9 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
} finally {
|
||||
this.loading--;
|
||||
}
|
||||
this.messages = this.merge_messages(this.messages, messages);
|
||||
if (this.hash == original_hash) {
|
||||
this.messages = this.merge_messages(this.messages, messages);
|
||||
}
|
||||
this.time_loading = undefined;
|
||||
console.log(
|
||||
`loading ${messages.length} messages done for ${self.whoami} in ${(new Date() - start_time) / 1000}s`
|
||||
@@ -423,12 +436,42 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
close_private_chat() {
|
||||
this.mark_all_read();
|
||||
this.dispatchEvent(
|
||||
new CustomEvent('closeprivatechat', {
|
||||
bubbles: true,
|
||||
composed: true,
|
||||
detail: {
|
||||
key: JSON.stringify(
|
||||
this.hash == '#🔐'
|
||||
? []
|
||||
: this.hash.substring('#🔐'.length).split(',')
|
||||
),
|
||||
},
|
||||
})
|
||||
);
|
||||
tfrpc.rpc.setHash('#');
|
||||
}
|
||||
|
||||
render_close_chat_button() {
|
||||
if (this.hash.startsWith('#🔐')) {
|
||||
return html`
|
||||
<button class="w3-button w3-theme-d1" @click=${this.close_private_chat}>
|
||||
Close Chat
|
||||
</button>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
if (
|
||||
!this.messages ||
|
||||
this._messages_hash !== this.hash ||
|
||||
JSON.stringify(this._messages_following) !==
|
||||
JSON.stringify(this.following)
|
||||
this._messages_following !== JSON.stringify(this.following) ||
|
||||
this._private_messages !==
|
||||
JSON.stringify(this.private_messages) +
|
||||
JSON.stringify(this.grouped_private_messages)
|
||||
) {
|
||||
console.log(
|
||||
`loading messages for ${this.whoami} (following ${this.following.length})`
|
||||
@@ -488,6 +531,7 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
Mark All Read
|
||||
</button>`
|
||||
: undefined}
|
||||
${this.render_close_chat_button()}
|
||||
<tf-news
|
||||
id="news"
|
||||
whoami=${this.whoami}
|
||||
|
@@ -24,6 +24,7 @@ class TfTabNewsElement extends LitElement {
|
||||
channels_latest: {type: Object},
|
||||
connections: {type: Array},
|
||||
private_messages: {type: Array},
|
||||
grouped_private_messages: {type: Object},
|
||||
recent_reactions: {type: Array},
|
||||
peer_exchange: {type: Boolean},
|
||||
is_administrator: {type: Boolean},
|
||||
@@ -115,6 +116,19 @@ class TfTabNewsElement extends LitElement {
|
||||
) {
|
||||
return '✉️ ';
|
||||
}
|
||||
} else if (channel?.startsWith('🔐')) {
|
||||
let key = JSON.stringify(channel.substring('🔐'.length).split(','));
|
||||
if (this.grouped_private_messages?.[key]) {
|
||||
let grouped_latest = Math.max(
|
||||
...this.grouped_private_messages?.[key]?.map((x) => x.rowid)
|
||||
);
|
||||
if (
|
||||
this.channels_unread[channel] === undefined ||
|
||||
grouped_latest > this.channels_unread[channel]
|
||||
) {
|
||||
return '✉️ ';
|
||||
}
|
||||
}
|
||||
} else if (
|
||||
this.channels_latest[channel] &&
|
||||
this.channels_latest[channel] > 0 &&
|
||||
@@ -257,12 +271,29 @@ class TfTabNewsElement extends LitElement {
|
||||
style=${this.hash == '#👍' ? 'font-weight: bold' : undefined}
|
||||
>${this.unread_status('👍')}👍votes</a
|
||||
>
|
||||
<a
|
||||
href="#🔐"
|
||||
class="w3-bar-item w3-button"
|
||||
style=${this.hash == '#🔐' ? 'font-weight: bold' : undefined}
|
||||
>${this.unread_status('🔐')}🔐private</a
|
||||
>
|
||||
${Object.keys(this?.grouped_private_messages ?? [])
|
||||
?.sort()
|
||||
?.map(
|
||||
(key) => html`
|
||||
<a
|
||||
href=${'#🔐' + JSON.parse(key).join(',')}
|
||||
class="w3-bar-item w3-button"
|
||||
style=${this.hash == '#🔐' + JSON.parse(key).join(',')
|
||||
? 'font-weight: bold'
|
||||
: undefined}
|
||||
>${this.unread_status('🔐' + JSON.parse(key).join(','))}
|
||||
${(key != '[]' ? JSON.parse(key) : [this.whoami]).map(
|
||||
(id) => html`
|
||||
<tf-user
|
||||
id=${id}
|
||||
nolink="true"
|
||||
.users=${this.users}
|
||||
></tf-user>
|
||||
`
|
||||
)}</a
|
||||
>
|
||||
`
|
||||
)}
|
||||
${Object.keys(this.drafts)
|
||||
.sort()
|
||||
.map(
|
||||
@@ -418,6 +449,9 @@ class TfTabNewsElement extends LitElement {
|
||||
.drafts=${this.drafts}
|
||||
@tf-draft=${this.draft}
|
||||
.channel=${this.channel()}
|
||||
.recipients=${this.hash.startsWith('#🔐')
|
||||
? this.hash.substring('#🔐'.length).split(',')
|
||||
: undefined}
|
||||
></tf-compose>
|
||||
</div>
|
||||
${profile}
|
||||
@@ -434,6 +468,7 @@ class TfTabNewsElement extends LitElement {
|
||||
.channels_unread=${this.channels_unread}
|
||||
.channels_latest=${this.channels_latest}
|
||||
.private_messages=${this.private_messages}
|
||||
.grouped_private_messages=${this.grouped_private_messages}
|
||||
.recent_reactions=${this.recent_reactions}
|
||||
></tf-tab-news-feed>
|
||||
</div>
|
||||
|
@@ -9,6 +9,7 @@ class TfUserElement extends LitElement {
|
||||
fallback_name: {type: String},
|
||||
icon_only: {type: Boolean},
|
||||
users: {type: Object},
|
||||
nolink: {type: Boolean},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -37,7 +38,9 @@ class TfUserElement extends LitElement {
|
||||
let name_string = name ?? this.fallback_name ?? this.id;
|
||||
name = this.icon_only
|
||||
? undefined
|
||||
: html`<a target="_top" href=${'#' + this.id}>${name_string}</a>`;
|
||||
: !this.nolink
|
||||
? html`<a target="_top" href=${'#' + this.id}>${name_string}</a>`
|
||||
: html`<span>${name_string}</span>`;
|
||||
|
||||
if (user) {
|
||||
let image_link = user.image;
|
||||
@@ -56,7 +59,8 @@ class TfUserElement extends LitElement {
|
||||
}
|
||||
}
|
||||
return html` <div
|
||||
style="display: inline-block; vertical-align: middle; font-weight: bold; text-wrap: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis"
|
||||
style=${'display: inline-block; vertical-align: middle; text-wrap: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis' +
|
||||
(this.nolink ? '' : '; font-weight: bold')}
|
||||
>
|
||||
${image} ${name}
|
||||
</div>`;
|
||||
|
196
deps/codemirror_src/package-lock.json
generated
vendored
196
deps/codemirror_src/package-lock.json
generated
vendored
@@ -98,9 +98,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@codemirror/language": {
|
||||
"version": "6.11.2",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.11.2.tgz",
|
||||
"integrity": "sha512-p44TsNArL4IVXDTbapUmEkAlvWs2CFQbcfc0ymDsis1kH2wh0gcY96AS29c/vp2d0y2Tquk1EDSaawpzilUiAw==",
|
||||
"version": "6.11.3",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.11.3.tgz",
|
||||
"integrity": "sha512-9HBM2XnwDj7fnu0551HkGdrUrrqmYq/WC5iv6nbY2WdicXdGbhR/gfbZOH73Aqj4351alY1+aoG9rCNfiwS1RA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@codemirror/state": "^6.0.0",
|
||||
@@ -167,9 +167,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/gen-mapping": {
|
||||
"version": "0.3.12",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.12.tgz",
|
||||
"integrity": "sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg==",
|
||||
"version": "0.3.13",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
|
||||
"integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -188,9 +188,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/source-map": {
|
||||
"version": "0.3.10",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.10.tgz",
|
||||
"integrity": "sha512-0pPkgz9dY+bijgistcTTJ5mR+ocqRXLuhXHYdzoMmmoJ2C9S46RCm2GMUbatPEUK9Yjy26IrAy8D/M00lLkv+Q==",
|
||||
"version": "0.3.11",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz",
|
||||
"integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -199,16 +199,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/sourcemap-codec": {
|
||||
"version": "1.5.4",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.4.tgz",
|
||||
"integrity": "sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==",
|
||||
"version": "1.5.5",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
|
||||
"integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@jridgewell/trace-mapping": {
|
||||
"version": "0.3.29",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.29.tgz",
|
||||
"integrity": "sha512-uw6guiW/gcAGPDhLmd77/6lW8QLeiV5RUTsAX46Db6oLhGaVj4lhnPwb184s1bkc8kdVg/+h988dro8GRDpmYQ==",
|
||||
"version": "0.3.30",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.30.tgz",
|
||||
"integrity": "sha512-GQ7Nw5G2lTu/BtHTKfXhKHok2WGetd4XYcVKGx00SjAk8GMwgJM3zr6zORiPGuOE+/vkc90KtTosSSvaCjKb2Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -360,9 +360,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/rollup-android-arm-eabi": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.46.0.tgz",
|
||||
"integrity": "sha512-9f3nSTFI2ivfxc7/tHBHcJ8pRnp8ROrELvsVprlQPVvcZ+j5zztYd+PTJGpyIOAdTvNwNrpCXswKSeoQcyGjMQ==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.46.4.tgz",
|
||||
"integrity": "sha512-B2wfzCJ+ps/OBzRjeds7DlJumCU3rXMxJJS1vzURyj7+KBHGONm7c9q1TfdBl4vCuNMkDvARn3PBl2wZzuR5mw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -373,9 +373,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-android-arm64": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.46.0.tgz",
|
||||
"integrity": "sha512-tFZSEhqJ8Yrpe50TzOdeoYi72gi/jsnT7y8Qrozf3cNu28WX+s6I3XzEPUAqoaT9SAS8Xz9AzGTFlxxCH/w20w==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.46.4.tgz",
|
||||
"integrity": "sha512-FGJYXvYdn8Bs6lAlBZYT5n+4x0ciEp4cmttsvKAZc/c8/JiPaQK8u0c/86vKX8lA7OY/+37lIQSe0YoAImvBAA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -386,9 +386,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-darwin-arm64": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.46.0.tgz",
|
||||
"integrity": "sha512-+DikIIs+p6yU2hF51UaWG8BnHbq90X0QIOt5zqSKSZxY+G3qqdLih214e9InJal21af2PuuxkDectetGfbVPJw==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.46.4.tgz",
|
||||
"integrity": "sha512-/9qwE/BM7ATw/W/OFEMTm3dmywbJyLQb4f4v5nmOjgYxPIGpw7HaxRi6LnD4Pjn/q7k55FGeHe1/OD02w63apA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -399,9 +399,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-darwin-x64": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.46.0.tgz",
|
||||
"integrity": "sha512-5a+NofhdEB/WimSlFMskbFQn1vqz1FWryYpA99trmZGO6qEmiS0IsX6w4B3d91U878Q2ZQdiaFF1gxX4P147og==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.46.4.tgz",
|
||||
"integrity": "sha512-QkWfNbeRuzFnv2d0aPlrzcA3Ebq2mE8kX/5Pl7VdRShbPBjSnom7dbT8E3Jmhxo2RL784hyqGvR5KHavCJQciw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -412,9 +412,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-freebsd-arm64": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.46.0.tgz",
|
||||
"integrity": "sha512-igr/RlKPS3OCy4jD3XBmAmo3UAcNZkJSubRsw1JeM8bAbwf15k/3eMZXD91bnjheijJiOJcga3kfCLKjV8IXNg==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.46.4.tgz",
|
||||
"integrity": "sha512-+ToyOMYnSfV8D+ckxO6NthPln/PDNp1P6INcNypfZ7muLmEvPKXqduUiD8DlJpMMT8LxHcE5W0dK9kXfJke9Zw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -425,9 +425,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-freebsd-x64": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.46.0.tgz",
|
||||
"integrity": "sha512-MdigWzPSHlQzB1xZ+MdFDWTAH+kcn7UxjEBoOKuaso7z1DRlnAnrknB1mTtNOQ+GdPI8xgExAGwHeqQjntR0Cg==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.46.4.tgz",
|
||||
"integrity": "sha512-cGT6ey/W+sje6zywbLiqmkfkO210FgRz7tepWAzzEVgQU8Hn91JJmQWNqs55IuglG8sJdzk7XfNgmGRtcYlo1w==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -438,9 +438,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-arm-gnueabihf": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.46.0.tgz",
|
||||
"integrity": "sha512-dmZseE0ZwA/4yy1+BwFrDqFTjjNg24GO9xSrb1weVbt6AFkhp5pz1gVS7IMtfIvoWy8yp6q/zN0bKnefRUImvQ==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.46.4.tgz",
|
||||
"integrity": "sha512-9fhTJyOb275w5RofPSl8lpr4jFowd+H4oQKJ9XTYzD1JWgxdZKE8bA6d4npuiMemkecQOcigX01FNZNCYnQBdA==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -451,9 +451,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-arm-musleabihf": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.46.0.tgz",
|
||||
"integrity": "sha512-fzhfn6p9Cfm3W8UrWKIa4l7Wfjs/KGdgaswMBBE3KY3Ta43jg2XsPrAtfezHpsRk0Nx+TFuS3hZk/To2N5kFPQ==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.46.4.tgz",
|
||||
"integrity": "sha512-+6kCIM5Zjvz2HwPl/udgVs07tPMIp1VU2Y0c72ezjOvSvEfAIWsUgpcSDvnC7g9NrjYR6X9bZT92mZZ90TfvXw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -464,9 +464,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-arm64-gnu": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.46.0.tgz",
|
||||
"integrity": "sha512-vVDD+iPDPmJQ5nAQ5Tifq3ywdv60FartglFI8VOCK+hcU9aoG0qlQTsDJP97O5yiTaTqlneZWoARMcVC5nyUoQ==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.46.4.tgz",
|
||||
"integrity": "sha512-SWuXdnsayCZL4lXoo6jn0yyAj7TTjWE4NwDVt9s7cmu6poMhtiras5c8h6Ih6Y0Zk6Z+8t/mLumvpdSPTWub2Q==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -477,9 +477,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-arm64-musl": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.46.0.tgz",
|
||||
"integrity": "sha512-0d0jx08fzDHCzXqrtCMEEyxKU0SvJrWmUjUDE2/KDQ2UDJql0tfiwYvEx1oHELClKO8CNdE+AGJj+RqXscZpdQ==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.46.4.tgz",
|
||||
"integrity": "sha512-vDknMDqtMhrrroa5kyX6tuC0aRZZlQ+ipDfbXd2YGz5HeV2t8HOl/FDAd2ynhs7Ki5VooWiiZcCtxiZ4IjqZwQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -490,9 +490,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-loongarch64-gnu": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.46.0.tgz",
|
||||
"integrity": "sha512-XBYu9oW9eKJadWn8M7hkTZsD4yG+RrsTrVEgyKwb4L72cpJjRbRboTG9Lg9fec8MxJp/cfTHAocg4mnismQR8A==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.46.4.tgz",
|
||||
"integrity": "sha512-mCBkjRZWhvjtl/x+Bd4fQkWZT8canStKDxGrHlBiTnZmJnWygGcvBylzLVCZXka4dco5ymkWhZlLwKCGFF4ivw==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
@@ -503,9 +503,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-ppc64-gnu": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.46.0.tgz",
|
||||
"integrity": "sha512-wJaRvcT17PoOK6Ggcfo3nouFlybHvARBS4jzT0PC/lg17fIJHcDS2fZz3sD+iA4nRlho2zE6OGbU0HvwATdokQ==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.46.4.tgz",
|
||||
"integrity": "sha512-YMdz2phOTFF+Z66dQfGf0gmeDSi5DJzY5bpZyeg9CPBkV9QDzJ1yFRlmi/j7WWRf3hYIWrOaJj5jsfwgc8GTHQ==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
@@ -516,9 +516,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-riscv64-gnu": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.46.0.tgz",
|
||||
"integrity": "sha512-GZ5bkMFteAGkcmh8x0Ok4LSa+L62Ez0tMsHPX6JtR0wl4Xc3bQcrFHDiR5DGLEDFtGrXih4Nd/UDaFqs968/wA==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.46.4.tgz",
|
||||
"integrity": "sha512-r0WKLSfFAK8ucG024v2yiLSJMedoWvk8yWqfNICX28NHDGeu3F/wBf8KG6mclghx4FsLePxJr/9N8rIj1PtCnw==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
@@ -529,9 +529,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-riscv64-musl": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.46.0.tgz",
|
||||
"integrity": "sha512-7CjPw6FflFsVOUfWOrVrREiV3IYXG4RzZ1ZQUaT3BtSK8YXN6x286o+sruPZJESIaPebYuFowmg54ZdrkVBYog==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.46.4.tgz",
|
||||
"integrity": "sha512-IaizpPP2UQU3MNyPH1u0Xxbm73D+4OupL0bjo4Hm0496e2wg3zuvoAIhubkD1NGy9fXILEExPQy87mweujEatA==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
@@ -542,9 +542,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-s390x-gnu": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.46.0.tgz",
|
||||
"integrity": "sha512-nmvnl0ZiuysltcB/cKjUh40Rx4FbSyueERDsl2FLvLYr6pCgSsvGr3SocUT84svSpmloS7f1DRWqtRha74Gi1w==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.46.4.tgz",
|
||||
"integrity": "sha512-aCM29orANR0a8wk896p6UEgIfupReupnmISz6SUwMIwTGaTI8MuKdE0OD2LvEg8ondDyZdMvnaN3bW4nFbATPA==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
@@ -555,9 +555,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-x64-gnu": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.46.0.tgz",
|
||||
"integrity": "sha512-Cv+moII5C8RM6gZbR3cb21o6rquVDZrN2o81maROg1LFzBz2dZUwIQSxFA8GtGZ/F2KtsqQ2z3eFPBb6akvQNg==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.46.4.tgz",
|
||||
"integrity": "sha512-0Xj1vZE3cbr/wda8d/m+UeuSL+TDpuozzdD4QaSzu/xSOMK0Su5RhIkF7KVHFQsobemUNHPLEcYllL7ZTCP/Cg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -568,9 +568,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-x64-musl": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.46.0.tgz",
|
||||
"integrity": "sha512-PHcMG8DZTM9RCIjp8QIfN0VYtX0TtBPnWOTRurFhoCDoi9zptUZL2k7pCs+5rgut7JAiUsYy+huyhVKPcmxoog==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.46.4.tgz",
|
||||
"integrity": "sha512-kM/orjpolfA5yxsx84kI6bnK47AAZuWxglGKcNmokw2yy9i5eHY5UAjcX45jemTJnfHAWo3/hOoRqEeeTdL5hw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -581,9 +581,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-win32-arm64-msvc": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.46.0.tgz",
|
||||
"integrity": "sha512-1SI/Rd47e8aQJeFWMDg16ET+fjvCcD/CzeaRmIEPmb05hx+3cCcwIF4ebUag4yTt/D1peE+Mgp0+Po3M358cAA==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.46.4.tgz",
|
||||
"integrity": "sha512-cNLH4psMEsWKILW0isbpQA2OvjXLbKvnkcJFmqAptPQbtLrobiapBJVj6RoIvg6UXVp5w0wnIfd/Q56cNpF+Ew==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -594,9 +594,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-win32-ia32-msvc": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.46.0.tgz",
|
||||
"integrity": "sha512-JwOCYxmumFDfDhx4kNyz6kTVK3gWzBIvVdMNzQMRDubcoGRDniOOmo6DDNP42qwZx3Bp9/6vWJ+kNzNqXoHmeA==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.46.4.tgz",
|
||||
"integrity": "sha512-OiEa5lRhiANpv4SfwYVgQ3opYWi/QmPDC5ve21m8G9pf6ZO+aX1g2EEF1/IFaM1xPSP7mK0msTRXlPs6mIagkg==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
@@ -607,9 +607,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-win32-x64-msvc": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.46.0.tgz",
|
||||
"integrity": "sha512-IPMIfrfkG1GaEXi+JSsQEx8x9b4b+hRZXO7KYc2pKio3zO2/VDXDs6B9Ts/nnO+25Fk1tdAVtUn60HKKPPzDig==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.46.4.tgz",
|
||||
"integrity": "sha512-IKL9mewGZ5UuuX4NQlwOmxPyqielvkAPUS2s1cl6yWjjQvyN3h5JTdVFGD5Jr5xMjRC8setOfGQDVgX8V+dkjg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -799,9 +799,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/rollup": {
|
||||
"version": "4.46.0",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.46.0.tgz",
|
||||
"integrity": "sha512-ONmkT3Ud3IfW15nl7l4qAZko5/2iZ5ALVBDh02ZSZ5IGVLJSYkRcRa3iB58VyEIyoofs9m2xdVrm+lTi97+3pw==",
|
||||
"version": "4.46.4",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.46.4.tgz",
|
||||
"integrity": "sha512-YbxoxvoqNg9zAmw4+vzh1FkGAiZRK+LhnSrbSrSXMdZYsRPDWoshcSd/pldKRO6lWzv/e9TiJAVQyirYIeSIPQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/estree": "1.0.8"
|
||||
@@ -814,26 +814,26 @@
|
||||
"npm": ">=8.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rollup/rollup-android-arm-eabi": "4.46.0",
|
||||
"@rollup/rollup-android-arm64": "4.46.0",
|
||||
"@rollup/rollup-darwin-arm64": "4.46.0",
|
||||
"@rollup/rollup-darwin-x64": "4.46.0",
|
||||
"@rollup/rollup-freebsd-arm64": "4.46.0",
|
||||
"@rollup/rollup-freebsd-x64": "4.46.0",
|
||||
"@rollup/rollup-linux-arm-gnueabihf": "4.46.0",
|
||||
"@rollup/rollup-linux-arm-musleabihf": "4.46.0",
|
||||
"@rollup/rollup-linux-arm64-gnu": "4.46.0",
|
||||
"@rollup/rollup-linux-arm64-musl": "4.46.0",
|
||||
"@rollup/rollup-linux-loongarch64-gnu": "4.46.0",
|
||||
"@rollup/rollup-linux-ppc64-gnu": "4.46.0",
|
||||
"@rollup/rollup-linux-riscv64-gnu": "4.46.0",
|
||||
"@rollup/rollup-linux-riscv64-musl": "4.46.0",
|
||||
"@rollup/rollup-linux-s390x-gnu": "4.46.0",
|
||||
"@rollup/rollup-linux-x64-gnu": "4.46.0",
|
||||
"@rollup/rollup-linux-x64-musl": "4.46.0",
|
||||
"@rollup/rollup-win32-arm64-msvc": "4.46.0",
|
||||
"@rollup/rollup-win32-ia32-msvc": "4.46.0",
|
||||
"@rollup/rollup-win32-x64-msvc": "4.46.0",
|
||||
"@rollup/rollup-android-arm-eabi": "4.46.4",
|
||||
"@rollup/rollup-android-arm64": "4.46.4",
|
||||
"@rollup/rollup-darwin-arm64": "4.46.4",
|
||||
"@rollup/rollup-darwin-x64": "4.46.4",
|
||||
"@rollup/rollup-freebsd-arm64": "4.46.4",
|
||||
"@rollup/rollup-freebsd-x64": "4.46.4",
|
||||
"@rollup/rollup-linux-arm-gnueabihf": "4.46.4",
|
||||
"@rollup/rollup-linux-arm-musleabihf": "4.46.4",
|
||||
"@rollup/rollup-linux-arm64-gnu": "4.46.4",
|
||||
"@rollup/rollup-linux-arm64-musl": "4.46.4",
|
||||
"@rollup/rollup-linux-loongarch64-gnu": "4.46.4",
|
||||
"@rollup/rollup-linux-ppc64-gnu": "4.46.4",
|
||||
"@rollup/rollup-linux-riscv64-gnu": "4.46.4",
|
||||
"@rollup/rollup-linux-riscv64-musl": "4.46.4",
|
||||
"@rollup/rollup-linux-s390x-gnu": "4.46.4",
|
||||
"@rollup/rollup-linux-x64-gnu": "4.46.4",
|
||||
"@rollup/rollup-linux-x64-musl": "4.46.4",
|
||||
"@rollup/rollup-win32-arm64-msvc": "4.46.4",
|
||||
"@rollup/rollup-win32-ia32-msvc": "4.46.4",
|
||||
"@rollup/rollup-win32-x64-msvc": "4.46.4",
|
||||
"fsevents": "~2.3.2"
|
||||
}
|
||||
},
|
||||
|
2
deps/speedscope/index.html
vendored
2
deps/speedscope/index.html
vendored
@@ -11,7 +11,7 @@
|
||||
<link rel="icon" type="image/x-icon" href="favicon-FOKUP5Y5.ico">
|
||||
</head>
|
||||
<body>
|
||||
<script src="speedscope-7YPLLUY2.js"></script>
|
||||
<script src="speedscope-HCR63FMT.js"></script>
|
||||
|
||||
|
||||
|
||||
|
6
deps/speedscope/release.txt
vendored
6
deps/speedscope/release.txt
vendored
@@ -1,3 +1,3 @@
|
||||
speedscope@1.23.0
|
||||
Sun Jul 6 20:04:28 PDT 2025
|
||||
aa9bef50789a2989746b576fff182b6f01dfce6a
|
||||
speedscope@1.23.1
|
||||
Mon Aug 11 11:43:09 PDT 2025
|
||||
0cec0f82c334aed6cf19d43cabeadcda0d95e0fc
|
||||
|
File diff suppressed because one or more lines are too long
9
metadata/en-US/changelogs/42.txt
Normal file
9
metadata/en-US/changelogs/42.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
* Private messages interface overhaul in progress.
|
||||
* Added a loading indicator.
|
||||
* Documented the core JavaScript.
|
||||
* Fixed @-completion.
|
||||
* Covered up launch on Android with the splash screen.
|
||||
* Update:
|
||||
* CodeMirror
|
||||
* OpenSSL 3.5.2
|
||||
* speedscope 1.23.1
|
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.unprompted.tildefriends"
|
||||
android:versionCode="41"
|
||||
android:versionName="0.2025.8-wip">
|
||||
android:versionCode="42"
|
||||
android:versionName="0.2025.8">
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<application
|
||||
|
@@ -25,6 +25,7 @@ import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
import android.view.Window;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.webkit.CookieManager;
|
||||
import android.webkit.DownloadListener;
|
||||
import android.webkit.JsPromptResult;
|
||||
@@ -58,6 +59,8 @@ public class TildeFriendsActivity extends Activity {
|
||||
private ValueCallback<Uri[]> upload_message;
|
||||
private final static int FILECHOOSER_RESULT = 1;
|
||||
private float touch_down_y;
|
||||
private boolean ready = false;
|
||||
private boolean loaded = false;
|
||||
|
||||
static {
|
||||
Log.w("tildefriends", "Calling system.loadLibrary().");
|
||||
@@ -70,7 +73,6 @@ public class TildeFriendsActivity extends Activity {
|
||||
|
||||
private void createThread() {
|
||||
web_view = (TildeFriendsWebView)findViewById(R.id.web);
|
||||
set_status("Extracting executable...");
|
||||
Log.w("tildefriends", String.format("getFilesDir() is %s", getFilesDir().toString()));
|
||||
Log.w("tildefriends", String.format("getPackageResourcePath() is %s", getPackageResourcePath().toString()));
|
||||
Log.w("tildefriends", String.format("nativeLibraryDir is %s", getApplicationInfo().nativeLibraryDir));
|
||||
@@ -81,14 +83,13 @@ public class TildeFriendsActivity extends Activity {
|
||||
|
||||
TildeFriendsActivity activity = this;
|
||||
|
||||
Log.w("tildefriends", "Watching for changes in: " + getFilesDir().toString());
|
||||
observer = make_file_observer(getFilesDir().toString(), port_file_path);
|
||||
observer.startWatching();
|
||||
|
||||
set_status("Starting server...");
|
||||
server_thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.w("tildefriends", "Watching for changes in: " + getFilesDir().toString());
|
||||
observer = make_file_observer(getFilesDir().toString(), port_file_path);
|
||||
observer.startWatching();
|
||||
|
||||
Log.w("tildefriends", "Calling tf_server_main.");
|
||||
int result = tf_server_main(
|
||||
getFilesDir().toString(),
|
||||
@@ -233,6 +234,7 @@ public class TildeFriendsActivity extends Activity {
|
||||
});
|
||||
|
||||
web_view.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request)
|
||||
{
|
||||
if (request.getUrl() != null && request.getUrl().toString().startsWith(base_url)) {
|
||||
@@ -242,6 +244,11 @@ public class TildeFriendsActivity extends Activity {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
s_activity.loaded = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -271,6 +278,21 @@ public class TildeFriendsActivity extends Activity {
|
||||
refresh.setVisibility(View.GONE);
|
||||
refresh.setText("REFRESH");
|
||||
|
||||
final View content = findViewById(android.R.id.content);
|
||||
content.getViewTreeObserver().addOnPreDrawListener(
|
||||
new ViewTreeObserver.OnPreDrawListener() {
|
||||
@Override
|
||||
public boolean onPreDraw() {
|
||||
if (s_activity.ready && s_activity.loaded) {
|
||||
content.getViewTreeObserver().removeOnPreDrawListener(this);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
create_thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -376,19 +398,6 @@ public class TildeFriendsActivity extends Activity {
|
||||
return -1;
|
||||
}
|
||||
|
||||
private void set_status(String text) {
|
||||
TextView text_view = (TextView)findViewById(R.id.text);
|
||||
web_view.setVisibility(View.GONE);
|
||||
text_view.setVisibility(View.VISIBLE);
|
||||
text_view.setText(text);
|
||||
}
|
||||
|
||||
private void hide_status() {
|
||||
TextView text_view = (TextView)findViewById(R.id.text);
|
||||
web_view.setVisibility(View.VISIBLE);
|
||||
text_view.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public static void start_sandbox(int pipe_fd) {
|
||||
Log.w("tildefriends", "starting service with fd: " + pipe_fd);
|
||||
Intent intent = new Intent(s_activity, TildeFriendsSandboxService.class);
|
||||
@@ -442,14 +451,11 @@ public class TildeFriendsActivity extends Activity {
|
||||
if (port >= 0) {
|
||||
base_url = "http://127.0.0.1:" + String.valueOf(port) + "/";
|
||||
runOnUiThread(() -> {
|
||||
hide_status();
|
||||
ready = true;
|
||||
web_view.loadUrl(base_url + "login/auto");
|
||||
});
|
||||
observer.stopWatching();
|
||||
observer = null;
|
||||
} else {
|
||||
runOnUiThread(() -> {
|
||||
set_status("Waiting to connect...");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -10,11 +10,6 @@
|
||||
android:id="@+id/web"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal|center_vertical"/>
|
||||
<TextView
|
||||
android:id="@+id/refresh"
|
||||
android:layout_width="match_parent"
|
||||
|
87
src/ssb.c
87
src/ssb.c
@@ -133,6 +133,15 @@ typedef struct _tf_ssb_message_added_callback_node_t
|
||||
tf_ssb_message_added_callback_node_t* next;
|
||||
} tf_ssb_message_added_callback_node_t;
|
||||
|
||||
typedef struct _tf_ssb_blob_stored_callback_node_t tf_ssb_blob_stored_callback_node_t;
|
||||
typedef struct _tf_ssb_blob_stored_callback_node_t
|
||||
{
|
||||
tf_ssb_blob_stored_callback_t* callback;
|
||||
tf_ssb_callback_cleanup_t* cleanup;
|
||||
void* user_data;
|
||||
tf_ssb_blob_stored_callback_node_t* next;
|
||||
} tf_ssb_blob_stored_callback_node_t;
|
||||
|
||||
typedef struct _tf_ssb_blob_want_added_callback_node_t tf_ssb_blob_want_added_callback_node_t;
|
||||
typedef struct _tf_ssb_blob_want_added_callback_node_t
|
||||
{
|
||||
@@ -235,6 +244,9 @@ typedef struct _tf_ssb_t
|
||||
tf_ssb_message_added_callback_node_t* message_added;
|
||||
int message_added_count;
|
||||
|
||||
tf_ssb_blob_stored_callback_node_t* blob_stored;
|
||||
int blob_stored_count;
|
||||
|
||||
tf_ssb_blob_want_added_callback_node_t* blob_want_added;
|
||||
int blob_want_added_count;
|
||||
|
||||
@@ -2741,6 +2753,17 @@ void tf_ssb_destroy(tf_ssb_t* ssb)
|
||||
}
|
||||
tf_free(node);
|
||||
}
|
||||
while (ssb->blob_stored)
|
||||
{
|
||||
tf_ssb_blob_stored_callback_node_t* node = ssb->blob_stored;
|
||||
ssb->blob_stored = node->next;
|
||||
ssb->blob_stored_count--;
|
||||
if (node->cleanup)
|
||||
{
|
||||
node->cleanup(ssb, node->user_data);
|
||||
}
|
||||
tf_free(node);
|
||||
}
|
||||
while (ssb->blob_want_added)
|
||||
{
|
||||
tf_ssb_blob_want_added_callback_node_t* node = ssb->blob_want_added;
|
||||
@@ -2783,6 +2806,16 @@ void tf_ssb_destroy(tf_ssb_t* ssb)
|
||||
|
||||
uv_run(ssb->loop, UV_RUN_NOWAIT);
|
||||
|
||||
if (ssb->own_context)
|
||||
{
|
||||
if (!ssb->quiet)
|
||||
{
|
||||
tf_printf("closing ssb context\n");
|
||||
}
|
||||
JS_FreeContext(ssb->context);
|
||||
JS_FreeRuntime(ssb->runtime);
|
||||
ssb->own_context = false;
|
||||
}
|
||||
if (ssb->loop == &ssb->own_loop)
|
||||
{
|
||||
if (!ssb->quiet)
|
||||
@@ -2799,16 +2832,6 @@ void tf_ssb_destroy(tf_ssb_t* ssb)
|
||||
{
|
||||
tf_printf("uv loop closed.\n");
|
||||
}
|
||||
if (ssb->own_context)
|
||||
{
|
||||
if (!ssb->quiet)
|
||||
{
|
||||
tf_printf("closing ssb context\n");
|
||||
}
|
||||
JS_FreeContext(ssb->context);
|
||||
JS_FreeRuntime(ssb->runtime);
|
||||
ssb->own_context = false;
|
||||
}
|
||||
while (ssb->broadcasts)
|
||||
{
|
||||
tf_ssb_broadcast_t* broadcast = ssb->broadcasts;
|
||||
@@ -3960,9 +3983,53 @@ void tf_ssb_remove_message_added_callback(tf_ssb_t* ssb, tf_ssb_message_added_ca
|
||||
}
|
||||
}
|
||||
|
||||
void tf_ssb_add_blob_stored_callback(tf_ssb_t* ssb, tf_ssb_blob_stored_callback_t* callback, void (*cleanup)(tf_ssb_t* ssb, void* user_data), void* user_data)
|
||||
{
|
||||
tf_ssb_blob_stored_callback_node_t* node = tf_malloc(sizeof(tf_ssb_blob_stored_callback_node_t));
|
||||
*node = (tf_ssb_blob_stored_callback_node_t) {
|
||||
.callback = callback,
|
||||
.cleanup = cleanup,
|
||||
.user_data = user_data,
|
||||
.next = ssb->blob_stored,
|
||||
};
|
||||
ssb->blob_stored = node;
|
||||
ssb->blob_stored_count++;
|
||||
}
|
||||
|
||||
void tf_ssb_remove_blob_stored_callback(tf_ssb_t* ssb, tf_ssb_blob_stored_callback_t* callback, void* user_data)
|
||||
{
|
||||
tf_ssb_blob_stored_callback_node_t** it = &ssb->blob_stored;
|
||||
while (*it)
|
||||
{
|
||||
if ((*it)->callback == callback && (*it)->user_data == user_data)
|
||||
{
|
||||
tf_ssb_blob_stored_callback_node_t* node = *it;
|
||||
*it = node->next;
|
||||
ssb->blob_stored_count--;
|
||||
if (node->cleanup)
|
||||
{
|
||||
node->cleanup(ssb, node->user_data);
|
||||
}
|
||||
tf_free(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
it = &(*it)->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void tf_ssb_notify_blob_stored(tf_ssb_t* ssb, const char* id)
|
||||
{
|
||||
tf_ssb_blob_stored_callback_node_t* next = NULL;
|
||||
ssb->blobs_stored++;
|
||||
for (tf_ssb_blob_stored_callback_node_t* node = ssb->blob_stored; node; node = next)
|
||||
{
|
||||
next = node->next;
|
||||
tf_trace_begin(ssb->trace, "blob stored callback");
|
||||
node->callback(ssb, id, node->user_data);
|
||||
tf_trace_end(ssb->trace);
|
||||
}
|
||||
}
|
||||
|
||||
void tf_ssb_notify_message_added(tf_ssb_t* ssb, const char* author, int32_t sequence, const char* id, JSValue message_keys)
|
||||
|
@@ -903,10 +903,6 @@ void tf_ssb_db_add_blob_wants(sqlite3* db, const char* id)
|
||||
{
|
||||
tf_printf("blob wants cache update failed: %s.\n", sqlite3_errmsg(db));
|
||||
}
|
||||
else
|
||||
{
|
||||
tf_printf("want: %s\n", id);
|
||||
}
|
||||
}
|
||||
sqlite3_finalize(statement);
|
||||
}
|
||||
|
25
src/ssb.h
25
src/ssb.h
@@ -680,6 +680,31 @@ void tf_ssb_remove_message_added_callback(tf_ssb_t* ssb, tf_ssb_message_added_ca
|
||||
*/
|
||||
void tf_ssb_notify_message_added(tf_ssb_t* ssb, const char* author, int32_t sequence, const char* id, JSValue message_with_keys);
|
||||
|
||||
/**
|
||||
** A callback called when a blob is added to the database.
|
||||
** @param ssb The SSB instance.
|
||||
** @param id The blob identifier.
|
||||
** @param user_data The user data.
|
||||
*/
|
||||
typedef void(tf_ssb_blob_stored_callback_t)(tf_ssb_t* ssb, const char* id, void* user_data);
|
||||
|
||||
/**
|
||||
** Register a callback called when a blob is added to the database.
|
||||
** @param ssb The SSB instance.
|
||||
** @param callback The callback function.
|
||||
** @param cleanup A function to call when the callback is removed.
|
||||
** @param user_data User data to pass to the callback.
|
||||
*/
|
||||
void tf_ssb_add_blob_stored_callback(tf_ssb_t* ssb, tf_ssb_blob_stored_callback_t* callback, tf_ssb_callback_cleanup_t* cleanup, void* user_data);
|
||||
|
||||
/**
|
||||
** Remove a callback registered for when a blob is added to the database.
|
||||
** @param ssb The SSB instance.
|
||||
** @param callback The callback function.
|
||||
** @param user_data User data registered with the callback.
|
||||
*/
|
||||
void tf_ssb_remove_blob_stored_callback(tf_ssb_t* ssb, tf_ssb_blob_stored_callback_t* callback, void* user_data);
|
||||
|
||||
/**
|
||||
** Record that a new blob was stored.
|
||||
** @param ssb The SSB instance.
|
||||
|
24
src/ssb.js.c
24
src/ssb.js.c
@@ -1627,6 +1627,20 @@ static void _tf_ssb_on_message_added_callback(tf_ssb_t* ssb, const char* author,
|
||||
JS_FreeValue(context, string);
|
||||
}
|
||||
|
||||
static void _tf_ssb_on_blob_stored_callback(tf_ssb_t* ssb, const char* id, void* user_data)
|
||||
{
|
||||
JSContext* context = tf_ssb_get_context(ssb);
|
||||
JSValue callback = JS_MKPTR(JS_TAG_OBJECT, user_data);
|
||||
JSValue string = JS_NewString(context, id);
|
||||
JSValue response = JS_Call(context, callback, JS_UNDEFINED, 1, &string);
|
||||
if (tf_util_report_error(context, response))
|
||||
{
|
||||
tf_ssb_remove_blob_stored_callback(ssb, _tf_ssb_on_blob_stored_callback, user_data);
|
||||
}
|
||||
JS_FreeValue(context, response);
|
||||
JS_FreeValue(context, string);
|
||||
}
|
||||
|
||||
static void _tf_ssb_on_blob_want_added_callback(tf_ssb_t* ssb, const char* id, void* user_data)
|
||||
{
|
||||
JSContext* context = tf_ssb_get_context(ssb);
|
||||
@@ -1747,6 +1761,11 @@ static JSValue _tf_ssb_add_event_listener(JSContext* context, JSValueConst this_
|
||||
void* ptr = JS_VALUE_GET_PTR(JS_DupValue(context, callback));
|
||||
tf_ssb_add_message_added_callback(ssb, _tf_ssb_on_message_added_callback, _tf_ssb_cleanup_value, ptr);
|
||||
}
|
||||
else if (strcmp(event_name, "blob") == 0)
|
||||
{
|
||||
void* ptr = JS_VALUE_GET_PTR(JS_DupValue(context, callback));
|
||||
tf_ssb_add_blob_stored_callback(ssb, _tf_ssb_on_blob_stored_callback, _tf_ssb_cleanup_value, ptr);
|
||||
}
|
||||
else if (strcmp(event_name, "blob_want_added") == 0)
|
||||
{
|
||||
void* ptr = JS_VALUE_GET_PTR(JS_DupValue(context, callback));
|
||||
@@ -1790,6 +1809,11 @@ static JSValue _tf_ssb_remove_event_listener(JSContext* context, JSValueConst th
|
||||
void* ptr = JS_VALUE_GET_PTR(JS_DupValue(context, callback));
|
||||
tf_ssb_remove_message_added_callback(ssb, _tf_ssb_on_message_added_callback, ptr);
|
||||
}
|
||||
else if (strcmp(event_name, "blob") == 0)
|
||||
{
|
||||
void* ptr = JS_VALUE_GET_PTR(JS_DupValue(context, callback));
|
||||
tf_ssb_remove_blob_stored_callback(ssb, _tf_ssb_on_blob_stored_callback, ptr);
|
||||
}
|
||||
else if (strcmp(event_name, "blob_want_added") == 0)
|
||||
{
|
||||
void* ptr = JS_VALUE_GET_PTR(JS_DupValue(context, callback));
|
||||
|
@@ -152,6 +152,12 @@ static void _wait_stored(tf_ssb_t* ssb, bool* stored)
|
||||
}
|
||||
}
|
||||
|
||||
static void _blob_stored(tf_ssb_t* ssb, const char* id, void* user_data)
|
||||
{
|
||||
tf_printf("blob stored %s\n", id);
|
||||
*(bool*)user_data = true;
|
||||
}
|
||||
|
||||
void tf_ssb_test_ssb(const tf_test_options_t* options)
|
||||
{
|
||||
tf_printf("Testing SSB.\n");
|
||||
@@ -224,8 +230,13 @@ void tf_ssb_test_ssb(const tf_test_options_t* options)
|
||||
|
||||
char blob_id[k_id_base64_len] = { 0 };
|
||||
const char* k_blob = "Hello, blob!";
|
||||
bool blob_stored = false;
|
||||
tf_ssb_add_blob_stored_callback(ssb0, _blob_stored, NULL, &blob_stored);
|
||||
b = tf_ssb_db_blob_store(ssb0, (const uint8_t*)k_blob, strlen(k_blob), blob_id, sizeof(blob_id), NULL);
|
||||
tf_ssb_notify_blob_stored(ssb0, blob_id);
|
||||
tf_ssb_remove_blob_stored_callback(ssb0, _blob_stored, &blob_stored);
|
||||
assert(b);
|
||||
assert(blob_stored);
|
||||
|
||||
JSContext* context0 = tf_ssb_get_context(ssb0);
|
||||
JSValue obj = JS_NewObject(context0);
|
||||
|
@@ -1,2 +1,2 @@
|
||||
#define VERSION_NUMBER "0.2025.8-wip"
|
||||
#define VERSION_NUMBER "0.2025.8"
|
||||
#define VERSION_NAME "This program kills fascists."
|
||||
|
@@ -93,7 +93,7 @@ try:
|
||||
select(driver, ['#document', 'frame', '#gs_room_name'], ('send_keys', 'test room'))
|
||||
select(driver, ['#document', 'frame', '//*[@id="gs_room_name"]/following-sibling::button'], ('click',))
|
||||
select(driver, ['//button[text()="✅ Allow"]'], ('click',))
|
||||
driver.switch_to.alert.accept()
|
||||
wait.until(expected_conditions.alert_is_present()).accept()
|
||||
|
||||
select(driver, ['tf-navigation', 'shadow_root', '#identity'], ('click',))
|
||||
select(driver, ['tf-navigation', 'shadow_root', '#logout'], ('click',))
|
||||
|
Reference in New Issue
Block a user