From: Art Cancro Date: Wed, 26 Jan 2011 21:18:22 +0000 (-0500) Subject: Removed the MESSAGE_IN_ROOM sections in order to make way for a faster algorithm. X-Git-Tag: v8.01~252^2~144 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=2599a38c6e2c3854940187895db140d1ff533fa9;p=citadel.git Removed the MESSAGE_IN_ROOM sections in order to make way for a faster algorithm. --- diff --git a/citadel/msgbase.c b/citadel/msgbase.c index bcc67be38..79537f6d4 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -1097,49 +1097,6 @@ void mime_spew_section(char *name, char *filename, char *partnum, char *disp, } } -#ifdef MESSAGE_IN_ROOM -/* - * Check if a message is in the current room. - * This is used by CtdlFetchMessage to prevent random picking - * of messages from users private rooms - * - * The message list should probably be cached against the CC->room - */ -int CtdlMessageInRoom(long msgnum) -{ - visit vbuf; - struct cdbdata *cdbfr; - - /* Learn about the user and room in question */ - CtdlGetUser(&CC->user, CC->curr_user); - CtdlGetRelationship(&vbuf, &CC->user, &CC->room); - - /* Load the message list */ - cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->room.QRnumber, sizeof(long)); - if (cdbfr != NULL) { - long *msglist = NULL; - int num_msgs = 0; - int i; - int r = 0; - - msglist = (long *) cdbfr->ptr; - num_msgs = cdbfr->len / sizeof(long); - - /* search for message msgnum */ - for (i=0; i