- Line = NewStrBuf();
- serv_printf("UIMG 0||%s", filename);
- StrBuf_ServGetln(Line);
- if (GetServerStatusMsg(Line, NULL, 1, 2) != 2) {
+// display the picture (icon, photo, whatever) associated with the current room
+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 the picture (icon, photo, whatever) associated with the current room
+void common_code_for_editroompic_and_editpic(char *servcmd) {
+ if (havebstr("cancel_button")) {
+ AppendImportantMessage(_("Graphics upload has been cancelled."), -1);
+ display_main_menu();
+ return;
+ }
+
+ if (WC->upload_length == 0) {
+ AppendImportantMessage(_("You didn't upload a file."), -1);