X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Feuidindex.c;h=abab0383e49906b9561c1a613b73073174a962be;hb=f1f384a7cd03094670fbc57398826666e85981af;hp=cada83ac7591476a300c2c23feba6cefec0d2948;hpb=00d926a13f6bf590b7fa34debc270b26f112a5ff;p=citadel.git diff --git a/citadel/euidindex.c b/citadel/euidindex.c index cada83ac7..abab0383e 100644 --- a/citadel/euidindex.c +++ b/citadel/euidindex.c @@ -190,16 +190,35 @@ void rebuild_euid_index(void) { void cmd_euid(char *cmdbuf) { char euid[256]; long msgnum; + struct cdbdata *cdbfr; + long *msglist = NULL; + int num_msgs = 0; + int i; if (CtdlAccessCheck(ac_logged_in)) return; extract_token(euid, cmdbuf, 0, '|', sizeof euid); msgnum = locate_message_by_euid(euid, &CC->room); - - if (msgnum > 0L) { - cprintf("%d %ld\n", CIT_OK, msgnum); - } - else { + if (msgnum <= 0L) { cprintf("%d not found\n", ERROR + MESSAGE_NOT_FOUND); + return; + } + + cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->room.QRnumber, sizeof(long)); + if (cdbfr != NULL) { + num_msgs = cdbfr->len / sizeof(long); + msglist = (long *) cdbfr->ptr; + for (i = 0; i < num_msgs; ++i) { + if (msglist[i] == msgnum) { + cdb_free(cdbfr); + cprintf("%d %ld\n", CIT_OK, msgnum); + return; + } + } + cdb_free(cdbfr); } + + cprintf("%d not found\n", ERROR + MESSAGE_NOT_FOUND); } + +