Commit d17928a2 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Fix get_unread_confs.

parent 22389aea
Thu Mar 12 04:30:17 1992 Per Cederqvist (ceder@lysator)
* membership.c (get_unread_confs): You must be logged in to use
this call.
Mon Mar 9 16:33:45 1992 Per Cederqvist (ceder@robin)
* DATAFILE_NAME (server-config.c): Added a comment.
......
/*
* $Id: membership.c,v 0.8 1991/12/16 23:56:33 ceder Exp $
* $Id: membership.c,v 0.9 1992/03/12 03:36:52 ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -29,7 +29,7 @@
* (The person/conf relation).
*/
static char *rcsid = "$Id: membership.c,v 0.8 1991/12/16 23:56:33 ceder Exp $";
static char *rcsid = "$Id: membership.c,v 0.9 1992/03/12 03:36:52 ceder Exp $";
#include <time.h>
#include <stdlib.h>
......@@ -668,8 +668,9 @@ fast_access_perm(Conf_no victim,
return member;
}
/* Only read in conference struct when really necessary. */
if ( (conf_type=cached_get_conf_type( victim )).secret )
/* Only read in conference struct when really necessary. */
conf_type = cached_get_conf_type (victim);
if ( conf_type.secret )
return access_perm(victim, NULL, viewer, viewer_p);
if ( conf_type.rd_prot )
......@@ -1163,6 +1164,7 @@ get_unread_confs(Pers_no pers_no,
Membership *confs;
u_short n;
CHK_LOGIN(FAILURE);
GET_P_STAT(pers_p, pers_no, FAILURE);
result->conf_nos = tmp_alloc (pers_p->conferences.no_of_confs
......@@ -1173,8 +1175,10 @@ get_unread_confs(Pers_no pers_no,
n < pers_p->conferences.no_of_confs;
n++, confs++ )
{
if ( confs->last_text_read
< cached_get_highest_local_no( confs->conf_no ) )
if ((confs->last_text_read
< cached_get_highest_local_no (confs->conf_no))
&& (fast_access_perm(confs->conf_no, NULL, ACTPERS, ACT_P)
> read_protected))
{
result->conf_nos[ result->no_of_confs++ ] = confs->conf_no;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment