From 409d250c27dc04da7280648445289a54bf77c9ad Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 20 Apr 2016 10:17:22 -0400 Subject: [PATCH] LoadXRoomPic() and the XHaveRoomPicLoaded conditional moved from OIMG to DLRI server command --- webcit/roomops.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/webcit/roomops.c b/webcit/roomops.c index 2ea692862..3aa28ea91 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -590,22 +590,24 @@ void LoadXRoomPic(void) { wcsession *WCC = WC; StrBuf *Buf; + off_t bytes; - if (WCC->CurRoom.XHaveRoomPicLoaded) + if (WCC->CurRoom.XHaveRoomPicLoaded) { return; + } WCC->CurRoom.XHaveRoomPicLoaded = 1; Buf = NewStrBuf(); - serv_puts("OIMG _roompic_"); + serv_puts("DLRI"); StrBuf_ServGetln(Buf); - if (GetServerStatus(Buf, NULL) != 2) { - WCC->CurRoom.XHaveRoomPic = 0; - } else { + if (GetServerStatus(Buf, NULL) == 6) { + StrBufCutLeft(Buf, 4); + bytes = StrBufExtract_long(Buf, 0, '|'); WCC->CurRoom.XHaveRoomPic = 1; + StrBuf_ServGetBLOBBuffered(Buf, bytes); // discard the data + } else { + WCC->CurRoom.XHaveRoomPic = 0; } - serv_puts("CLOS"); - StrBuf_ServGetln(Buf); - GetServerStatus(Buf, NULL); FreeStrBuf (&Buf); } -- 2.30.2