ssb: Dispatch blob wants immediately when added as the result of a web request.
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Build Tilde Friends / Build-All (push) Successful in 32m24s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	Build Tilde Friends / Build-All (push) Successful in 32m24s
				
			This commit is contained in:
		| @@ -132,9 +132,7 @@ | |||||||
| 						</ul> | 						</ul> | ||||||
| 					</div> | 					</div> | ||||||
| 					<footer class="w3-center w3-xlarge w3-padding"> | 					<footer class="w3-center w3-xlarge w3-padding"> | ||||||
| 						<button class="w3-button w3-yellow proceed" | 						<button class="w3-button w3-yellow proceed">Okay</button> | ||||||
| 							>Okay</button |  | ||||||
| 						> |  | ||||||
| 					</footer> | 					</footer> | ||||||
| 				</div> | 				</div> | ||||||
| 			</div> | 			</div> | ||||||
|   | |||||||
| @@ -421,13 +421,10 @@ class TfElement extends LitElement { | |||||||
| 			[JSON.stringify(Object.keys(users))] | 			[JSON.stringify(Object.keys(users))] | ||||||
| 		); | 		); | ||||||
| 		for (let row of info) { | 		for (let row of info) { | ||||||
| 			users[row.author] = Object.assign( | 			users[row.author] = Object.assign(users[row.author], { | ||||||
| 				users[row.author], |  | ||||||
| 				{ |  | ||||||
| 				seq: row.max_sequence, | 				seq: row.max_sequence, | ||||||
| 				ts: row.max_ts, | 				ts: row.max_ts, | ||||||
| 				} | 			}); | ||||||
| 			); |  | ||||||
| 		} | 		} | ||||||
| 		return users; | 		return users; | ||||||
| 	} | 	} | ||||||
|   | |||||||
| @@ -1116,6 +1116,7 @@ typedef struct _view_t | |||||||
| 	void* data; | 	void* data; | ||||||
| 	size_t size; | 	size_t size; | ||||||
| 	char etag[256]; | 	char etag[256]; | ||||||
|  | 	char notify_want_blob_id[k_blob_id_len]; | ||||||
| 	bool not_modified; | 	bool not_modified; | ||||||
| } view_t; | } view_t; | ||||||
|  |  | ||||||
| @@ -1175,6 +1176,7 @@ static void _httpd_endpoint_view_work(tf_ssb_t* ssb, void* user_data) | |||||||
| 				sqlite3* db = tf_ssb_acquire_db_writer(ssb); | 				sqlite3* db = tf_ssb_acquire_db_writer(ssb); | ||||||
| 				tf_ssb_db_add_blob_wants(db, blob_id); | 				tf_ssb_db_add_blob_wants(db, blob_id); | ||||||
| 				tf_ssb_release_db_writer(ssb, db); | 				tf_ssb_release_db_writer(ssb, db); | ||||||
|  | 				snprintf(view->notify_want_blob_id, sizeof(view->notify_want_blob_id), "%s", blob_id); | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| @@ -1218,6 +1220,12 @@ static void _httpd_endpoint_view_after_work(tf_ssb_t* ssb, int status, void* use | |||||||
| 		const char* k_payload = tf_http_status_text(404); | 		const char* k_payload = tf_http_status_text(404); | ||||||
| 		tf_http_respond(view->request, 404, NULL, 0, k_payload, strlen(k_payload)); | 		tf_http_respond(view->request, 404, NULL, 0, k_payload, strlen(k_payload)); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | 	if (*view->notify_want_blob_id) | ||||||
|  | 	{ | ||||||
|  | 		tf_ssb_notify_blob_want_added(ssb, view->notify_want_blob_id); | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	tf_free(view->form_data); | 	tf_free(view->form_data); | ||||||
| 	tf_http_request_unref(view->request); | 	tf_http_request_unref(view->request); | ||||||
| 	tf_free(view); | 	tf_free(view); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user