Enhance delete event handling and logging

- Improved logging for delete events in handle-delete.go, including detailed information about the event and its tags.
- Added checks for admin and owner deletions, with appropriate logging for each case.
- Updated HandleEvent to process delete events more robustly, including success and error logging.
- Introduced a new fetchEventById function in nostr.js to verify event deletion.
- Updated App.svelte to handle event deletion verification and state management.
- Changed favicon references in HTML files to use the new orly-favicon.png.
- Added orly-favicon.png to the public and docs directories for consistent branding.
This commit is contained in:
2025-10-10 20:36:53 +01:00
parent dc184d7ff5
commit 67a74980f9
12 changed files with 278 additions and 32 deletions

View File

@@ -34,6 +34,7 @@ type Server struct {
remote string
publishers *publish.S
Admins [][]byte
Owners [][]byte
*database.D
// optional reverse proxy for dev web server
@@ -179,7 +180,7 @@ func (s *Server) UserInterface() {
s.challengeMutex.Unlock()
}
// Serve favicon.ico by serving orly.png
// Serve favicon.ico by serving orly-favicon.png
s.mux.HandleFunc("/favicon.ico", s.handleFavicon)
// Serve the main login interface (and static assets) or proxy in dev mode
@@ -206,7 +207,7 @@ func (s *Server) UserInterface() {
s.mux.HandleFunc("/api/sprocket/config", s.handleSprocketConfig)
}
// handleFavicon serves orly.png as favicon.ico
// handleFavicon serves orly-favicon.png as favicon.ico
func (s *Server) handleFavicon(w http.ResponseWriter, r *http.Request) {
// In dev mode with proxy configured, forward to dev server
if s.devProxy != nil {
@@ -214,14 +215,14 @@ func (s *Server) handleFavicon(w http.ResponseWriter, r *http.Request) {
return
}
// Serve orly.png as favicon.ico from embedded web app
// Serve orly-favicon.png as favicon.ico from embedded web app
w.Header().Set("Content-Type", "image/png")
w.Header().Set("Cache-Control", "public, max-age=86400") // Cache for 1 day
// Create a request for orly.png and serve it
// Create a request for orly-favicon.png and serve it
faviconReq := &http.Request{
Method: "GET",
URL: &url.URL{Path: "/orly.png"},
URL: &url.URL{Path: "/orly-favicon.png"},
}
ServeEmbeddedWeb(w, faviconReq)
}