* fix URL parsing for /message/
authorWilfried Göesgens <willi@citadel.org>
Tue, 19 May 2009 19:47:06 +0000 (19:47 +0000)
committerWilfried Göesgens <willi@citadel.org>
Tue, 19 May 2009 19:47:06 +0000 (19:47 +0000)
webcit/messages.c

index 055fae22cbc4ae478dd6014da4593279727a048a..70b2a794944947994a3d4a4c900f8f6f3d955d69 100644 (file)
@@ -364,9 +364,18 @@ void handle_one_message(void)
        wcsession *WCC = WC;
        const StrBuf *Tmpl;
        StrBuf *CmdBuf = NULL;
+       const char *pMsg;
 
-       //msgnum = StrTol(WCC->UrlFragment3);
-       //gotoroom(WCC->UrlFragment2);
+
+       pMsg = strchr(ChrPtr(WCC->Hdr->ReqLine), '/');
+       if (pMsg == NULL) {
+               HttpStatus(CitStatus);
+               return;
+       }
+
+       msgnum = atol(pMsg + 1);
+       StrBufCutAt(WCC->Hdr->ReqLine, 0, pMsg);
+       gotoroom(WCC->Hdr->ReqLine);
        switch (WCC->Hdr->eReqType)
        {
        case eGET: