From 9f76054e67c51553e292fa45faa30a6cb6e0badb Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 21 Apr 2016 11:21:57 -0400 Subject: [PATCH] Display roompic in the banner using the new code --- webcit/graphics.c | 24 ++++++++++++++++++++++++ webcit/static/t/room/view_picture.html | 2 +- webcit/useredit.c | 1 - 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/webcit/graphics.c b/webcit/graphics.c index 863242f81..9b396f448 100644 --- a/webcit/graphics.c +++ b/webcit/graphics.c @@ -17,6 +17,29 @@ extern void output_static(const char* What); + +void display_roompic(void) { + off_t bytes; + StrBuf *Buf = NewStrBuf(); + serv_printf("DLRI"); + StrBuf_ServGetln(Buf); + if (GetServerStatus(Buf, NULL) == 6) { + StrBufCutLeft(Buf, 4); + bytes = StrBufExtract_long(Buf, 0, '|'); + StrBuf *content_type = NewStrBuf(); + StrBufExtract_token(content_type, Buf, 3, '|'); + WC->WBuf = NewStrBuf(); + StrBuf_ServGetBLOBBuffered(WC->WBuf, bytes); + http_transmit_thing(ChrPtr(content_type), 0); + FreeStrBuf(&content_type); + } + else { + output_error_pic("", ""); + } + FreeStrBuf(&Buf); +} + + // upload your photo void editpic(void) { @@ -180,4 +203,5 @@ InitModule_GRAPHICS WebcitAddUrlHandler(HKEY("edithellopic"), "", 0, edithellopic, 0); WebcitAddUrlHandler(HKEY("display_editgoodbuye"), "", 0, display_editgoodbyepic, 0); WebcitAddUrlHandler(HKEY("editgoodbuyepic"), "", 0, editgoodbuyepic, 0); + WebcitAddUrlHandler(HKEY("roompic"), "", 0, display_roompic, 0); } diff --git a/webcit/static/t/room/view_picture.html b/webcit/static/t/room/view_picture.html index 319e21c4e..cbd8a6d9a 100644 --- a/webcit/static/t/room/view_picture.html +++ b/webcit/static/t/room/view_picture.html @@ -1,5 +1,5 @@ -<?_(" src="image?name=_roompic_?room="> +<?_(" src="roompic?room="> diff --git a/webcit/useredit.c b/webcit/useredit.c index e7ba2b2bb..e0ac08f01 100644 --- a/webcit/useredit.c +++ b/webcit/useredit.c @@ -801,7 +801,6 @@ void display_userpic(void) { } - void _select_user_to_edit(void) { select_user_to_edit(NULL); } -- 2.30.2