Commit 7afa242a authored by Kent Engström's avatar Kent Engström
Browse files

set-last-read added.

parent 5d613181
/*
* $Id: services.h,v 0.22 1995/01/01 20:17:09 ceder Exp $
* $Id: services.h,v 0.23 1995/10/31 09:11:58 kent Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -292,11 +292,20 @@ KOM_( sub_member (Conf_no conf_no,
/*
* Tell the server that I want to mark/unmark texts as read so that I
* get no_of_unread unread texts in conf_no.
*
* The new alternative function marks last_read as the last read local
* text. Use this one to avoid race conditions.
*/
extern Success
KOM_( set_unread (Conf_no conf_no,
Text_no no_of_unread));
extern Success
KOM_( set_last_read (Conf_no conf_no,
Text_no last_read));
/*
* set_presentation and set_etc_motd also does some magic with the
* no_of_marks field in the Text_stat structure of the old and new text.
......
#
# $Id: fncdef.txt,v 0.17 1994/12/31 15:18:05 ceder Exp $
# $Id: fncdef.txt,v 0.18 1995/10/31 09:12:31 kent Exp $
# Copyright (C) 1991, 1992, 1993, 1994 Lysator Academic Computer Association.
#
# This file is part of the LysKOM server.
......@@ -22,7 +22,7 @@
#
# Please mail bug reports to bug-lyskom@lysator.liu.se.
#
# $Id: fncdef.txt,v 0.17 1994/12/31 15:18:05 ceder Exp $
# $Id: fncdef.txt,v 0.18 1995/10/31 09:12:31 kent Exp $
#
# This file is used to describe the functions in services.c. All
# functions that are reachable from the clients are listed here, together
......@@ -112,3 +112,4 @@ success unmark_text num
success re_z_lookup c_string (param.regexp_len) num num : conf_z_info_list
success get_version_info : version_info
success lookup_z_name c_string (param.conf_name_len) num num : conf_z_info_list
success set_last_read num num
/*
* $Id: membership.c,v 0.23 1994/11/14 23:41:02 ceder Exp $
* $Id: membership.c,v 0.24 1995/10/31 09:12:35 kent Exp $
* Copyright (C) 1991, 1992, 1993, 1994 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -31,7 +31,7 @@
#define DEBUG_MARK_AS_READ
static char *rcsid = "$Id: membership.c,v 0.23 1994/11/14 23:41:02 ceder Exp $";
static char *rcsid = "$Id: membership.c,v 0.24 1995/10/31 09:12:35 kent Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -1230,3 +1230,40 @@ set_unread (Conf_no conf_no,
return OK;
}
/*
* Tell the server that I want to mark/unmark texts as read so that
* last_read is the last read text in conf_no.
*/
extern Success
set_last_read (Conf_no conf_no,
Text_no last_read)
{
Membership *mship;
Conference *conf_c;
Local_text_no last;
CHK_LOGIN(FAILURE);
GET_C_STAT(conf_c, conf_no, FAILURE);
if ( (mship = locate_membership(conf_no, ACT_P)) == NULL )
{
kom_errno = KOM_NOT_MEMBER;
return FAILURE;
}
last = conf_c->texts.first_local_no + conf_c->texts.no_of_texts - 1;
mship->last_text_read = ((last_read <= last)
? last_read : last);
sfree(mship->read_texts);
mship->read_texts = NULL;
mship->no_of_read = 0;
mark_person_as_changed(ACTPERS);
return OK;
}
/*
* $Id: prot-a.c,v 0.30 1994/12/31 15:17:42 ceder Exp $
* $Id: prot-a.c,v 0.31 1995/10/31 09:12:38 kent Exp $
* Copyright (C) 1991, 1992, 1993, 1994 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -26,7 +26,7 @@
* Protocol A.
*/
static char *rcsid = "$Id: prot-a.c,v 0.30 1994/12/31 15:17:42 ceder Exp $";
static char *rcsid = "$Id: prot-a.c,v 0.31 1995/10/31 09:12:38 kent Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -352,6 +352,7 @@ prot_a_is_legal_fnc(Call_header fnc)
case call_fnc_re_z_lookup:
case call_fnc_get_version_info:
case call_fnc_lookup_z_name:
case call_fnc_set_last_read:
return TRUE;
default:
......
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