- /* Found it! Now read it. FIXME this is where we have to add the ability to read an old rev */
- msgnum = locate_message_by_uid(pagename);
+ /* Found it! Now read it. */
+
+ if ((rev != NULL) && (strlen(rev) > 0)) {
+ /* read an older revision */
+ serv_printf("WIKI rev|%s|%s|fetch", pagename, rev);
+ serv_getln(buf, sizeof buf);
+ if (buf[0] == '2') {
+ msgnum = extract_long(&buf[4], 0);
+ }
+ }
+ else {
+ /* read the current revision? */
+ msgnum = locate_message_by_uid(pagename);
+ }
+