Revert "ssb: Try harder to replicate profile images, even if they were set before our blob replication cutoff."
Some checks failed
Build Tilde Friends / Build-All (push) Has been cancelled
Some checks failed
Build Tilde Friends / Build-All (push) Has been cancelled
This reverts commit 7f4e2617ee
.
This commit is contained in:
parent
be1b5bce4f
commit
6d6927213f
27
src/ssb.db.c
27
src/ssb.db.c
@ -233,28 +233,13 @@ void tf_ssb_db_init(tf_ssb_t* ssb)
|
|||||||
_tf_ssb_db_exec(db, "DROP VIEW IF EXISTS blob_wants_view");
|
_tf_ssb_db_exec(db, "DROP VIEW IF EXISTS blob_wants_view");
|
||||||
_tf_ssb_db_exec(db,
|
_tf_ssb_db_exec(db,
|
||||||
"CREATE VIEW IF NOT EXISTS blob_wants_view (id, timestamp) AS "
|
"CREATE VIEW IF NOT EXISTS blob_wants_view (id, timestamp) AS "
|
||||||
" WITH wanted AS ( "
|
" SELECT messages_refs.ref AS id, messages.timestamp AS timestamp "
|
||||||
" SELECT messages_refs.ref AS id, messages.timestamp AS timestamp "
|
" FROM messages_refs "
|
||||||
" FROM messages_refs "
|
" JOIN messages ON messages.id = messages_refs.message "
|
||||||
" JOIN messages ON messages.id = messages_refs.message "
|
" LEFT OUTER JOIN blobs ON messages_refs.ref = blobs.id "
|
||||||
" UNION "
|
|
||||||
" SELECT image as id, unixepoch() AS timestamp "
|
|
||||||
" FROM ("
|
|
||||||
" SELECT "
|
|
||||||
" messages.author, "
|
|
||||||
" RANK() OVER (PARTITION BY messages.author ORDER BY messages.sequence DESC) AS author_rank, "
|
|
||||||
" COALESCE(messages.content ->> '$.image.link', messages.content ->> 'image') AS image "
|
|
||||||
" FROM messages "
|
|
||||||
" WHERE "
|
|
||||||
" json_extract(messages.content, '$.type') = 'about' AND "
|
|
||||||
" content ->> 'about' = messages.author AND image IS NOT NULL "
|
|
||||||
" ) WHERE author_rank = 1 "
|
|
||||||
" ) "
|
|
||||||
" SELECT wanted.id, wanted.timestamp FROM wanted "
|
|
||||||
" LEFT OUTER JOIN blobs ON wanted.id = blobs.id "
|
|
||||||
" WHERE blobs.id IS NULL "
|
" WHERE blobs.id IS NULL "
|
||||||
" AND LENGTH(wanted.id) = 52 "
|
" AND LENGTH(messages_refs.ref) = 52 "
|
||||||
" AND wanted.id LIKE '&%.sha256'");
|
" AND messages_refs.ref LIKE '&%.sha256'");
|
||||||
|
|
||||||
bool need_add_flags = true;
|
bool need_add_flags = true;
|
||||||
bool need_convert_timestamp_to_real = false;
|
bool need_convert_timestamp_to_real = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user