From: Art Cancro Date: Thu, 21 Apr 2016 15:21:57 +0000 (-0400) Subject: Display roompic in the banner using the new code X-Git-Tag: Release_902~23 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=9f76054e67c51553e292fa45faa30a6cb6e0badb Display roompic in the banner using the new code --- 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); }