From 4b2fbf86132f334b34b6eb68166899093642628e Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 20 May 2011 18:09:36 -0400 Subject: [PATCH] We need EUID indexing for Blog rooms. --- citadel/euidindex.c | 1 + webcit/blogview_renderer.c | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/citadel/euidindex.c b/citadel/euidindex.c index 8bad12925..dbc89adaa 100644 --- a/citadel/euidindex.c +++ b/citadel/euidindex.c @@ -74,6 +74,7 @@ int DoesThisRoomNeedEuidIndexing(struct ctdlroom *qrbuf) { case VIEW_TASKS: return(1); case VIEW_NOTES: return(1); case VIEW_WIKI: return(1); + case VIEW_BLOG: return(1); } return(0); diff --git a/webcit/blogview_renderer.c b/webcit/blogview_renderer.c index 25af87053..f8ba6cd27 100644 --- a/webcit/blogview_renderer.c +++ b/webcit/blogview_renderer.c @@ -28,9 +28,10 @@ */ struct blogpost { int top_level_id; - long *msgs; /* Array of msgnums for messages we are displaying */ - int num_msgs; /* Number of msgnums stored in 'msgs' */ - int alloc_msgs; /* Currently allocated size of array */ + long *msgs; /* Array of msgnums for messages we are displaying */ + int num_msgs; /* Number of msgnums stored in 'msgs' */ + int alloc_msgs; /* Currently allocated size of array */ + char euid[BLOG_EUIDBUF_SIZE]; /* please do not change this to a StrBuf */ }; @@ -53,8 +54,10 @@ void blogpost_render_and_destroy(struct blogpost *bp) { if (p == 0) { /* Show the number of comments */ - wc_printf("top_level_id); - urlescputs(ChrPtr(WC->CurRoom.name)); + wc_printf("top_level_id); + wc_printf("?euid="); urlescputs(bp->euid); /* FIXME not really */ + wc_printf("?go="); urlescputs(ChrPtr(WC->CurRoom.name)); wc_printf("#comments\">"); wc_printf(_("%d comments"), bp->num_msgs - 1); wc_printf(""); @@ -185,6 +188,7 @@ int blogview_LoadMsgFromServer(SharedMessageStatus *Stat, if (!bp) return(200); memset(bp, 0, sizeof (struct blogpost)); bp->top_level_id = b.id; + strcpy(bp->euid, b.euid); Put(BLOG, (const char *)&b.id, sizeof(b.id), bp, (DeleteHashDataFunc)blogpost_render_and_destroy); } -- 2.30.2